Comparing version 2.1.1 to 2.1.3
12
index.js
@@ -23,12 +23,12 @@ module.exports = function(val,type){ | ||
if(!type.length) return true; | ||
for(var i in type){ | ||
if(type[i]===null&&vNull) return true; | ||
if(typeof type[i]==='undefined'&&vUnd) return true; | ||
for(var t of type){ | ||
if(t===null&&vNull) return true; | ||
if(typeof t==='undefined'&&vUnd) return true; | ||
if(vNull||vUnd) continue; | ||
if(type[i]===null||typeof type[i]==='undefined') continue; | ||
if(Object.getPrototypeOf(val).constructor.name === type[i].name) return true; | ||
if(t===null||typeof t==='undefined') continue; | ||
if(Object.getPrototypeOf(val).constructor.name === t.name) return true; | ||
} | ||
return false; | ||
} | ||
if(tString){ | ||
@@ -35,0 +35,0 @@ var t = type.toLowerCase().split('|'); |
{ | ||
"name": "of-type", | ||
"version": "2.1.1", | ||
"version": "2.1.3", | ||
"description": "Check if the given value is of the particular type or types.", | ||
@@ -17,3 +17,3 @@ "main": "index.js", | ||
], | ||
"author": "Paweł Rafałko", | ||
"author": "Pawel Rafalko", | ||
"license": "MIT", | ||
@@ -20,0 +20,0 @@ "repository": { |
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
264757