Merge pull request #33292 from iagomelanias/master

[yup] nullable(): make argument isNullable optional
This commit is contained in:
Jesse Trinity
2019-02-26 15:10:05 -08:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ export interface Schema<T> {
withMutation(fn: (current: this) => void): void;
default(value: any): this;
default(): T;
nullable(isNullable: boolean): this;
nullable(isNullable?: boolean): this;
required(message?: TestOptionsMessage): this;
notRequired(): this;
typeError(message?: TestOptionsMessage): this;

View File

@@ -148,6 +148,7 @@ mixed.default({ number: 5 });
mixed.default(() => ({ number: 5 }));
mixed.default();
mixed.nullable(true);
mixed.nullable();
mixed.required();
mixed.required("Foo");
mixed.required(() => "Foo");