superstruct
Advanced tools
Comparing version 0.13.0 to 0.13.1
@@ -291,23 +291,23 @@ /** | ||
*/ | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>>(struct: Struct<T>): Struct<T>; | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is below a threshold. | ||
*/ | ||
declare function max<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function max<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is above a threshold. | ||
*/ | ||
declare function min<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function min<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a string matches a regular expression. | ||
*/ | ||
declare function pattern<T extends string>(struct: Struct<T>, regexp: RegExp): Struct<T>; | ||
declare function pattern<T extends string, S extends any>(struct: Struct<T, S>, regexp: RegExp): Struct<T, S>; | ||
/** | ||
* Ensure that a string, array, number, date, map, or set has a size (or length, or time) between `min` and `max`. | ||
*/ | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>>(struct: Struct<T>, min: number, max?: number): Struct<T>; | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>, min: number, max?: number): Struct<T, S>; | ||
/** | ||
@@ -314,0 +314,0 @@ * Augment a `Struct` to add an additional refinement to the validation. |
@@ -291,23 +291,23 @@ /** | ||
*/ | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>>(struct: Struct<T>): Struct<T>; | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is below a threshold. | ||
*/ | ||
declare function max<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function max<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is above a threshold. | ||
*/ | ||
declare function min<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function min<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a string matches a regular expression. | ||
*/ | ||
declare function pattern<T extends string>(struct: Struct<T>, regexp: RegExp): Struct<T>; | ||
declare function pattern<T extends string, S extends any>(struct: Struct<T, S>, regexp: RegExp): Struct<T, S>; | ||
/** | ||
* Ensure that a string, array, number, date, map, or set has a size (or length, or time) between `min` and `max`. | ||
*/ | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>>(struct: Struct<T>, min: number, max?: number): Struct<T>; | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>, min: number, max?: number): Struct<T, S>; | ||
/** | ||
@@ -314,0 +314,0 @@ * Augment a `Struct` to add an additional refinement to the validation. |
@@ -5,23 +5,23 @@ import { Struct, Refiner } from '../struct'; | ||
*/ | ||
export declare function empty<T extends string | any[] | Map<any, any> | Set<any>>(struct: Struct<T>): Struct<T>; | ||
export declare function empty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is below a threshold. | ||
*/ | ||
export declare function max<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
export declare function max<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is above a threshold. | ||
*/ | ||
export declare function min<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
export declare function min<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a string matches a regular expression. | ||
*/ | ||
export declare function pattern<T extends string>(struct: Struct<T>, regexp: RegExp): Struct<T>; | ||
export declare function pattern<T extends string, S extends any>(struct: Struct<T, S>, regexp: RegExp): Struct<T, S>; | ||
/** | ||
* Ensure that a string, array, number, date, map, or set has a size (or length, or time) between `min` and `max`. | ||
*/ | ||
export declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>>(struct: Struct<T>, min: number, max?: number): Struct<T>; | ||
export declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>, min: number, max?: number): Struct<T, S>; | ||
/** | ||
@@ -28,0 +28,0 @@ * Augment a `Struct` to add an additional refinement to the validation. |
@@ -5,3 +5,3 @@ { | ||
"description": "A simple and composable way to validate data in JavaScript (and TypeScript).", | ||
"version": "0.13.0", | ||
"version": "0.13.1", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "repository": "git://github.com/ianstormtaylor/superstruct.git", |
@@ -291,23 +291,23 @@ /** | ||
*/ | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>>(struct: Struct<T>): Struct<T>; | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is below a threshold. | ||
*/ | ||
declare function max<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function max<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is above a threshold. | ||
*/ | ||
declare function min<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function min<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a string matches a regular expression. | ||
*/ | ||
declare function pattern<T extends string>(struct: Struct<T>, regexp: RegExp): Struct<T>; | ||
declare function pattern<T extends string, S extends any>(struct: Struct<T, S>, regexp: RegExp): Struct<T, S>; | ||
/** | ||
* Ensure that a string, array, number, date, map, or set has a size (or length, or time) between `min` and `max`. | ||
*/ | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>>(struct: Struct<T>, min: number, max?: number): Struct<T>; | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>, min: number, max?: number): Struct<T, S>; | ||
/** | ||
@@ -314,0 +314,0 @@ * Augment a `Struct` to add an additional refinement to the validation. |
@@ -291,23 +291,23 @@ /** | ||
*/ | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>>(struct: Struct<T>): Struct<T>; | ||
declare function empty<T extends string | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is below a threshold. | ||
*/ | ||
declare function max<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function max<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a number or date is above a threshold. | ||
*/ | ||
declare function min<T extends number | Date>(struct: Struct<T>, threshold: T, options?: { | ||
declare function min<T extends number | Date, S extends any>(struct: Struct<T, S>, threshold: T, options?: { | ||
exclusive?: boolean; | ||
}): Struct<T>; | ||
}): Struct<T, S>; | ||
/** | ||
* Ensure that a string matches a regular expression. | ||
*/ | ||
declare function pattern<T extends string>(struct: Struct<T>, regexp: RegExp): Struct<T>; | ||
declare function pattern<T extends string, S extends any>(struct: Struct<T, S>, regexp: RegExp): Struct<T, S>; | ||
/** | ||
* Ensure that a string, array, number, date, map, or set has a size (or length, or time) between `min` and `max`. | ||
*/ | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>>(struct: Struct<T>, min: number, max?: number): Struct<T>; | ||
declare function size<T extends string | number | Date | any[] | Map<any, any> | Set<any>, S extends any>(struct: Struct<T, S>, min: number, max?: number): Struct<T, S>; | ||
/** | ||
@@ -314,0 +314,0 @@ * Augment a `Struct` to add an additional refinement to the validation. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
505797