Merge pull request #24252 from frantic1048/master

yup: add definition for `.notRequired()` added in 0.24.1
This commit is contained in:
Mine Starks
2018-03-23 16:46:28 -07:00
committed by GitHub
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -46,6 +46,7 @@ export interface Schema<T> {
default(value?: any): this;
nullable(isNullable: boolean): this;
required(message?: string): this;
notRequired(): this;
typeError(message?: string): this;
oneOf(arrayOfValues: any[], message?: string): this;
notOneOf(arrayOfValues: any[], message?: string): this;
+1
View File
@@ -100,6 +100,7 @@ mixed.default(() => ({ number: 5}));
mixed.default();
mixed.nullable(true);
mixed.required();
mixed.notRequired(); // $ExpectType MixedSchema
mixed.typeError('type error');
mixed.oneOf(['hello', 'world'], 'message');
mixed.notOneOf(['hello', 'world'], 'message');