arguments-validate
v1.0.3
Published
Validate function arguments and general variables
Downloads
3
Maintainers
Readme
Validator
Validate function arguments and general variables
Example
const validate = require('arguments-validate')
function test(obj, cb) {
const v = new validate('Test function')
v.add(obj, 'object').hasKey('header').nest({ header: { type: 'object' } })
.add(cb, 'function', true) // Optional argument
.out((pre, errors) => console.error(pre, errors))
}
}
test({body:123},'123')