Comparing version 1.0.2 to 1.0.3
@@ -8,3 +8,3 @@ module.exports = function(val,type){ | ||
} | ||
var reg = /\[object Arguments\]/i; | ||
var reg = /^\[object Arguments\]$/i; | ||
if(isTypeString){ | ||
@@ -18,3 +18,3 @@ var t = type.toLowerCase().split('|'); | ||
if(val===null||val===undefined) return false; | ||
if((reg).test(val.toString())&&t.some((i)=>i==='arguments')) return true; | ||
if((reg).test(val.toString())&&val.constructor.name==='Object'&&t.some((i)=>i==='arguments')) return true; | ||
return t.some((i)=>i===val.constructor.name.toLowerCase()); | ||
@@ -30,5 +30,5 @@ } | ||
if(val===null||val===undefined) return false; | ||
if(type.test('arguments')&&(reg).test(val.toString())) return true; | ||
if(type.test('arguments')&&val.constructor.name==='Object'&&(reg).test(val.toString())) return true; | ||
return type.test(val.constructor.name); | ||
} | ||
}; |
{ | ||
"name": "of-type", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Check if the given value is of the particular type or types.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
7876
4
29