perambulate

1.0.1 • Public • Published

perambulate

Build Status

Simple function parameter validation for node.js.

Very simple variable validation. Simply pass an array of objects to parambulate and it will barf at the first one that breaks it.

Checks for array, object, number, string, boolean, null, undefined,function

Example call that validates

var name="Jethro Q. Walrustitty";
var votes=32108;

var result = perambulate([{'string':name},{'number':votes}]);

//result.failed_parameter === {}
//result.is_valid === true

Example call that doesn't validate

var name="Kevin Phillips-Bong";
var votes="fish";

var result = perambulate([{'string':name},{'number':votes}]);

//result.failed_parameter === {'number':votes};
//result.is_valid === false

Package Sidebar

Install

npm i perambulate

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • theewok