1.0.1 • Published 10 years ago

perambulate v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

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