Skip to content

Commit

Permalink
fixup! chore: Upgrade typescript to v5.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
avaly committed Aug 28, 2023
1 parent 0fcaa06 commit 51600f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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 51600f3

Please sign in to comment.