UNPKG

@incdevco/framework

Version:
29 lines (15 loc) 418 B
var Promise = require('bluebird'); function StringValidator(config) { 'use strict'; config = config || {}; } StringValidator.prototype.validate = function (input, context) { 'use strict'; return Promise.try(function () { if (typeof input !== 'string') { throw new Error('Must be a string.'); } return true; }) }; module.exports = StringValidator;