Socket
Socket
Sign inDemoInstall

@types/yup

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/yup - npm Package Compare versions

Comparing version 0.26.2 to 0.26.3

59

yup/index.d.ts

@@ -8,2 +8,3 @@ // Type definitions for yup 0.26

// Yash Kulshrestha <https://github.com/YashdalfTheGray>
// Vincent Pizzo <https://github.com/vincentjames501>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

@@ -51,2 +52,5 @@ // TypeScript Version: 2.2

export type TestOptionsMessage = string
| ((params: object & Partial<TestMessageParams>) => string);
export interface Schema<T> {

@@ -72,7 +76,7 @@ clone(): this;

nullable(isNullable: boolean): this;
required(message?: string): this;
required(message?: TestOptionsMessage): this;
notRequired(): this;
typeError(message?: string): this;
oneOf(arrayOfValues: any[], message?: string): this;
notOneOf(arrayOfValues: any[], message?: string): this;
typeError(message?: TestOptionsMessage): this;
oneOf(arrayOfValues: any[], message?: TestOptionsMessage): this;
notOneOf(arrayOfValues: any[], message?: TestOptionsMessage): this;
when(keys: string | any[], builder: WhenOptions<this>): this;

@@ -108,16 +112,16 @@ test(

export interface StringSchema extends Schema<string> {
min(limit: number | Ref, message?: string): StringSchema;
max(limit: number | Ref, message?: string): StringSchema;
min(limit: number | Ref, message?: TestOptionsMessage): StringSchema;
max(limit: number | Ref, message?: TestOptionsMessage): StringSchema;
matches(
regex: RegExp,
messageOrOptions?:
| string
| { message?: string; excludeEmptyString?: boolean }
| TestOptionsMessage
| { message?: TestOptionsMessage; excludeEmptyString?: boolean }
): StringSchema;
email(message?: string): StringSchema;
url(message?: string): StringSchema;
email(message?: TestOptionsMessage): StringSchema;
url(message?: TestOptionsMessage): StringSchema;
ensure(): StringSchema;
trim(message?: string): StringSchema;
lowercase(message?: string): StringSchema;
uppercase(message?: string): StringSchema;
trim(message?: TestOptionsMessage): StringSchema;
lowercase(message?: TestOptionsMessage): StringSchema;
uppercase(message?: TestOptionsMessage): StringSchema;
}

@@ -131,9 +135,9 @@

export interface NumberSchema extends Schema<number> {
min(limit: number | Ref, message?: string): NumberSchema;
max(limit: number | Ref, message?: string): NumberSchema;
lessThan(limit: number | Ref, message?: string): NumberSchema;
moreThan(limit: number | Ref, message?: string): NumberSchema;
positive(message?: string): NumberSchema;
negative(message?: string): NumberSchema;
integer(message?: string): NumberSchema;
min(limit: number | Ref, message?: TestOptionsMessage): NumberSchema;
max(limit: number | Ref, message?: TestOptionsMessage): NumberSchema;
lessThan(limit: number | Ref, message?: TestOptionsMessage): NumberSchema;
moreThan(limit: number | Ref, message?: TestOptionsMessage): NumberSchema;
positive(message?: TestOptionsMessage): NumberSchema;
negative(message?: TestOptionsMessage): NumberSchema;
integer(message?: TestOptionsMessage): NumberSchema;
truncate(): NumberSchema;

@@ -157,4 +161,4 @@ round(type: "floor" | "ceil" | "trunc" | "round"): NumberSchema;

export interface DateSchema extends Schema<Date> {
min(limit: Date | string | Ref, message?: string): DateSchema;
max(limit: Date | string | Ref, message?: string): DateSchema;
min(limit: Date | string | Ref, message?: TestOptionsMessage): DateSchema;
max(limit: Date | string | Ref, message?: TestOptionsMessage): DateSchema;
}

@@ -169,4 +173,4 @@

of<U>(type: Schema<U>): ArraySchema<U>;
min(limit: number | Ref, message?: string): ArraySchema<T>;
max(limit: number | Ref, message?: string): ArraySchema<T>;
min(limit: number | Ref, message?: TestOptionsMessage): ArraySchema<T>;
max(limit: number | Ref, message?: TestOptionsMessage): ArraySchema<T>;
ensure(): ArraySchema<T>;

@@ -187,3 +191,3 @@ compact(rejector?: (value: any) => boolean): ArraySchema<T>;

from(fromKey: string, toKey: string, alias?: boolean): ObjectSchema<T>;
noUnknown(onlyKnownKeys?: boolean, message?: string): ObjectSchema<T>;
noUnknown(onlyKnownKeys?: boolean, message?: TestOptionsMessage): ObjectSchema<T>;
transformKeys(callback: (key: any) => any): void;

@@ -217,2 +221,3 @@ camelCase(): ObjectSchema<T>;

schema: Schema<any>;
resolve: (value: any) => any;
createError: (params: { path: string; message: string }) => ValidationError;

@@ -268,5 +273,3 @@ }

*/
message?:
| string
| ((params: object & Partial<TestMessageParams>) => string);
message?: TestOptionsMessage;

@@ -273,0 +276,0 @@ /**

{
"name": "@types/yup",
"version": "0.26.2",
"version": "0.26.3",
"description": "TypeScript definitions for yup",

@@ -31,2 +31,7 @@ "license": "MIT",

"githubUsername": "YashdalfTheGray"
},
{
"name": "Vincent Pizzo",
"url": "https://github.com/vincentjames501",
"githubUsername": "vincentjames501"
}

@@ -42,4 +47,4 @@ ],

"dependencies": {},
"typesPublisherContentHash": "cad64d474e9f16777ce69e0d6366f5bbe441483ecad550f5d59cfbccdb870845",
"typesPublisherContentHash": "1bdd3502b1954da185fe21247b1f5fe0dd1a97efbc58ad26d861f4e9fb9fadf8",
"typeScriptVersion": "2.2"
}

@@ -11,3 +11,3 @@ # Installation

Additional Details
* Last updated: Thu, 15 Nov 2018 02:07:01 GMT
* Last updated: Tue, 04 Dec 2018 21:42:10 GMT
* Dependencies: none

@@ -17,2 +17,2 @@ * Global values: none

# Credits
These definitions were written by Dominik Hardtke <https://github.com/dhardtke>, Vladyslav Tserman <https://github.com/vtserman>, Moreton Bay Regional Council <https://github.com/MoretonBayRC>, Sindre Seppola <https://github.com/sseppola>, Yash Kulshrestha <https://github.com/YashdalfTheGray>.
These definitions were written by Dominik Hardtke <https://github.com/dhardtke>, Vladyslav Tserman <https://github.com/vtserman>, Moreton Bay Regional Council <https://github.com/MoretonBayRC>, Sindre Seppola <https://github.com/sseppola>, Yash Kulshrestha <https://github.com/YashdalfTheGray>, Vincent Pizzo <https://github.com/vincentjames501>.
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