Skip to content

Commit 399531b

Browse files
committed
types: propagate DocType down to validators for validate() and validateAll()
1 parent 55774c6 commit 399531b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/schematypes.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ declare module 'mongoose' {
285285
validators: Validator[];
286286

287287
/** Adds validator(s) for this document path. */
288-
validate(obj: RegExp | ValidatorFunction | Validator, errorMsg?: string, type?: string): this;
288+
validate(obj: RegExp | ValidatorFunction<DocType> | Validator<DocType>, errorMsg?: string, type?: string): this;
289289

290290
/** Adds multiple validators for this document path. */
291-
validateAll(validators: Array<RegExp | ValidatorFunction | Validator>): this;
291+
validateAll(validators: Array<RegExp | ValidatorFunction<DocType> | Validator<DocType>>): this;
292292

293293
/** Default options for this SchemaType */
294294
defaultOptions?: Record<string, any>;

0 commit comments

Comments
 (0)