From 21fa1faabf0a10cd61da32a2cf4aece9bd766ab6 Mon Sep 17 00:00:00 2001 From: Iago Melanias Date: Thu, 21 Feb 2019 20:57:13 -0300 Subject: [PATCH 1/2] nullable(): make argument isNullable optional Following the repository documentation, the argument isNullable is optional because it has the default value `true`. https://github.com/jquense/yup#mixednullableisnullable-boolean--true-schema --- types/yup/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index dc73ae6bd9..7e03517143 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -70,7 +70,7 @@ export interface Schema { 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; From b5e530db8f96b6fc6a0f6dec59fbc33329873770 Mon Sep 17 00:00:00 2001 From: Iago Melanias Date: Thu, 21 Feb 2019 21:03:02 -0300 Subject: [PATCH 2/2] nullable(): add test to ensure isNullable argument is optional --- types/yup/yup-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index c6717e95ad..fdead13b2b 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -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");