From 73cbb770780005e11a3bbb71dd66ea76d1b7553e Mon Sep 17 00:00:00 2001 From: frantic1048 Date: Tue, 13 Mar 2018 15:30:21 +0800 Subject: [PATCH] yup: add definition for `.notRequired()` added in 0.24.1 --- types/yup/index.d.ts | 1 + types/yup/yup-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/yup/index.d.ts b/types/yup/index.d.ts index e6dc35c1ea..c8c3f2dda4 100644 --- a/types/yup/index.d.ts +++ b/types/yup/index.d.ts @@ -46,6 +46,7 @@ export interface Schema { 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; diff --git a/types/yup/yup-tests.ts b/types/yup/yup-tests.ts index 9dd02ced73..0c0aa04c47 100644 --- a/types/yup/yup-tests.ts +++ b/types/yup/yup-tests.ts @@ -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');