Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ts-runtime-typecheck

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-runtime-typecheck - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

cjs/type-cast/as-instance.js

2

cjs/index.d.ts

@@ -6,2 +6,3 @@ export * from './type-cast/as-json';

export * from './type-cast/as-recursive';
export * from './type-cast/as-instance';
export * from './type-check/is-json';

@@ -12,2 +13,3 @@ export * from './type-check/is-primitive';

export * from './type-check/is-recursive';
export * from './type-check/is-instance';
export * from './type-coerce/make-primative';

@@ -14,0 +16,0 @@ export * from './type-coerce/make-strict-partial';

86

cjs/index.js

@@ -5,44 +5,21 @@ 'use strict';

var isPrimitive = require('./type-check/is-primitive.js');
var isJson = require('./type-check/is-json.js');
var asJson = require('./type-cast/as-json.js');
var asPrimitive = require('./type-cast/as-primitive.js');
var asStruct = require('./type-cast/as-struct.js');
var asUnion = require('./type-cast/as-union.js');
var asRecursive = require('./type-cast/as-recursive.js');
var asInstance = require('./type-cast/as-instance.js');
var isJson = require('./type-check/is-json.js');
var isPrimitive = require('./type-check/is-primitive.js');
var isStruct = require('./type-check/is-struct.js');
var asStruct = require('./type-cast/as-struct.js');
var isUnion = require('./type-check/is-union.js');
var asUnion = require('./type-cast/as-union.js');
var isRecursive = require('./type-check/is-recursive.js');
var asRecursive = require('./type-cast/as-recursive.js');
var isInstance = require('./type-check/is-instance.js');
var makePrimative = require('./type-coerce/make-primative.js');
var makeStrictPartial = require('./type-coerce/make-strict-partial.js');
var assertDefined = require('./type-assert/assert-defined.js');
var TypeAssertion = require('./TypeAssertion.js');
var assertDefined = require('./type-assert/assert-defined.js');
exports.isArray = isPrimitive.isArray;
exports.isBoolean = isPrimitive.isBoolean;
exports.isDefined = isPrimitive.isDefined;
exports.isDictionary = isPrimitive.isDictionary;
exports.isFunction = isPrimitive.isFunction;
exports.isIndex = isPrimitive.isIndex;
exports.isIndexable = isPrimitive.isIndexable;
exports.isNullish = isPrimitive.isNullish;
exports.isNumber = isPrimitive.isNumber;
exports.isOptArray = isPrimitive.isOptArray;
exports.isOptBoolean = isPrimitive.isOptBoolean;
exports.isOptDictionary = isPrimitive.isOptDictionary;
exports.isOptFunction = isPrimitive.isOptFunction;
exports.isOptIndex = isPrimitive.isOptIndex;
exports.isOptIndexable = isPrimitive.isOptIndexable;
exports.isOptNumber = isPrimitive.isOptNumber;
exports.isOptString = isPrimitive.isOptString;
exports.isString = isPrimitive.isString;
exports.isUndefined = isPrimitive.isUndefined;
exports.isJSONArray = isJson.isJSONArray;
exports.isJSONObject = isJson.isJSONObject;
exports.isJSONValue = isJson.isJSONValue;
exports.isOptJSONArray = isJson.isOptJSONArray;
exports.isOptJSONObject = isJson.isOptJSONObject;
exports.isOptJSONValue = isJson.isOptJSONValue;
exports.asJSONArray = asJson.asJSONArray;

@@ -71,10 +48,41 @@ exports.asJSONObject = asJson.asJSONObject;

exports.asString = asPrimitive.asString;
exports.asOptStruct = asStruct.asOptStruct;
exports.asStruct = asStruct.asStruct;
exports.asOptUnion = asUnion.asOptUnion;
exports.asUnion = asUnion.asUnion;
exports.asArrayOf = asRecursive.asArrayOf;
exports.asDictionaryOf = asRecursive.asDictionaryOf;
exports.asOptArrayOf = asRecursive.asOptArrayOf;
exports.asOptDictionaryOf = asRecursive.asOptDictionaryOf;
exports.asInstance = asInstance.asInstance;
exports.asOptInstance = asInstance.asOptInstance;
exports.isJSONArray = isJson.isJSONArray;
exports.isJSONObject = isJson.isJSONObject;
exports.isJSONValue = isJson.isJSONValue;
exports.isOptJSONArray = isJson.isOptJSONArray;
exports.isOptJSONObject = isJson.isOptJSONObject;
exports.isOptJSONValue = isJson.isOptJSONValue;
exports.isArray = isPrimitive.isArray;
exports.isBoolean = isPrimitive.isBoolean;
exports.isDefined = isPrimitive.isDefined;
exports.isDictionary = isPrimitive.isDictionary;
exports.isFunction = isPrimitive.isFunction;
exports.isIndex = isPrimitive.isIndex;
exports.isIndexable = isPrimitive.isIndexable;
exports.isNullish = isPrimitive.isNullish;
exports.isNumber = isPrimitive.isNumber;
exports.isOptArray = isPrimitive.isOptArray;
exports.isOptBoolean = isPrimitive.isOptBoolean;
exports.isOptDictionary = isPrimitive.isOptDictionary;
exports.isOptFunction = isPrimitive.isOptFunction;
exports.isOptIndex = isPrimitive.isOptIndex;
exports.isOptIndexable = isPrimitive.isOptIndexable;
exports.isOptNumber = isPrimitive.isOptNumber;
exports.isOptString = isPrimitive.isOptString;
exports.isString = isPrimitive.isString;
exports.isUndefined = isPrimitive.isUndefined;
exports.isOptStruct = isStruct.isOptStruct;
exports.isStruct = isStruct.isStruct;
exports.asOptStruct = asStruct.asOptStruct;
exports.asStruct = asStruct.asStruct;
exports.isOptUnion = isUnion.isOptUnion;
exports.isUnion = isUnion.isUnion;
exports.asOptUnion = asUnion.asOptUnion;
exports.asUnion = asUnion.asUnion;
exports.isArrayOf = isRecursive.isArrayOf;

@@ -84,6 +92,4 @@ exports.isDictionaryOf = isRecursive.isDictionaryOf;

exports.isOptDictionaryOf = isRecursive.isOptDictionaryOf;
exports.asArrayOf = asRecursive.asArrayOf;
exports.asDictionaryOf = asRecursive.asDictionaryOf;
exports.asOptArrayOf = asRecursive.asOptArrayOf;
exports.asOptDictionaryOf = asRecursive.asOptDictionaryOf;
exports.isInstance = isInstance.isInstance;
exports.isOptInstance = isInstance.isOptInstance;
exports.makeBoolean = makePrimative.makeBoolean;

@@ -93,3 +99,3 @@ exports.makeNumber = makePrimative.makeNumber;

exports.makeStrictPartial = makeStrictPartial.makeStrictPartial;
exports.assertDefined = assertDefined.assertDefined;
exports.TypeAssertion = TypeAssertion.TypeAssertion;
exports.assertDefined = assertDefined.assertDefined;
import type { JSONValue, JSONArray, JSONObject } from '../JSONValue.type';
import type { OptionalTypeCast, TypeCast } from '../TypeCast.type';
export declare const asJSONValue: (obj: unknown, fallback?: import("..").Optional<string | number | boolean | JSONObject | JSONArray>) => JSONValue;
export declare const asJSONValue: (obj: unknown, fallback?: JSONValue | undefined) => JSONValue;
export declare const asJSONArray: TypeCast<JSONArray, JSONValue>;

@@ -5,0 +5,0 @@ export declare const asJSONObject: TypeCast<JSONObject, JSONValue>;

import type { Optional } from '../Optional.type';
export declare const asString: (obj: unknown, fallback?: string | undefined) => string;
export declare const asNumber: (obj: unknown, fallback?: number | undefined) => number;
export declare const asIndex: (obj: unknown, fallback?: string | number | undefined) => import("..").Index;
export declare const asIndexable: (obj: unknown, fallback?: Record<import("..").Index, unknown> | undefined) => Record<import("..").Index, unknown>;
export declare const asIndex: (obj: unknown, fallback?: import("..").Index | undefined) => import("..").Index;
export declare const asIndexable: (obj: unknown, fallback?: import("..").Indexable | undefined) => import("..").Indexable;
export declare const asBoolean: (obj: unknown, fallback?: boolean | undefined) => boolean;
export declare const asArray: (obj: unknown, fallback?: unknown[] | undefined) => unknown[];
export declare const asDictionary: (obj: unknown, fallback?: Record<string, unknown> | undefined) => Record<string, unknown>;
export declare const asDictionary: (obj: unknown, fallback?: import("..").Dictionary<unknown> | undefined) => import("..").Dictionary<unknown>;
export declare const asFunction: (obj: unknown, fallback?: import("..").UnknownFunction<unknown> | undefined) => import("..").UnknownFunction<unknown>;

@@ -14,6 +14,6 @@ export declare function asDefined<T>(obj: Optional<T>, fallback?: NonNullable<T>): NonNullable<T>;

export declare const asOptIndex: import("../TypeCast.type").OptionalTypeCast<import("..").Index, unknown>;
export declare const asOptIndexable: import("../TypeCast.type").OptionalTypeCast<Record<import("..").Index, unknown>, unknown>;
export declare const asOptIndexable: import("../TypeCast.type").OptionalTypeCast<import("..").Indexable, unknown>;
export declare const asOptBoolean: import("../TypeCast.type").OptionalTypeCast<boolean, unknown>;
export declare const asOptArray: import("../TypeCast.type").OptionalTypeCast<unknown[], unknown>;
export declare const asOptDictionary: import("../TypeCast.type").OptionalTypeCast<Record<string, unknown>, unknown>;
export declare const asOptDictionary: import("../TypeCast.type").OptionalTypeCast<import("..").Dictionary<unknown>, unknown>;
export declare const asOptFunction: import("../TypeCast.type").OptionalTypeCast<import("..").UnknownFunction<unknown>, unknown>;
import type { OptionalTypeCast, TypeCast } from '../TypeCast.type';
import type { Dictionary } from '../Dictionary.type';
import type { TypeCheck } from '../TypeCheck.type';
export declare const asArrayOf: <T>(par: TypeCheck<T>) => TypeCast<T[], unknown>;
export declare const asDictionaryOf: <T>(par: TypeCheck<T>) => TypeCast<Record<string, T>, unknown>;
export declare const asDictionaryOf: <T>(par: TypeCheck<T>) => TypeCast<Dictionary<T>, unknown>;
export declare const asOptArrayOf: <T>(par: TypeCheck<T>) => OptionalTypeCast<T[], unknown>;
export declare const asOptDictionaryOf: <T>(par: TypeCheck<T>) => OptionalTypeCast<Record<string, T>, unknown>;
export declare const asOptDictionaryOf: <T>(par: TypeCheck<T>) => OptionalTypeCast<Dictionary<T>, unknown>;

@@ -5,5 +5,5 @@ 'use strict';

var typeCast = require('./type-cast.js');
var memoize = require('../memoize.js');
var isRecursive = require('../type-check/is-recursive.js');
var typeCast = require('./type-cast.js');

@@ -10,0 +10,0 @@ var asArrayOf = memoize.memoize(function (visitor) {

@@ -1,2 +0,3 @@

export declare const asStruct: <Pattern extends Record<string, import("..").TypeCheck<unknown>>>(par: Pattern) => (obj: unknown, fallback?: { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; } | undefined) => { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; };
export declare const asOptStruct: <Pattern extends Record<string, import("..").TypeCheck<unknown>>>(par: Pattern) => import("../TypeCast.type").OptionalTypeCast<{ [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; }, unknown>;
import type { InterfacePattern } from '../InterfacePattern.type';
export declare const asStruct: <Pattern extends InterfacePattern>(par: Pattern) => (obj: unknown, fallback?: { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; } | undefined) => { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; };
export declare const asOptStruct: <Pattern extends InterfacePattern>(par: Pattern) => import("../TypeCast.type").OptionalTypeCast<{ [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; }, unknown>;

@@ -5,5 +5,5 @@ 'use strict';

var typeCast = require('./type-cast.js');
var memoize = require('../memoize.js');
var isStruct = require('../type-check/is-struct.js');
var typeCast = require('./type-cast.js');

@@ -10,0 +10,0 @@ var asStruct = memoize.memoize(function (pattern) {

@@ -5,4 +5,4 @@ 'use strict';

var isUnion = require('../type-check/is-union.js');
var typeCast = require('./type-cast.js');
var isUnion = require('../type-check/is-union.js');

@@ -9,0 +9,0 @@ var asUnion = function () {

import type { Optional } from '../Optional.type';
import type { TypeCheck } from '../TypeCheck.type';
export declare const isDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Record<string, T>>;
export declare const isOptDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Optional<Record<string, T>>>;
import type { Dictionary } from '../Dictionary.type';
export declare const isDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Dictionary<T>>;
export declare const isOptDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Optional<Dictionary<T>>>;
export declare const isArrayOf: <T>(par: TypeCheck<T>) => TypeCheck<T[]>;
export declare const isOptArrayOf: <T>(par: TypeCheck<T>) => TypeCheck<Optional<T[]>>;

@@ -5,4 +5,4 @@ 'use strict';

var memoize = require('../memoize.js');
var isPrimitive = require('./is-primitive.js');
var memoize = require('../memoize.js');

@@ -9,0 +9,0 @@ var isDictionaryOf = memoize.memoize(function (isType) {

@@ -0,8 +1,9 @@

import type { InterfacePattern } from '../InterfacePattern.type';
import type { TypeCheck, UnwrapTypeCheck } from '../TypeCheck.type';
import type { Optional } from '../Optional.type';
export declare const isStruct: <Pattern extends Record<string, TypeCheck<unknown>>>(par: Pattern) => TypeCheck<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }> & {
export declare const isStruct: <Pattern extends InterfacePattern>(par: Pattern) => TypeCheck<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }> & {
TYPE_NAME: string;
};
export declare const isOptStruct: <Pattern extends Record<string, TypeCheck<unknown>>>(par: Pattern) => TypeCheck<Optional<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }>> & {
export declare const isOptStruct: <Pattern extends InterfacePattern>(par: Pattern) => TypeCheck<Optional<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }>> & {
TYPE_NAME: string;
};

@@ -5,4 +5,4 @@ 'use strict';

var memoize = require('../memoize.js');
var isPrimitive = require('./is-primitive.js');
var memoize = require('../memoize.js');

@@ -9,0 +9,0 @@ function structLabel(pattern) {

@@ -6,2 +6,3 @@ export * from './type-cast/as-json';

export * from './type-cast/as-recursive';
export * from './type-cast/as-instance';
export * from './type-check/is-json';

@@ -12,2 +13,3 @@ export * from './type-check/is-primitive';

export * from './type-check/is-recursive';
export * from './type-check/is-instance';
export * from './type-coerce/make-primative';

@@ -14,0 +16,0 @@ export * from './type-coerce/make-strict-partial';

import type { JSONValue, JSONArray, JSONObject } from '../JSONValue.type';
import type { OptionalTypeCast, TypeCast } from '../TypeCast.type';
export declare const asJSONValue: (obj: unknown, fallback?: import("..").Optional<string | number | boolean | JSONObject | JSONArray>) => JSONValue;
export declare const asJSONValue: (obj: unknown, fallback?: JSONValue | undefined) => JSONValue;
export declare const asJSONArray: TypeCast<JSONArray, JSONValue>;

@@ -5,0 +5,0 @@ export declare const asJSONObject: TypeCast<JSONObject, JSONValue>;

import type { Optional } from '../Optional.type';
export declare const asString: (obj: unknown, fallback?: string | undefined) => string;
export declare const asNumber: (obj: unknown, fallback?: number | undefined) => number;
export declare const asIndex: (obj: unknown, fallback?: string | number | undefined) => import("..").Index;
export declare const asIndexable: (obj: unknown, fallback?: Record<import("..").Index, unknown> | undefined) => Record<import("..").Index, unknown>;
export declare const asIndex: (obj: unknown, fallback?: import("..").Index | undefined) => import("..").Index;
export declare const asIndexable: (obj: unknown, fallback?: import("..").Indexable | undefined) => import("..").Indexable;
export declare const asBoolean: (obj: unknown, fallback?: boolean | undefined) => boolean;
export declare const asArray: (obj: unknown, fallback?: unknown[] | undefined) => unknown[];
export declare const asDictionary: (obj: unknown, fallback?: Record<string, unknown> | undefined) => Record<string, unknown>;
export declare const asDictionary: (obj: unknown, fallback?: import("..").Dictionary<unknown> | undefined) => import("..").Dictionary<unknown>;
export declare const asFunction: (obj: unknown, fallback?: import("..").UnknownFunction<unknown> | undefined) => import("..").UnknownFunction<unknown>;

@@ -14,6 +14,6 @@ export declare function asDefined<T>(obj: Optional<T>, fallback?: NonNullable<T>): NonNullable<T>;

export declare const asOptIndex: import("../TypeCast.type").OptionalTypeCast<import("..").Index, unknown>;
export declare const asOptIndexable: import("../TypeCast.type").OptionalTypeCast<Record<import("..").Index, unknown>, unknown>;
export declare const asOptIndexable: import("../TypeCast.type").OptionalTypeCast<import("..").Indexable, unknown>;
export declare const asOptBoolean: import("../TypeCast.type").OptionalTypeCast<boolean, unknown>;
export declare const asOptArray: import("../TypeCast.type").OptionalTypeCast<unknown[], unknown>;
export declare const asOptDictionary: import("../TypeCast.type").OptionalTypeCast<Record<string, unknown>, unknown>;
export declare const asOptDictionary: import("../TypeCast.type").OptionalTypeCast<import("..").Dictionary<unknown>, unknown>;
export declare const asOptFunction: import("../TypeCast.type").OptionalTypeCast<import("..").UnknownFunction<unknown>, unknown>;
import type { OptionalTypeCast, TypeCast } from '../TypeCast.type';
import type { Dictionary } from '../Dictionary.type';
import type { TypeCheck } from '../TypeCheck.type';
export declare const asArrayOf: <T>(par: TypeCheck<T>) => TypeCast<T[], unknown>;
export declare const asDictionaryOf: <T>(par: TypeCheck<T>) => TypeCast<Record<string, T>, unknown>;
export declare const asDictionaryOf: <T>(par: TypeCheck<T>) => TypeCast<Dictionary<T>, unknown>;
export declare const asOptArrayOf: <T>(par: TypeCheck<T>) => OptionalTypeCast<T[], unknown>;
export declare const asOptDictionaryOf: <T>(par: TypeCheck<T>) => OptionalTypeCast<Record<string, T>, unknown>;
export declare const asOptDictionaryOf: <T>(par: TypeCheck<T>) => OptionalTypeCast<Dictionary<T>, unknown>;

@@ -1,2 +0,3 @@

export declare const asStruct: <Pattern extends Record<string, import("..").TypeCheck<unknown>>>(par: Pattern) => (obj: unknown, fallback?: { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; } | undefined) => { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; };
export declare const asOptStruct: <Pattern extends Record<string, import("..").TypeCheck<unknown>>>(par: Pattern) => import("../TypeCast.type").OptionalTypeCast<{ [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; }, unknown>;
import type { InterfacePattern } from '../InterfacePattern.type';
export declare const asStruct: <Pattern extends InterfacePattern>(par: Pattern) => (obj: unknown, fallback?: { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; } | undefined) => { [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; };
export declare const asOptStruct: <Pattern extends InterfacePattern>(par: Pattern) => import("../TypeCast.type").OptionalTypeCast<{ [K in keyof Pattern]: import("../TypeCheck.type").UnwrapTypeCheck<Pattern[K]>; }, unknown>;
import type { Optional } from '../Optional.type';
import type { TypeCheck } from '../TypeCheck.type';
export declare const isDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Record<string, T>>;
export declare const isOptDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Optional<Record<string, T>>>;
import type { Dictionary } from '../Dictionary.type';
export declare const isDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Dictionary<T>>;
export declare const isOptDictionaryOf: <T>(par: TypeCheck<T>) => TypeCheck<Optional<Dictionary<T>>>;
export declare const isArrayOf: <T>(par: TypeCheck<T>) => TypeCheck<T[]>;
export declare const isOptArrayOf: <T>(par: TypeCheck<T>) => TypeCheck<Optional<T[]>>;

@@ -0,8 +1,9 @@

import type { InterfacePattern } from '../InterfacePattern.type';
import type { TypeCheck, UnwrapTypeCheck } from '../TypeCheck.type';
import type { Optional } from '../Optional.type';
export declare const isStruct: <Pattern extends Record<string, TypeCheck<unknown>>>(par: Pattern) => TypeCheck<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }> & {
export declare const isStruct: <Pattern extends InterfacePattern>(par: Pattern) => TypeCheck<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }> & {
TYPE_NAME: string;
};
export declare const isOptStruct: <Pattern extends Record<string, TypeCheck<unknown>>>(par: Pattern) => TypeCheck<Optional<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }>> & {
export declare const isOptStruct: <Pattern extends InterfacePattern>(par: Pattern) => TypeCheck<Optional<{ [K in keyof Pattern]: UnwrapTypeCheck<Pattern[K]>; }>> & {
TYPE_NAME: string;
};
{
"name": "ts-runtime-typecheck",
"version": "2.2.1",
"version": "2.2.2",
"description": "A collection of common types for TypeScript along with dynamic type cast methods.",

@@ -20,12 +20,12 @@ "main": "cjs/index.js",

"devDependencies": {
"@types/jest": "^26.0.14",
"@typescript-eslint/eslint-plugin": "^4.3.0",
"@typescript-eslint/parser": "^4.3.0",
"eslint": "^7.10.0",
"jest": "^26.5.0",
"rollup": "^2.32.0",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0",
"eslint": "^7.25.0",
"jest": "^26.6.3",
"rollup": "^2.46.0",
"rollup-plugin-typescript2": "^0.28.0",
"ts-jest": "^26.4.1",
"typescript": "^4.1.2"
"ts-jest": "^26.5.5",
"typescript": "^4.2.4"
}
}

@@ -53,2 +53,3 @@ # ts-runtime-typecheck

- [v2.2.1](#221)
- [v2.2.2](#222)

@@ -762,7 +763,7 @@ ## Type Casts

### v1.0.0
### 1.0.0
- Initial release
### v1.1.0
### 1.1.0

@@ -776,3 +777,3 @@ - Documentation update.

### v1.1.1
### 1.1.1

@@ -782,3 +783,3 @@ - Change: return type of `asOpt{TYPE}` is now `TYPE | undefined` instead of `Optional<TYPE>` ( removes null from union )

### v1.2.0
### 1.2.0

@@ -794,3 +795,3 @@ - Add: Introduce `isStruct` and `asStruct` that allow the inspection of a object to see if it meets a specific interface.

### v2.0.0
### 2.0.0

@@ -826,1 +827,5 @@ - Add: `isUnion` and `isOptUnion` to allow checking if a value matches any type of a type union.

- Fix: update sub-dependency to resolve [npm advisory 1654](https://www.npmjs.com/advisories/1654)
### 2.2.2
- Fix: `asInstance`, `asOptInstance`, `isInstance` and `isOptInstance` were not exported from the package.

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

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