pendings
Version:
Better control of promises
21 lines (17 loc) • 712 B
JavaScript
/**
* Utils
* @private
*/
;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.removeUndefined = function (obj) {
if (obj && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object') {
Object.keys(obj).forEach(function (key) {
return obj[key] === undefined ? delete obj[key] : null;
});
}
return obj;
};
exports.mergeOptions = function (defaults, options) {
return Object.assign({}, defaults, exports.removeUndefined(options));
};