Détail du package

checkup

coderaiser64.5kMIT1.3.0

check arguments and if they wrong throw exeption

readme

Checkup

Check arguments and if they wrong throw exeption.

Install

npm i chukup --save

How to use?

var check   = require('checkup');

function someFn(arg1, arg2, arg3) {
    check({
        arg1: arg1,
        arg2, arg2
        arg3: arg3
    });
}

function showName(name, callback) {
    check(arguments, ['name'])
    .check(arguments, ['callback'])
    .type('name', name, 'string')
    .type('callback', callback, 'function');

    console.log('every thing is ok:', name);
}

function callCallback(callback) {
    check([callback], ['callback'])
    .type('callback', callback, 'function');

    callback();
}

License

MIT

changelog

2015.06.09, v1.3.0

feature:

  • (check) throwError -> throw Error

2015.06.09, v1.2.1

fix:

  • (check) throw Error -> throwError

2015.06.09, v1.2.0

feature:

  • (check) crash process when error occure

2015.06.09, v1.1.0

fix:

  • (chek) false positive when undefined in args

feature:

  • (check) add ability to take one parameter
  • (package) v1.0.3
  • (check) scope -> global

2015.01.19, v1.0.3

fix:

  • (chek) false positive when undefined in args

2014.11.24, v1.0.2

fix:

  • (package) checkup -> node-checkup

2014.11.24, v1.0.1

fix:

  • (checkup) Util -> check