Socket
Socket
Sign inDemoInstall

is-what

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-what - npm Package Compare versions

Comparing version 3.5.1 to 3.6.0

test/ava.ts

1

.eslintrc.js

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

// npm i -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-prettier eslint-plugin-tree-shaking
module.exports = {

@@ -2,0 +3,0 @@ root: true,

@@ -184,2 +184,11 @@ 'use strict';

/**
* Returns whether the payload is a promise
*
* @param {*} payload
* @returns {payload is Promise}
*/
function isPromise(payload) {
return getType(payload) === 'Promise';
}
/**
* Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)

@@ -247,2 +256,3 @@ *

exports.isPrimitive = isPrimitive;
exports.isPromise = isPromise;
exports.isRegExp = isRegExp;

@@ -249,0 +259,0 @@ exports.isString = isString;

@@ -180,2 +180,11 @@ /**

/**
* Returns whether the payload is a promise
*
* @param {*} payload
* @returns {payload is Promise}
*/
function isPromise(payload) {
return getType(payload) === 'Promise';
}
/**
* Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)

@@ -226,2 +235,2 @@ *

export { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyString, isFile, isFullString, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isRegExp, isString, isSymbol, isType, isUndefined };
export { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyString, isFile, isFullString, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isRegExp, isString, isSymbol, isType, isUndefined };

27

package.json
{
"name": "is-what",
"sideEffects": false,
"version": "3.5.1",
"version": "3.6.0",
"description": "JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.",

@@ -10,2 +10,3 @@ "main": "dist/index.cjs.js",

"scripts": {
"ava": "ava",
"test": "jest",

@@ -49,7 +50,8 @@ "test-w": "jest --watchAll",

"devDependencies": {
"@babel/core": "^7.8.3",
"@babel/core": "^7.8.4",
"@types/babel-core": "^6.25.6",
"@types/jest": "^24.9.0",
"@typescript-eslint/eslint-plugin": "^2.16.0",
"@typescript-eslint/parser": "^2.16.0",
"@types/jest": "^24.9.1",
"@typescript-eslint/eslint-plugin": "^2.19.0",
"@typescript-eslint/parser": "^2.19.0",
"ava": "^3.2.0",
"babel-core": "^7.0.0-bridge.0",

@@ -59,11 +61,20 @@ "babel-jest": "^24.9.0",

"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-tree-shaking": "^1.8.0",
"jest": "^24.9.0",
"regenerator-runtime": "^0.13.3",
"rollup": "^1.29.0",
"rollup": "^1.31.0",
"rollup-plugin-typescript2": "^0.25.3",
"ts-node": "^8.6.2",
"typescript": "^3.7.5"
},
"dependencies": {}
"dependencies": {},
"ava": {
"extensions": [
"ts"
],
"require": [
"ts-node/register"
]
}
}

@@ -198,2 +198,12 @@ /**

/**
* Returns whether the payload is a promise
*
* @param {*} payload
* @returns {payload is Promise}
*/
export function isPromise (payload: any): payload is Promise<any> {
return getType(payload) === 'Promise'
}
/**
* Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)

@@ -200,0 +210,0 @@ *

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

// @ts-check
import {

@@ -22,2 +23,3 @@ isObject,

isFile,
isPromise,
} from '../dist/index.cjs'

@@ -49,2 +51,3 @@

expect(isFile(new File([''], '', { type: 'text/html' }))).toBe(true)
expect(isPromise(new Promise((resolve, reject) => {}))).toBe(true)
})

@@ -51,0 +54,0 @@

@@ -146,2 +146,9 @@ /**

/**
* Returns whether the payload is a promise
*
* @param {*} payload
* @returns {payload is Promise}
*/
export declare function isPromise(payload: any): payload is Promise<any>;
/**
* Returns whether the payload is a primitive type (eg. Boolean | Null | Undefined | Number | String | Symbol)

@@ -148,0 +155,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