arguments-validate

1.0.3 • Public • Published

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

/arguments-validate/

    Package Sidebar

    Install

    npm i arguments-validate

    Weekly Downloads

    3

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.08 kB

    Total Files

    5

    Last publish

    Collaborators

    • danisl99