@qelos/assets
Version:
manage assets like images and static files on remote servers
21 lines (19 loc) • 527 B
JavaScript
/**
* Validate that the given values are defined
* @private
* @param {object} parameters where each key value pair is the name and value of the argument to validate.
*
* @example
*
* function foo(bar){
* ensurePresenceOf({bar});
* // ...
* }
*/
function ensurePresenceOf(parameters) {
let missing = Object.keys(parameters).filter(key => parameters[key] === undefined);
if (missing.length) {
console.error(missing.join(',') + " cannot be undefined");
}
}
module.exports = ensurePresenceOf;