Skip to content

Commit

Permalink
fix(type): ensure both types have names before comparing in isSameTyp…
Browse files Browse the repository at this point in the history
…e function (#474)

* fix(type): ensure types have names before comparing in isSameType function

Fixes failing `basic union with number | uuid` test in bson package

* ci: bump nodejs version
  • Loading branch information
marcus-sa committed Oct 1, 2023
1 parent 8a45194 commit 0ed13d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.17.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.17.0]
postgres-version: [ 14 ]
services:
postgres:
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.17.0]
mysql-version: [ 8.0 ]
services:
mysql:
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.17.0]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
strategy:
matrix:
node-version: [ 18.x ]
node-version: [18.17.0]
mongo-version: [ 4.0 ]
services:
# this is used for the simple-auth test
Expand Down
2 changes: 1 addition & 1 deletion packages/type/src/reflection/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ export function isSameType(a: Type, b: Type, stack: StackEntry[] = []): boolean

try {
if (a.kind !== b.kind) return false;
if (a.typeName !== b.typeName) return false;
if (a.typeName && b.typeName && a.typeName !== b.typeName) return false;
if (a.kind === ReflectionKind.infer || b.kind === ReflectionKind.infer) return false;

if (a.kind === ReflectionKind.literal) return a.literal === (b as TypeLiteral).literal;
Expand Down

0 comments on commit 0ed13d0

Please sign in to comment.