Socket
Socket
Sign inDemoInstall

superstruct

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superstruct - npm Package Compare versions

Comparing version 0.13.0 to 0.13.1

14

lib/index.cjs.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc