Skip to content

Commit

Permalink
types: propagate DocType down to validators for validate() and valida…
Browse files Browse the repository at this point in the history
…teAll()
  • Loading branch information
vkarpov15 committed Mar 14, 2024
1 parent 55774c6 commit 399531b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/schematypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ declare module 'mongoose' {
validators: Validator[];

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

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

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

0 comments on commit 399531b

Please sign in to comment.