Comparing version 1.0.0 to 1.0.1
@@ -230,6 +230,6 @@ import { Get } from 'type-fest'; | ||
test(name: string, message: Message, test: TestFunction<this['__outputType'], TContext>): this; | ||
when<U extends ISchema<any> = this>(builder: ConditionBuilder<this, U>): U; | ||
when<U extends ISchema<any> = this>(keys: string | string[], builder: ConditionBuilder<this, U>): U; | ||
when<UThen extends ISchema<any> = this, UOtherwise extends ISchema<any> = this>(options: ConditionConfig<this, UThen, UOtherwise>): UThen | UOtherwise; | ||
when<UThen extends ISchema<any> = this, UOtherwise extends ISchema<any> = this>(keys: string | string[], options: ConditionConfig<this, UThen, UOtherwise>): UThen | UOtherwise; | ||
when(builder: ConditionBuilder<this>): this; | ||
when(keys: string | string[], builder: ConditionBuilder<this>): this; | ||
when(options: ConditionConfig<this>): this; | ||
when(keys: string | string[], options: ConditionConfig<this>): this; | ||
typeError(message: Message): this; | ||
@@ -294,7 +294,7 @@ oneOf<U extends TType>(enums: ReadonlyArray<U | Reference>, message?: Message<{ | ||
type ConditionBuilder<T extends ISchema<any, any>, U extends ISchema<any, any> = T> = (values: any[], schema: T, options: ResolveOptions) => U; | ||
type ConditionConfig<T extends ISchema<any>, TThen extends ISchema<any, any> = T, TOtherwise extends ISchema<any, any> = T> = { | ||
type ConditionBuilder<T extends ISchema<any, any>> = (values: any[], schema: T, options: ResolveOptions) => ISchema<any>; | ||
type ConditionConfig<T extends ISchema<any>> = { | ||
is: any | ((...values: any[]) => boolean); | ||
then?: (schema: T) => TThen; | ||
otherwise?: (schema: T) => TOtherwise; | ||
then?: (schema: T) => ISchema<any>; | ||
otherwise?: (schema: T) => ISchema<any>; | ||
}; | ||
@@ -546,2 +546,3 @@ type ResolveOptions<TContext = any> = { | ||
} | ||
declare const _default: LocaleObject; | ||
@@ -850,7 +851,7 @@ type MatchOptions = { | ||
declare function addMethod<T extends AnySchema>(schemaType: (...arg: any[]) => T, name: string, fn: (this: T, ...args: any[]) => T): void; | ||
declare function addMethod<T extends new (...args: any) => AnySchema>(schemaType: T, name: string, fn: (this: InstanceType<T>, ...args: any[]) => InstanceType<T>): void; | ||
declare function addMethod<T extends ISchema<any>>(schemaType: (...arg: any[]) => T, name: string, fn: (this: T, ...args: any[]) => T): void; | ||
declare function addMethod<T extends new (...args: any) => ISchema<any>>(schemaType: T, name: string, fn: (this: InstanceType<T>, ...args: any[]) => InstanceType<T>): void; | ||
type AnyObjectSchema = ObjectSchema<any, any, any, any>; | ||
type CastOptions = Omit<CastOptions$1, 'path' | 'resolved'>; | ||
export { AnyObject, AnyObjectSchema, AnySchema, ArraySchema, InferType as Asserts, BooleanSchema, CastOptions, CreateErrorOptions, DateSchema, DefaultFromShape, Defined, Flags, ISchema, InferType, LocaleObject, MakePartial, Maybe, Message, MixedOptions, MixedSchema, TypeGuard as MixedTypeGuard, NotNull, NumberSchema, ObjectSchema, ObjectShape, Optionals, Schema, SchemaDescription, SchemaFieldDescription, SchemaInnerTypeDescription, SchemaLazyDescription, SchemaObjectDescription, SchemaRefDescription, SetFlag, StringSchema, TestConfig, TestContext, TestFunction, TestOptions, Thunk, ToggleDefault, TupleSchema, TypeFromShape, UnsetFlag, ValidateOptions, ValidationError, addMethod, create$2 as array, create$7 as bool, create$7 as boolean, create$4 as date, getIn, isSchema, create as lazy, create$8 as mixed, create$5 as number, create$3 as object, reach, create$9 as ref, setLocale, create$6 as string, create$1 as tuple }; | ||
export { AnyObject, AnyObjectSchema, AnySchema, ArraySchema, InferType as Asserts, BooleanSchema, CastOptions, CreateErrorOptions, DateSchema, DefaultFromShape, Defined, Flags, ISchema, InferType, LocaleObject, MakePartial, Maybe, Message, MixedOptions, MixedSchema, TypeGuard as MixedTypeGuard, NotNull, NumberSchema, ObjectSchema, ObjectShape, Optionals, Schema, SchemaDescription, SchemaFieldDescription, SchemaInnerTypeDescription, SchemaLazyDescription, SchemaObjectDescription, SchemaRefDescription, SetFlag, StringSchema, TestConfig, TestContext, TestFunction, TestOptions, Thunk, ToggleDefault, TupleSchema, TypeFromShape, UnsetFlag, ValidateOptions, ValidationError, addMethod, create$2 as array, create$7 as bool, create$7 as boolean, create$4 as date, _default as defaultLocale, getIn, isSchema, create as lazy, create$8 as mixed, create$5 as number, create$3 as object, reach, create$9 as ref, setLocale, create$6 as string, create$1 as tuple }; |
{ | ||
"name": "yup", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Dead simple Object schema validation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1041,2 +1041,4 @@ # Yup | ||
`then` and `otherwise` are specified functions `(schema: Schema) => Schema`. | ||
```js | ||
@@ -1043,0 +1045,0 @@ let schema = object({ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
5226
1702
239573