
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
arguments-verify
Advanced tools
function to check if arguments of function are valid
0.3.0
npm install --save arguments-verify
var argumentsVerify = require('arguments-verify')
function func (arr, num) {
argumentsVerify([['Array'], ['Number', 'Undefined']], function (err) {
if (err) {
throw Error('in ' + fnName + ': ' + err.value + ' is not correct')
}
}, 'func')
num = num || 1
return arr.map(function (e) {
return e * num
})
}
// or
var func_validator = {
fnName: 'func',
validate: argumentsVerify
}
function func (arr, num) {
func_validator.validate([['Array'], ['Number', 'Undefined']], function (err) {
if (err) {
throw Error('in ' + fnName + ': ' + err.value + ' is not correct')
}
})
num = num || 1
return arr.map(function (e) {
return e * num
})
}
See tests
MIT
FAQs
arguments verifier
The npm package arguments-verify receives a total of 8 weekly downloads. As such, arguments-verify popularity was classified as not popular.
We found that arguments-verify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.