@incdevco/framework
Version:
node.js lambda framework
29 lines (15 loc) • 418 B
JavaScript
var Promise = require('bluebird');
function NumberValidator(config) {
'use strict';
config = config || {};
}
NumberValidator.prototype.validate = function (input, context) {
'use strict';
return Promise.try(function () {
if (typeof input !== 'number') {
throw new Error('Must be a number.');
}
return true;
})
};
module.exports = NumberValidator;