GT2/GT2-Android/node_modules/auth0-js/lib/assert_required.js

20 lines
270 B
JavaScript
Raw Normal View History

/**
* Expose `required`
*/
module.exports = required;
/**
* Assert `prop` as requirement of `obj`
*
* @param {Object} obj
* @param {prop} prop
* @public
*/
function required (obj, prop) {
if (!obj[prop]) {
throw new Error(prop + ' is required.');
}
}