Comparing version 4.0.0 to 5.0.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.typical = factory()); | ||
}(this, function () { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global.typical = {})); | ||
}(this, function (exports) { 'use strict'; | ||
@@ -80,4 +80,4 @@ /** | ||
* function sum(x, y){ | ||
* console.log(t.isArrayLike(arguments)) | ||
* // prints `true` | ||
* console.log(t.isArrayLike(arguments)) | ||
* // prints `true` | ||
* } | ||
@@ -110,3 +110,3 @@ */ | ||
/** | ||
* Returns true if the input value is a string | ||
* Returns true if the input value is an ES2015 `class`. | ||
* @param {*} - the input to test | ||
@@ -116,34 +116,4 @@ * @returns {boolean} | ||
*/ | ||
function isString (input) { | ||
return typeof input === 'string' | ||
} | ||
/** | ||
* Returns true if the input value is a boolean | ||
* @param {*} - the input to test | ||
* @returns {boolean} | ||
* @static | ||
*/ | ||
function isBoolean (input) { | ||
return typeof input === 'boolean' | ||
} | ||
/** | ||
* Returns true if the input value is a function | ||
* @param {*} - the input to test | ||
* @returns {boolean} | ||
* @static | ||
*/ | ||
function isFunction (input) { | ||
return typeof input === 'function' | ||
} | ||
/** | ||
* Returns true if the input value is an es2015 `class`. | ||
* @param {*} - the input to test | ||
* @returns {boolean} | ||
* @static | ||
*/ | ||
function isClass (input) { | ||
if (isFunction(input)) { | ||
if (typeof input === 'function') { | ||
return /^class /.test(Function.prototype.toString.call(input)) | ||
@@ -241,19 +211,14 @@ } else { | ||
var index = { | ||
isNumber, | ||
isString, | ||
isBoolean, | ||
isPlainObject, | ||
isArrayLike, | ||
isObject, | ||
isDefined, | ||
isFunction, | ||
isClass, | ||
isPrimitive, | ||
isPromise, | ||
isIterable | ||
}; | ||
exports.isArrayLike = isArrayLike; | ||
exports.isClass = isClass; | ||
exports.isDefined = isDefined; | ||
exports.isIterable = isIterable; | ||
exports.isNumber = isNumber; | ||
exports.isObject = isObject; | ||
exports.isPlainObject = isPlainObject; | ||
exports.isPrimitive = isPrimitive; | ||
exports.isPromise = isPromise; | ||
return index; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); |
{ | ||
"name": "typical", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"description": "Robust Javascript type-checking", | ||
@@ -35,5 +35,6 @@ "repository": "https://github.com/75lb/typical", | ||
"test": "npm run test:js && npm run test:esm && npm run test:web", | ||
"test:js": "rollup test.mjs -f cjs -o dist/test.js && rollup test-v10.mjs -f cjs -o dist/test-v10.js && test-runner dist/test*.js", | ||
"test:esm": "esm-runner test*.mjs", | ||
"test:js": "rollup test/*.mjs -f cjs -d tmp/test && test-runner tmp/test/test*.js", | ||
"test:esm": "esm-runner test/*.mjs", | ||
"test:web": "web-runner test.mjs", | ||
"test:v8": "rollup test/test.mjs test/test-default.mjs -f cjs -d tmp/test && test-runner tmp/test/test*.js", | ||
"dist": "rollup index.mjs -f umd -n typical -o dist/index.js", | ||
@@ -46,7 +47,7 @@ "docs": "jsdoc2md -c jsdoc.conf -t README.hbs index.mjs > README.md; echo", | ||
"coveralls": "^3.0.3", | ||
"esm-runner": "^0.1.2", | ||
"esm-runner": "^0.1.4", | ||
"jsdoc-to-markdown": "^4.0.1", | ||
"rollup": "^1.7.0", | ||
"test-object-model": "^0.3.8", | ||
"test-runner": "^0.6.0-14" | ||
"rollup": "^1.10.1", | ||
"test-object-model": "^0.4.0", | ||
"test-runner": "^0.6.0-15" | ||
}, | ||
@@ -53,0 +54,0 @@ "files": [ |
@@ -24,5 +24,2 @@ [![view on npm](http://img.shields.io/npm/v/typical.svg)](https://www.npmjs.org/package/typical) | ||
* [.isDefined(input)](#module_typical.isDefined) ⇒ <code>boolean</code> | ||
* [.isString(input)](#module_typical.isString) ⇒ <code>boolean</code> | ||
* [.isBoolean(input)](#module_typical.isBoolean) ⇒ <code>boolean</code> | ||
* [.isFunction(input)](#module_typical.isFunction) ⇒ <code>boolean</code> | ||
* [.isClass(input)](#module_typical.isClass) ⇒ <code>boolean</code> | ||
@@ -109,4 +106,4 @@ * [.isPrimitive(input)](#module_typical.isPrimitive) ⇒ <code>boolean</code> | ||
function sum(x, y){ | ||
console.log(t.isArrayLike(arguments)) | ||
// prints `true` | ||
console.log(t.isArrayLike(arguments)) | ||
// prints `true` | ||
} | ||
@@ -117,3 +114,3 @@ ``` | ||
### t.isObject(input) ⇒ <code>boolean</code> | ||
returns true if the typeof input is `'object'`, but not null! | ||
Returns true if the typeof input is `'object'` but not null. | ||
@@ -129,3 +126,3 @@ **Kind**: static method of [<code>typical</code>](#module_typical) | ||
### t.isDefined(input) ⇒ <code>boolean</code> | ||
Returns true if the input value is defined | ||
Returns true if the input value is defined. | ||
@@ -138,39 +135,6 @@ **Kind**: static method of [<code>typical</code>](#module_typical) | ||
<a name="module_typical.isString"></a> | ||
### t.isString(input) ⇒ <code>boolean</code> | ||
Returns true if the input value is a string | ||
**Kind**: static method of [<code>typical</code>](#module_typical) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| input | <code>\*</code> | the input to test | | ||
<a name="module_typical.isBoolean"></a> | ||
### t.isBoolean(input) ⇒ <code>boolean</code> | ||
Returns true if the input value is a boolean | ||
**Kind**: static method of [<code>typical</code>](#module_typical) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| input | <code>\*</code> | the input to test | | ||
<a name="module_typical.isFunction"></a> | ||
### t.isFunction(input) ⇒ <code>boolean</code> | ||
Returns true if the input value is a function | ||
**Kind**: static method of [<code>typical</code>](#module_typical) | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| input | <code>\*</code> | the input to test | | ||
<a name="module_typical.isClass"></a> | ||
### t.isClass(input) ⇒ <code>boolean</code> | ||
Returns true if the input value is an es2015 `class`. | ||
Returns true if the input value is an ES2015 `class`. | ||
@@ -177,0 +141,0 @@ **Kind**: static method of [<code>typical</code>](#module_typical) |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
20421
409
242