yup: add definition for .notRequired() added in 0.24.1

This commit is contained in:
frantic1048
2018-03-13 15:30:21 +08:00
parent 5dc41ce74c
commit 73cbb77078
2 changed files with 2 additions and 0 deletions

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;

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');