Skip to content

Commit

Permalink
chore: Upgrade typescript to v5.2.2 (#561)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Aug 28, 2023
1 parent e86be78 commit 8de8822
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 44 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"standard-version": "9.5.0",
"ts-expect": "1.3.0",
"ts-node": "10.9.1",
"typescript": "5.1.3"
"typescript": "5.2.2"
},
"peerDependencies": {
"mongodb": "^5.0.0"
Expand Down
82 changes: 41 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,16 @@ export function build<TSchema extends BaseSchema, TOptions extends SchemaOptions
// @ts-expect-error Ignore `string` type mismatched to `keyof TSchema`
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
const key: keyof TSchema = Object.keys(filter)[0] || '_id';

const result = await model.findOne(filter, {
projection: { _id: 0, [key]: 1 } as const,
projection: {
// @ts-expect-error `_id` is not found in the projection type
_id: 0,
[key]: 1,
} as const,
...options,
});

return !!result;
};

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"module": "ESNext",
"moduleResolution": "Node",
"noEmit": true,
"noErrorTruncation": true,
"noErrorTruncation": false,
"noImplicitReturns": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
Expand Down

0 comments on commit 8de8822

Please sign in to comment.