UNPKG

@incdevco/framework

Version:
32 lines (18 loc) 503 B
var Promise = require('bluebird'); function ObjectValidator(config) { 'use strict'; config = config || {}; } ObjectValidator.prototype.validate = function (input, context) { 'use strict'; return Promise.try(function () { if (typeof input === 'object' && !Array.isArray(input) && input !== null && input !== undefined) { return true; } throw new Error('Must be a object.'); }) }; module.exports = ObjectValidator;