You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@vcsuite/check

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vcsuite/check - npm Package Compare versions

Comparing version

to
2.0.1

11

dist/index.d.ts

@@ -8,5 +8,8 @@ declare const matcherSymbol: unique symbol;

};
export type Pattern = typeof String | typeof Number | typeof Function | typeof Symbol | typeof Boolean | typeof Function | typeof Integer | typeof NonEmptyString | (new (...args: unknown[]) => unknown) | undefined | null | string | number | boolean | [
export type Pattern = typeof String | typeof Number | typeof Function | typeof Symbol | typeof Boolean | typeof Function | typeof Integer | typeof NonEmptyString | (new (...args: any[]) => any) | // use of any is justified and required to pass constructors
undefined | null | string | number | boolean | symbol | [
Pattern
] | Record<string, Pattern> | Matcher<unknown>;
] | {
[k: string | symbol]: Pattern;
} | Matcher<any>;
export type PatternMatch<T extends Pattern> = T extends Matcher<infer U> ? U : T extends typeof String ? string : T extends typeof Number ? number : T extends typeof Boolean ? boolean : T extends typeof Object ? object : T extends typeof Function ? Function : T extends undefined | null | string | number | boolean ? T : T extends new (...args: unknown[]) => infer U ? U : T extends [Pattern] ? PatternMatch<T[0]>[] : T extends {

@@ -27,3 +30,5 @@ [key: string]: Pattern;

export declare function inRange<T extends typeof Number | typeof Integer = typeof Number>(lowerLimit: number, upperLimit: number, type?: T): Matcher<PatternMatch<T>>;
export declare function ofEnum<T extends string | number | symbol>(enumObject: Record<string, T>): Matcher<T>;
export declare function ofEnum<T extends string | number | symbol>(enumObject: {
[key: string]: T;
}): Matcher<T>;
export {};

@@ -212,2 +212,5 @@ const matcherSymbol = Symbol('isMatcher');

}
if (testPattern === Object) {
return object(testValue, {}, test);
}
if (testPattern instanceof Function) { // assumes constructor

@@ -219,5 +222,2 @@ if (testValue instanceof testPattern) {

}
if (testPattern === Object) {
return object(testValue, {}, test);
}
if (typeof testPattern === 'object') {

@@ -224,0 +224,0 @@ const objError = object(testValue, testPattern, test);

{
"name": "@vcsuite/check",
"version": "2.0.0",
"version": "2.0.1",
"description": "check utilities for input type safety",

@@ -5,0 +5,0 @@ "main": "dist/index.js",