1.0.3 • Published 3 years ago

arguments-validate v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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')