From be2a0cdc916d05583b60dafeaf19f62d0350c9dd Mon Sep 17 00:00:00 2001 From: deskoh Date: Thu, 10 Jan 2019 17:53:31 +0800 Subject: [PATCH] Updated argument of validator function to be optional. --- types/simpl-schema/index.d.ts | 3 ++- types/simpl-schema/simpl-schema-tests.ts | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/simpl-schema/index.d.ts b/types/simpl-schema/index.d.ts index b09a8fde96..c59833b12e 100644 --- a/types/simpl-schema/index.d.ts +++ b/types/simpl-schema/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/aldeed/simple-schema-js // Definitions by: Andreas Richter // Qkramer +// Deskoh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface ValidationContext extends SimpleSchemaValidationContextStatic { @@ -133,7 +134,7 @@ interface SimpleSchemaStatic { newContext(): ValidationContext; objectKeys(keyPrefix: any): any[]; validate(obj: any, options?: ValidationOption): void; - validator(options: ValidationOption): () => boolean; + validator(options?: ValidationOption): () => boolean; RegEx: { Email: RegExp; EmailWithTLD: RegExp; diff --git a/types/simpl-schema/simpl-schema-tests.ts b/types/simpl-schema/simpl-schema-tests.ts index a3555c4428..48f246261e 100644 --- a/types/simpl-schema/simpl-schema-tests.ts +++ b/types/simpl-schema/simpl-schema-tests.ts @@ -35,6 +35,12 @@ StringSchema.validate({ regExpString: "id" }, {keys: ['basicString']}); +StringSchema.validator(); + +StringSchema.validator({ + clean: true +}); + const StringSchemaWithOptions = new SimpleSchema({ basicString: { type: String