UNPKG

@incdevco/framework

Version:
29 lines (15 loc) 418 B
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;