Comparing version 1.0.3 to 1.0.4
'use strict' | ||
function isArguments (thingy) { | ||
return typeof thingy === 'object' && thingy.hasOwnProperty('callee') | ||
} | ||
var types = { | ||
'*': ['any', function () { return true }], | ||
A: ['array', function (thingy) { return (Array.isArray && Array.isArray(thingy)) || (typeof thingy === 'object' && thingy.hasOwnProperty('callee')) }], | ||
A: ['array', function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }], | ||
S: ['string', function (thingy) { return typeof thingy === 'string' }], | ||
@@ -7,0 +11,0 @@ N: ['number', function (thingy) { return typeof thingy === 'number' }], |
{ | ||
"name": "aproba", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "A rediculously light-weight argument validator", | ||
@@ -11,5 +11,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"standard": "^7.1.0", | ||
"tap": "^5.7.1" | ||
"standard": "^7.1.2", | ||
"tap": "^5.7.3" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
@@ -16,0 +19,0 @@ "test": "standard && tap test/*.js" |
aproba | ||
====== | ||
A rediculously light-weight function argument validator | ||
A ridiculously light-weight function argument validator | ||
@@ -37,4 +37,8 @@ ``` | ||
If an error argument is found and is not null then the remaining arguments will not be validated. | ||
If you pass in an invalid type then it will throw with a code of | ||
`EUNKNOWNTYPE`. | ||
If an error argument is found and is not null then the remaining arguments | ||
will not be validated. | ||
### Why this exists | ||
@@ -41,0 +45,0 @@ |
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
60
5410
4
54