@fabiospampinato/is
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -9,4 +9,7 @@ import isArguments from './is_arguments'; | ||
import isBigUint64Array from './is_biguint64array'; | ||
import isBlob from './is_blob'; | ||
import isBoolean from './is_boolean'; | ||
import isBuffer from './is_buffer'; | ||
import isClass from './is_class'; | ||
import isDataView from './is_data_view'; | ||
import isDate from './is_date'; | ||
@@ -16,2 +19,3 @@ import isElement from './is_element'; | ||
import isError from './is_error'; | ||
import isEven from './is_even'; | ||
import isFalsy from './is_falsy'; | ||
@@ -31,2 +35,3 @@ import isFinite from './is_finite'; | ||
import isNative from './is_native'; | ||
import isNegativeZero from './is_negative_zero'; | ||
import isNil from './is_nil'; | ||
@@ -37,2 +42,3 @@ import isNull from './is_null'; | ||
import isObjectLike from './is_object_like'; | ||
import isOdd from './is_odd'; | ||
import isPlainObject from './is_plain_object'; | ||
@@ -45,2 +51,3 @@ import isPrimitive from './is_primitive'; | ||
import isSet from './is_set'; | ||
import isSharedArrayBuffer from './is_shared_array_buffer'; | ||
import isString from './is_string'; | ||
@@ -56,3 +63,4 @@ import isSymbol from './is_symbol'; | ||
import isWeakMap from './is_weak_map'; | ||
import isWeakRef from './is_weak_ref'; | ||
import isWeakSet from './is_weak_set'; | ||
export { isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBigInt, isBigInt64Array, isBigUint64Array, isBoolean, isBuffer, isDate, isElement, isEmpty, isError, isFalsy, isFinite, isFloat, isFloat32Array, isFloat64Array, isFunction, isInt16Array, isInt32Array, isInt8Array, isInteger, isLength, isMap, isNaN, isNative, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrimitive, isPromise, isPrototype, isRegExp, isSafeInteger, isSet, isString, isSymbol, isTruthy, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isWeakMap, isWeakSet }; | ||
export { isArguments, isArray, isArrayBuffer, isArrayLike, isArrayLikeObject, isBigInt, isBigInt64Array, isBigUint64Array, isBlob, isBoolean, isBuffer, isClass, isDataView, isDate, isElement, isEmpty, isError, isEven, isFalsy, isFinite, isFloat, isFloat32Array, isFloat64Array, isFunction, isInt16Array, isInt32Array, isInt8Array, isInteger, isLength, isMap, isNaN, isNative, isNegativeZero, isNil, isNull, isNumber, isObject, isObjectLike, isOdd, isPlainObject, isPrimitive, isPromise, isPrototype, isRegExp, isSafeInteger, isSet, isString, isSharedArrayBuffer, isSymbol, isTruthy, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, isWeakMap, isWeakRef, isWeakSet }; |
"use strict"; | ||
/* MAIN */ | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isWeakMap = exports.isUndefined = exports.isUint8ClampedArray = exports.isUint8Array = exports.isUint32Array = exports.isUint16Array = exports.isTypedArray = exports.isTruthy = exports.isSymbol = exports.isString = exports.isSet = exports.isSafeInteger = exports.isRegExp = exports.isPrototype = exports.isPromise = exports.isPrimitive = exports.isPlainObject = exports.isObjectLike = exports.isObject = exports.isNumber = exports.isNull = exports.isNil = exports.isNative = exports.isNaN = exports.isMap = exports.isLength = exports.isInteger = exports.isInt8Array = exports.isInt32Array = exports.isInt16Array = exports.isFunction = exports.isFloat64Array = exports.isFloat32Array = exports.isFloat = exports.isFinite = exports.isFalsy = exports.isError = exports.isEmpty = exports.isElement = exports.isDate = exports.isBuffer = exports.isBoolean = exports.isBigUint64Array = exports.isBigInt64Array = exports.isBigInt = exports.isArrayLikeObject = exports.isArrayLike = exports.isArrayBuffer = exports.isArray = exports.isArguments = void 0; | ||
exports.isWeakSet = void 0; | ||
exports.isTruthy = exports.isSymbol = exports.isSharedArrayBuffer = exports.isString = exports.isSet = exports.isSafeInteger = exports.isRegExp = exports.isPrototype = exports.isPromise = exports.isPrimitive = exports.isPlainObject = exports.isOdd = exports.isObjectLike = exports.isObject = exports.isNumber = exports.isNull = exports.isNil = exports.isNegativeZero = exports.isNative = exports.isNaN = exports.isMap = exports.isLength = exports.isInteger = exports.isInt8Array = exports.isInt32Array = exports.isInt16Array = exports.isFunction = exports.isFloat64Array = exports.isFloat32Array = exports.isFloat = exports.isFinite = exports.isFalsy = exports.isEven = exports.isError = exports.isEmpty = exports.isElement = exports.isDate = exports.isDataView = exports.isClass = exports.isBuffer = exports.isBoolean = exports.isBlob = exports.isBigUint64Array = exports.isBigInt64Array = exports.isBigInt = exports.isArrayLikeObject = exports.isArrayLike = exports.isArrayBuffer = exports.isArray = exports.isArguments = void 0; | ||
exports.isWeakSet = exports.isWeakRef = exports.isWeakMap = exports.isUndefined = exports.isUint8ClampedArray = exports.isUint8Array = exports.isUint32Array = exports.isUint16Array = exports.isTypedArray = void 0; | ||
var is_arguments_1 = require("./is_arguments"); | ||
@@ -22,2 +22,4 @@ exports.isArguments = is_arguments_1.default; | ||
exports.isBigUint64Array = is_biguint64array_1.default; | ||
var is_blob_1 = require("./is_blob"); | ||
exports.isBlob = is_blob_1.default; | ||
var is_boolean_1 = require("./is_boolean"); | ||
@@ -27,2 +29,6 @@ exports.isBoolean = is_boolean_1.default; | ||
exports.isBuffer = is_buffer_1.default; | ||
var is_class_1 = require("./is_class"); | ||
exports.isClass = is_class_1.default; | ||
var is_data_view_1 = require("./is_data_view"); | ||
exports.isDataView = is_data_view_1.default; | ||
var is_date_1 = require("./is_date"); | ||
@@ -36,2 +42,4 @@ exports.isDate = is_date_1.default; | ||
exports.isError = is_error_1.default; | ||
var is_even_1 = require("./is_even"); | ||
exports.isEven = is_even_1.default; | ||
var is_falsy_1 = require("./is_falsy"); | ||
@@ -65,2 +73,4 @@ exports.isFalsy = is_falsy_1.default; | ||
exports.isNative = is_native_1.default; | ||
var is_negative_zero_1 = require("./is_negative_zero"); | ||
exports.isNegativeZero = is_negative_zero_1.default; | ||
var is_nil_1 = require("./is_nil"); | ||
@@ -76,2 +86,4 @@ exports.isNil = is_nil_1.default; | ||
exports.isObjectLike = is_object_like_1.default; | ||
var is_odd_1 = require("./is_odd"); | ||
exports.isOdd = is_odd_1.default; | ||
var is_plain_object_1 = require("./is_plain_object"); | ||
@@ -91,2 +103,4 @@ exports.isPlainObject = is_plain_object_1.default; | ||
exports.isSet = is_set_1.default; | ||
var is_shared_array_buffer_1 = require("./is_shared_array_buffer"); | ||
exports.isSharedArrayBuffer = is_shared_array_buffer_1.default; | ||
var is_string_1 = require("./is_string"); | ||
@@ -112,3 +126,5 @@ exports.isString = is_string_1.default; | ||
exports.isWeakMap = is_weak_map_1.default; | ||
var is_weak_ref_1 = require("./is_weak_ref"); | ||
exports.isWeakRef = is_weak_ref_1.default; | ||
var is_weak_set_1 = require("./is_weak_set"); | ||
exports.isWeakSet = is_weak_set_1.default; |
{ | ||
"name": "@fabiospampinato/is", | ||
"description": "The definitive collection of is* functions for runtime type checking. Lodash-compatible, tree-shakable, with types.", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/index.d.ts", |
@@ -114,2 +114,13 @@ # Is | ||
#### `isBlob` 🆕 | ||
Checks if a value is a Blob. | ||
```ts | ||
import {isBlob} from 'is'; | ||
isBlob ( new Blob ( [] ) ); // => true | ||
isBlob ( [] ); // => false | ||
``` | ||
#### `isBoolean` | ||
@@ -138,2 +149,24 @@ | ||
#### `isClass` 🆕 | ||
Checks if a value is an ES6 class. Note that classes lowered to work in ES5 are not actual classes anymore, there's a detectable difference when the `class` keyword is used. | ||
```ts | ||
import {isClass} from 'is'; | ||
isClass ( class Foo {} ); // => true | ||
isClass ( isClass ); // => false | ||
``` | ||
#### `isDataView` 🆕 | ||
Checks if a value is a DataView. | ||
```ts | ||
import {isDataView} from 'is'; | ||
isDataView ( new DataView ( new ArrayBuffer ( 2 ) ) ); // => true | ||
isDataView ( [] ); // => false | ||
``` | ||
#### `isDate` | ||
@@ -185,2 +218,13 @@ | ||
#### `isEven` 🆕 | ||
Checks if a value is an even integer. | ||
```ts | ||
import {isEven} from 'is'; | ||
isEven ( 2 ); // => true | ||
isEven ( 1 ); // => false | ||
``` | ||
#### `isFalsy` 🆕 | ||
@@ -347,2 +391,13 @@ | ||
#### `isNegativeZero` 🆕 | ||
Checks if a value is a negative zero, which if you didn't know is detectably different from a positive zero, for real. | ||
```ts | ||
import {isNegativeZero} from 'is'; | ||
isNegativeZero ( -0 ); // => true | ||
isNegativeZero ( 0 ); // => false | ||
``` | ||
#### `isNil` | ||
@@ -410,2 +465,13 @@ | ||
#### `isOdd` 🆕 | ||
Checks if a value is an odd integer. | ||
```ts | ||
import {isOdd} from 'is'; | ||
isOdd ( 1 ); // => true | ||
isOdd ( 2 ); // => false | ||
``` | ||
#### `isPlainObject` | ||
@@ -500,2 +566,13 @@ | ||
#### `isSharedArrayBuffer` 🆕 | ||
Checks if a value is a SharedArrayBuffer object. | ||
```ts | ||
import {isSharedArrayBuffer} from 'is'; | ||
isSharedArrayBuffer ( new SharedArrayBuffer ( 8 ) ); // => true | ||
isSharedArrayBuffer ( [] ); // => false | ||
``` | ||
#### `isString` | ||
@@ -612,2 +689,13 @@ | ||
#### `isWeakRef` 🆕 | ||
Checks if a value is a WeakRef. | ||
```ts | ||
import {isWeakRef} from 'is'; | ||
isWeakRef ( new WeakRef ( WeakRef ) ); // => true | ||
isWeakRef ( WeakRef ) ); // => false | ||
``` | ||
#### `isWeakSet` | ||
@@ -614,0 +702,0 @@ |
@@ -12,4 +12,7 @@ | ||
import isBigUint64Array from './is_biguint64array'; | ||
import isBlob from './is_blob'; | ||
import isBoolean from './is_boolean'; | ||
import isBuffer from './is_buffer'; | ||
import isClass from './is_class'; | ||
import isDataView from './is_data_view'; | ||
import isDate from './is_date'; | ||
@@ -19,2 +22,3 @@ import isElement from './is_element'; | ||
import isError from './is_error'; | ||
import isEven from './is_even'; | ||
import isFalsy from './is_falsy'; | ||
@@ -34,2 +38,3 @@ import isFinite from './is_finite'; | ||
import isNative from './is_native'; | ||
import isNegativeZero from './is_negative_zero'; | ||
import isNil from './is_nil'; | ||
@@ -40,2 +45,3 @@ import isNull from './is_null'; | ||
import isObjectLike from './is_object_like'; | ||
import isOdd from './is_odd'; | ||
import isPlainObject from './is_plain_object'; | ||
@@ -48,2 +54,3 @@ import isPrimitive from './is_primitive'; | ||
import isSet from './is_set'; | ||
import isSharedArrayBuffer from './is_shared_array_buffer'; | ||
import isString from './is_string'; | ||
@@ -59,2 +66,3 @@ import isSymbol from './is_symbol'; | ||
import isWeakMap from './is_weak_map'; | ||
import isWeakRef from './is_weak_ref'; | ||
import isWeakSet from './is_weak_set'; | ||
@@ -73,4 +81,7 @@ | ||
isBigUint64Array, | ||
isBlob, | ||
isBoolean, | ||
isBuffer, | ||
isClass, | ||
isDataView, | ||
isDate, | ||
@@ -80,2 +91,3 @@ isElement, | ||
isError, | ||
isEven, | ||
isFalsy, | ||
@@ -95,2 +107,3 @@ isFinite, | ||
isNative, | ||
isNegativeZero, | ||
isNil, | ||
@@ -101,2 +114,3 @@ isNull, | ||
isObjectLike, | ||
isOdd, | ||
isPlainObject, | ||
@@ -110,2 +124,3 @@ isPrimitive, | ||
isString, | ||
isSharedArrayBuffer, | ||
isSymbol, | ||
@@ -120,3 +135,4 @@ isTruthy, | ||
isWeakMap, | ||
isWeakRef, | ||
isWeakSet | ||
}; |
@@ -12,2 +12,7 @@ | ||
(function () { | ||
class Blob { | ||
get [Symbol.toStringTag] () { | ||
return 'Blob'; | ||
} | ||
} | ||
return { | ||
@@ -40,6 +45,9 @@ 'ArrayBuffer': ArrayBuffer, | ||
'array': [1], | ||
'blob': new Blob (), | ||
'boolean': Object ( false ), | ||
class: class Foo {}, | ||
'date': new Date (), | ||
'element': new (class Ele { nodeType = 1 }) (), | ||
'errors': [new Error (), new EvalError (), new RangeError (), new ReferenceError (), new SyntaxError (), new TypeError (), new URIError ()], | ||
'even': Number ( 2 ), | ||
'float': Number ( 0.1 ), | ||
@@ -50,2 +58,3 @@ 'function': function () {}, | ||
'nan': NaN, | ||
'negzero': Number ( -0 ), | ||
'null': null, | ||
@@ -55,5 +64,7 @@ 'number': Object ( 0 ), | ||
'object': { 'a': 1 }, | ||
'odd': Number ( 1 ), | ||
'promise': Promise.resolve ( 1 ), | ||
'regexp': /x/, | ||
'set': new Set (), | ||
'sharedArrayBuffer': new SharedArrayBuffer ( 2 ), | ||
'string': Object ( 'a' ), | ||
@@ -63,2 +74,3 @@ 'symbol': Symbol (), | ||
'weakMap': new WeakMap (), | ||
'weakRef': new WeakRef ( WeakRef ), | ||
'weakSet': new WeakSet () | ||
@@ -65,0 +77,0 @@ }; |
@@ -39,2 +39,3 @@ | ||
t.false ( isArrayBuffer ( { byteLength: 1 } ) ); | ||
t.false ( isArrayBuffer ( new SharedArrayBuffer ( 2 ) ) ); | ||
@@ -41,0 +42,0 @@ }); |
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
159175
249
3906
709