@types/yup
Advanced tools
Comparing version 0.29.4 to 0.29.5
@@ -150,4 +150,8 @@ // Type definitions for yup 0.29 | ||
): StringSchema<MaintainOptionality<T, U>>; | ||
/* | ||
All TestFunction generics are intentionally T with (undefined | null) as previous .required / .defined / .nullable | ||
will narrow out those types, and tests run for (undefined | null) even if they're not allowed. | ||
*/ | ||
test(name: string, message: TestOptionsMessage, test: TestFunction<T | undefined | null>): this; | ||
test<U extends T = T>(name: string, message: TestOptionsMessage, test: AssertingTestFunction<U>): StringSchema<U>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction): this; | ||
test<U extends T = T>(options: AssertingTestOptions<U, Record<string, any>>): StringSchema<U>; | ||
@@ -187,4 +191,4 @@ test(options: TestOptions<Record<string, any>>): this; | ||
): NumberSchema<MaintainOptionality<T, U>>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction<T | undefined | null>): this; | ||
test<U extends T = T>(name: string, message: TestOptionsMessage, test: AssertingTestFunction<U>): NumberSchema<U>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction): this; | ||
test<U extends T = T>(options: AssertingTestOptions<U, Record<string, any>>): NumberSchema<U>; | ||
@@ -215,4 +219,4 @@ test(options: TestOptions<Record<string, any>>): this; | ||
): BooleanSchema<MaintainOptionality<T, U>>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction<T | undefined | null>): this; | ||
test<U extends T = T>(name: string, message: TestOptionsMessage, test: AssertingTestFunction<U>): BooleanSchema<U>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction): this; | ||
test<U extends T = T>(options: AssertingTestOptions<U, Record<string, any>>): BooleanSchema<U>; | ||
@@ -245,4 +249,4 @@ test(options: TestOptions<Record<string, any>>): this; | ||
): DateSchema<MaintainOptionality<T, U>>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction<T | undefined | null>): this; | ||
test<U extends T = T>(name: string, message: TestOptionsMessage, test: AssertingTestFunction<U>): DateSchema<U>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction): this; | ||
test<U extends T = T>(options: AssertingTestOptions<U, Record<string, any>>): DateSchema<U>; | ||
@@ -272,3 +276,3 @@ test(options: TestOptions<Record<string, any>>): this; | ||
equals(arrayOfValues: ReadonlyArray<T | Ref | null>, message?: MixedLocale['oneOf']): this; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction): this; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction<T | undefined | null>): this; | ||
test(options: TestOptions<Record<string, any>>): this; | ||
@@ -369,4 +373,4 @@ innerType: Schema<E>; | ||
equals<U extends T>(arrayOfValues: ReadonlyArray<U | Ref>, message?: MixedLocale['oneOf']): ObjectSchema<U>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction<T | undefined | null>): this; | ||
test<U extends T = T>(name: string, message: TestOptionsMessage, test: AssertingTestFunction<U>): ObjectSchema<U>; | ||
test(name: string, message: TestOptionsMessage, test: TestFunction): this; | ||
test<U extends T = T>(options: AssertingTestOptions<U, Record<string, any>>): ObjectSchema<U>; | ||
@@ -376,5 +380,5 @@ test(options: TestOptions<Record<string, any>>): this; | ||
export type TestFunction = ( | ||
export type TestFunction<T = unknown> = ( | ||
this: TestContext, | ||
value: any, | ||
value: T, | ||
) => boolean | ValidationError | Promise<boolean | ValidationError>; | ||
@@ -381,0 +385,0 @@ export type AssertingTestFunction<T> = (this: TestContext, value: any) => value is T; |
{ | ||
"name": "@types/yup", | ||
"version": "0.29.4", | ||
"version": "0.29.5", | ||
"description": "TypeScript definitions for yup", | ||
@@ -87,4 +87,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "ad3bea4bf6afb510526ae4619fe8b2f17d1abbcb53034d9fd41297ff24a3c643", | ||
"typesPublisherContentHash": "2a3a837a802caf9587eea33a00fcac00093c69b2979b33a3c3b9eac624b06e48", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Mon, 03 Aug 2020 15:34:35 GMT | ||
* Last updated: Fri, 14 Aug 2020 17:06:37 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32520
586