Add validation of onError callback object for rules.

This commit is contained in:
David Anson 2018-02-27 21:14:02 -08:00
parent 802c81f929
commit 7a752784f1
7 changed files with 107 additions and 12 deletions

View file

@ -46,6 +46,11 @@ module.exports.clone = function clone(obj) {
return assign({}, obj);
};
// Returns true iff the input is a number
module.exports.isNumber = function isNumber(obj) {
return typeof obj === "number";
};
// Returns true iff the input is a string
module.exports.isString = function isString(obj) {
return typeof obj === "string";