Skip to content

Commit 481f7ec

Browse files
committed
types: avoid inferring Boolean, Buffer, ObjectId as Date in schema definitions under certain circumstances
Fix #14630
1 parent 45be329 commit 481f7ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ declare module 'mongoose' {
493493
export type NumberSchemaDefinition = typeof Number | 'number' | 'Number' | typeof Schema.Types.Number;
494494
export type StringSchemaDefinition = typeof String | 'string' | 'String' | typeof Schema.Types.String;
495495
export type BooleanSchemaDefinition = typeof Boolean | 'boolean' | 'Boolean' | typeof Schema.Types.Boolean;
496-
export type DateSchemaDefinition = typeof NativeDate | 'date' | 'Date' | typeof Schema.Types.Date;
496+
export type DateSchemaDefinition = DateConstructor | 'date' | 'Date' | typeof Schema.Types.Date;
497497
export type ObjectIdSchemaDefinition = 'ObjectId' | 'ObjectID' | typeof Schema.Types.ObjectId;
498498

499499
export type SchemaDefinitionWithBuiltInClass<T> = T extends number

0 commit comments

Comments
 (0)