Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#feature: included validate() fields option #113

Open
wants to merge 1 commit into
base: mapped-types-v4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4/lib/model.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2518,9 +2518,9 @@ export interface Instance {
* Emits null if and only if validation successful; otherwise an Error instance containing
* { field name : [error msgs] } entries.
*
* @param options.skip An array of strings. All properties that are in this array will not be validated
* @param options Options that are passed to the validator
*/
validate(options?: { skip?: string[] }): Promise<void>;
validate(options?: { skip?: string[], fields?: string[] }): Promise<ValidationError>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type is wrong. It was correct before.

The promise fulfills if and only if validation successful; otherwise it rejects an Error instance containing { field name : [error msgs] } entries.


/**
* This is the same as calling `set` and then calling `save`.
Expand Down