Skip to content

Commit

Permalink
fix: deprecated checkSVKValidationPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
foxhound87 committed Jan 17, 2024
1 parent ed171fc commit e593c96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 6.9.2 (master)
- deprecated `checkSVKValidationPlugin`

# 6.9.1 (master)
- introduced `validate()` input types.
- introduced `ValidateOptions` & `ValidateOptionsInterface` models.
Expand Down
8 changes: 0 additions & 8 deletions src/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default class Validator implements ValidatorInterface {
Object.assign(this.plugins, obj.plugins);

this.initDrivers();
this.checkSVKValidationPlugin();
}

initDrivers(): void {
Expand Down Expand Up @@ -171,11 +170,4 @@ export default class Validator implements ValidatorInterface {
})
);
}

checkSVKValidationPlugin(): void {
if (_.isNil(this.drivers.svk) && _.get(this.plugins, "svk.config.schema")) {
const name = this.form.name ? `Form: ${this.form.name}` : "";
throw new Error(`The SVK validation schema is defined but no plugin provided (SVK). ${name}`);
}
}
}
3 changes: 1 addition & 2 deletions src/models/ValidatorInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export interface ValidatorInterface {
validate(opt?: ValidateOptions, obj?: ValidateOptions): Promise<any>;
validateField(opt: ValidateOptionsInterface): void;
validateRelatedFields(field: any, showErrors: boolean): void;
checkSVKValidationPlugin(): void;
}

export type ValidationPlugin = {
Expand All @@ -47,7 +46,7 @@ export type ExtendPlugin = ({ validator, form }: {
}) => void;

export interface ValidationPluginConfig {
package: ValidationPackage;
package?: ValidationPackage;
schema?: any;
options?: any;
extend?: ExtendPlugin;
Expand Down

0 comments on commit e593c96

Please sign in to comment.