typescanner
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -14,1 +14,2 @@ import type { Condition } from "../types"; | ||
export declare const list: <T>(array: Exclude<T[], never[]>) => (value: unknown) => value is T; | ||
export declare const instanceOf: <T>(constructor: new (...args: any[]) => T) => (value: unknown) => value is T; |
@@ -12,3 +12,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.list = exports.optional = exports.array = exports.union = exports.date = exports.Null = exports.Undefined = exports.bigint = exports.symbol = exports.boolean = exports.number = exports.string = void 0; | ||
exports.instanceOf = exports.list = exports.optional = exports.array = exports.union = exports.date = exports.Null = exports.Undefined = exports.bigint = exports.symbol = exports.boolean = exports.number = exports.string = void 0; | ||
var typeGuard_1 = require("../typeGuard"); | ||
@@ -55,2 +55,6 @@ exports.string = typeGuard_1.isString; | ||
exports.list = list; | ||
var instanceOf = function (constructor) { | ||
return function (value) { return (0, typeGuard_1.isInstanceOf)(value, constructor); }; | ||
}; | ||
exports.instanceOf = instanceOf; | ||
//# sourceMappingURL=index.js.map |
export { scan } from "./scan"; | ||
export { scanner } from "./scanner"; | ||
export { array, bigint, boolean, date, list, Null, number, optional, string, symbol, Undefined, union, } from "./fields"; | ||
export { isArray, isBigint, isBoolean, isDate, isList, isNull, isNumber, isOptional, isString, isSymbol, isUndefined, } from "./typeGuard"; | ||
export { array, bigint, boolean, date, instanceOf, list, Null, number, optional, string, symbol, Undefined, union, } from "./fields"; | ||
export { isArray, isBigint, isBoolean, isDate, isInstanceOf, isList, isNull, isNumber, isObject, isOptional, isString, isSymbol, isUndefined, } from "./typeGuard"; |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.isUndefined = exports.isSymbol = exports.isString = exports.isOptional = exports.isNumber = exports.isNull = exports.isList = exports.isDate = exports.isBoolean = exports.isBigint = exports.isArray = exports.union = exports.Undefined = exports.symbol = exports.string = exports.optional = exports.number = exports.Null = exports.list = exports.date = exports.boolean = exports.bigint = exports.array = exports.scanner = exports.scan = void 0; | ||
exports.isUndefined = exports.isSymbol = exports.isString = exports.isOptional = exports.isObject = exports.isNumber = exports.isNull = exports.isList = exports.isInstanceOf = exports.isDate = exports.isBoolean = exports.isBigint = exports.isArray = exports.union = exports.Undefined = exports.symbol = exports.string = exports.optional = exports.number = exports.Null = exports.list = exports.instanceOf = exports.date = exports.boolean = exports.bigint = exports.array = exports.scanner = exports.scan = void 0; | ||
// scan | ||
@@ -24,2 +24,3 @@ var scan_1 = require("./scan"); | ||
__createBinding(exports, fields_1, "date"); | ||
__createBinding(exports, fields_1, "instanceOf"); | ||
__createBinding(exports, fields_1, "list"); | ||
@@ -39,5 +40,7 @@ __createBinding(exports, fields_1, "Null"); | ||
__createBinding(exports, typeGuard_1, "isDate"); | ||
__createBinding(exports, typeGuard_1, "isInstanceOf"); | ||
__createBinding(exports, typeGuard_1, "isList"); | ||
__createBinding(exports, typeGuard_1, "isNull"); | ||
__createBinding(exports, typeGuard_1, "isNumber"); | ||
__createBinding(exports, typeGuard_1, "isObject"); | ||
__createBinding(exports, typeGuard_1, "isOptional"); | ||
@@ -44,0 +47,0 @@ __createBinding(exports, typeGuard_1, "isString"); |
@@ -14,1 +14,2 @@ import type { WouldBe } from "../types"; | ||
export declare const isList: <T>(value: unknown, array: Exclude<T[], never[]>) => value is T; | ||
export declare const isInstanceOf: <T>(value: unknown, constructor: new (...args: any[]) => T) => value is T; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.isList = exports.isOptional = exports.isObject = exports.isArray = exports.isDate = exports.isNull = exports.isUndefined = exports.isBigint = exports.isSymbol = exports.isBoolean = exports.isNumber = exports.isString = void 0; | ||
exports.isInstanceOf = exports.isList = exports.isOptional = exports.isObject = exports.isArray = exports.isDate = exports.isNull = exports.isUndefined = exports.isBigint = exports.isSymbol = exports.isBoolean = exports.isNumber = exports.isString = void 0; | ||
var isString = function (value) { | ||
@@ -53,2 +53,4 @@ return typeof value === "string"; | ||
exports.isList = isList; | ||
var isInstanceOf = function (value, constructor) { return value instanceof constructor; }; | ||
exports.isInstanceOf = isInstanceOf; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "typescanner", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "A simple library for implementing type guards in TypeScript.", | ||
@@ -5,0 +5,0 @@ "author": "yona3", |
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
37686
811