pendings
Version:
Better control of promises
18 lines (14 loc) • 365 B
JavaScript
/**
* Utils
* @private
*/
;
exports.removeUndefined = function (obj) {
if (obj && typeof obj === 'object') {
Object.keys(obj).forEach(key => obj[key] === undefined ? delete obj[key] : null);
}
return obj;
};
exports.mergeOptions = function (defaults, options) {
return Object.assign({}, defaults, exports.removeUndefined(options));
};