Comparing version 0.0.3-alpha to 0.0.4-dev
@@ -41,2 +41,3 @@ 'use strict' | ||
let _compare = rules[rule] | ||
switch (rule) { | ||
@@ -58,10 +59,10 @@ // number cases | ||
case 'isObject': | ||
case 'isArray': | ||
_match = _compare === validate.object[rule](value) | ||
break | ||
case 'hasProperties': | ||
case 'isExactly': | ||
case 'isEnum': | ||
_match = validate.object[rule](value, _compare) | ||
break | ||
case 'hasProperties': | ||
_match = validate.object[rule](value, _compare) | ||
break | ||
// function cases | ||
@@ -68,0 +69,0 @@ case 'isFunction': |
@@ -9,2 +9,15 @@ 'use strict' | ||
}, | ||
isArray: function (value) { | ||
return value instanceof Array | ||
}, | ||
isEnum: function (value, _enum) { | ||
try { | ||
for (let key in _enum) { | ||
if (_enum[key] === value) { | ||
return true | ||
} | ||
} | ||
} catch (e) {} | ||
return false | ||
}, | ||
/** | ||
@@ -11,0 +24,0 @@ * implicitly check isObject |
{ | ||
"name": "checkv", | ||
"version": "0.0.3-alpha", | ||
"version": "0.0.4-dev", | ||
"description": "validator checker", | ||
@@ -5,0 +5,0 @@ "main": "main.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
6824
207