Skip to content

Commit

Permalink
Validator on config obj builder + type handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
kristianmandrup committed Dec 8, 2022
1 parent 75a5ce3 commit f79cf6a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions __config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface YupBuilderConfig extends TypeHandlerConfig {
format?: boolean;
dependenciesMap?: object;
schemaParserMap?: object;
validator?: object;
messages?: object;
mode?: object;
mixedEnabled?: object;
Expand Down
2 changes: 1 addition & 1 deletion src/yup-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class YupBuilder extends Base {
}

get validator() {
return yup;
return this.config.validator || yup;
}

setLocale() {
Expand Down
1 change: 1 addition & 0 deletions types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface YupBuilderConfig extends TypeHandlerConfig {
isNumber?: (obj: any) => boolean;
isObject?: (obj: any) => boolean;
format?: boolean;
validator?: object;
dependenciesMap?: object;
schemaParserMap?: object;
messages?: object;
Expand Down

0 comments on commit f79cf6a

Please sign in to comment.