New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wessberg/typedetector

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wessberg/typedetector - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

12

dist/cjs/interface/ITypeDetector.d.ts
export declare type TypeOf = "string" | "object" | "regexp" | "number" | "date" | "symbol" | "function" | "boolean" | "null" | "undefined" | "array" | "set" | "map" | "weakset" | "weakmap" | "class" | "constructor";
export interface IArbitraryObject<T> {
[key: string]: T;
[key: number]: T;
export interface IArbitraryObject {
[key: string]: any;
[key: number]: any;
}
export interface ITypeDetector {
isClassConstructor(item: any): item is Function;
isClassInstance<T>(item: any): item is T;
isClassConstructor(item: any): item is new (args: any[]) => Function;
isClassInstance<T extends any>(item: T): item is T;
isBoolean(item: any): item is boolean;
isString(item: any): item is string;
isNumber(item: any): item is number;
isObject<T>(item: any): item is IArbitraryObject<T>;
isObject(item: any): item is IArbitraryObject;
isPrimitive(item: any): item is string | symbol | number | boolean;

@@ -14,0 +14,0 @@ isPrimitivePrototype(item: any): item is typeof String | typeof Number | typeof Boolean | typeof Symbol;

@@ -19,3 +19,3 @@ import { IArbitraryObject, ITypeDetector, TypeOf } from "./interface/ITypeDetector";

*/
isClassInstance<T>(item: any): item is T;
isClassInstance<T extends any>(item: T): item is T;
/**

@@ -44,3 +44,3 @@ * Returns true f the given item is a boolean.

*/
isObject<T>(item: any): item is IArbitraryObject<T>;
isObject(item: any): item is IArbitraryObject;
/**

@@ -47,0 +47,0 @@ * Returns true f the given item is a primitive type.

export declare type TypeOf = "string" | "object" | "regexp" | "number" | "date" | "symbol" | "function" | "boolean" | "null" | "undefined" | "array" | "set" | "map" | "weakset" | "weakmap" | "class" | "constructor";
export interface IArbitraryObject<T> {
[key: string]: T;
[key: number]: T;
export interface IArbitraryObject {
[key: string]: any;
[key: number]: any;
}
export interface ITypeDetector {
isClassConstructor(item: any): item is Function;
isClassInstance<T>(item: any): item is T;
isClassConstructor(item: any): item is new (args: any[]) => Function;
isClassInstance<T extends any>(item: T): item is T;
isBoolean(item: any): item is boolean;
isString(item: any): item is string;
isNumber(item: any): item is number;
isObject<T>(item: any): item is IArbitraryObject<T>;
isObject(item: any): item is IArbitraryObject;
isPrimitive(item: any): item is string | symbol | number | boolean;

@@ -14,0 +14,0 @@ isPrimitivePrototype(item: any): item is typeof String | typeof Number | typeof Boolean | typeof Symbol;

@@ -19,3 +19,3 @@ import { IArbitraryObject, ITypeDetector, TypeOf } from "./interface/ITypeDetector";

*/
isClassInstance<T>(item: any): item is T;
isClassInstance<T extends any>(item: T): item is T;
/**

@@ -44,3 +44,3 @@ * Returns true f the given item is a boolean.

*/
isObject<T>(item: any): item is IArbitraryObject<T>;
isObject(item: any): item is IArbitraryObject;
/**

@@ -47,0 +47,0 @@ * Returns true f the given item is a primitive type.

{
"name": "@wessberg/typedetector",
"version": "1.0.5",
"version": "1.0.6",
"description": "A class that holds a set of predicate methods that detects the native type of the input.",

@@ -11,7 +11,10 @@ "main": "./dist/cjs/index.js",

"scripts": {
"build:pre": "mkdir -p dist/cjs/interface && mkdir -p dist/es2015/interface",
"clean:dist": "rm -r -f dist",
"clean:compiled": "rm -r -f compiled",
"clean": "npm run clean:dist & npm run clean:compiled",
"build:pre": "npm run clean && mkdir -p dist/cjs/interface && mkdir -p dist/es2015/interface",
"build:cjs": "tsc --module commonjs --outDir dist/cjs -p tsconfig.dist.json",
"build:es2015": "tsc --module es2015 --outDir dist/es2015 -p tsconfig.dist.json",
"build": "npm run build:pre && npm run build:cjs && npm run build:es2015",
"test:pre": "tsc --module commonjs --target es2017 --sourceMap",
"test:pre": "npm run clean:compiled && tsc --module commonjs --target es2017 --sourceMap",
"test": "NODE_ENV=TEST npm run test:pre && ava"

@@ -18,0 +21,0 @@ },

@@ -30,2 +30,6 @@ # TypeDetector [![NPM version][npm-image]][npm-url]

**v1.0.6**:
- Made type updates to make TypeDetector compatible with Typescript ^2.4.1.
**v1.0.5**:

@@ -32,0 +36,0 @@

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