Comparing version 2.0.2 to 2.1.0
@@ -22,2 +22,3 @@ module.exports = function(val,type){ | ||
if(tArr){ | ||
if(!type.length) return true; | ||
for(var i in type){ | ||
@@ -24,0 +25,0 @@ if(type[i]===null&&vNull) return true; |
{ | ||
"name": "of-type", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Check if the given value is of the particular type or types.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,2 +11,3 @@ # Description | ||
* the value can be now checked with the `function:constructor` objects, `null` or `undefined` *(or array of these items)* | ||
* the **empty** array passed as the second argument is equal to 'any', or /any/ types. The modules function returns `true` for the values of **any** type. | ||
* the TypeError is not throwing when the arguments passed through module function are incorrect *(missing)*. It return `false` instead. | ||
@@ -54,3 +55,3 @@ * tests added | ||
* The **`type`** can contain the value: `'falsy'` or `/falsy/`. It returns `true` for the **`val`** values like: `""`, `false`, `0`, `null`, `undefined`, etc. | ||
* The **`type`** can contain the value: `''` or `'any'` or `/any/`, It returns `true` for the **`val`** values of **any type** | ||
* The **`type`** can contain the value: `''` or `[]` or `'any'` or `/any/`, It returns `true` for the **`val`** values of **any type** | ||
@@ -192,2 +193,8 @@ #### Return value | ||
ofType(null,[]); //true | ||
ofType("hello world",[]); //true | ||
ofType(Number,[]); //true | ||
ofType(0,[]); //true | ||
ofType(new Date(),[]); //true | ||
ofType(null,null); //true | ||
@@ -194,0 +201,0 @@ ofType(undefined,null); //false |
Sorry, the diff of this file is too big to display
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
264653
2509
207