jellyfish-web/src/components/polyfills/objectassign.js

25 lines
887 B
JavaScript
Raw Normal View History

2019-05-05 23:55:42 +02:00
if (typeof Object.assign != 'function') {
(function () {
Object.assign = function (target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source !== undefined && source !== null) {
for (var nextKey in source) {
// eslint-disable-next-line no-prototype-builtins
2019-05-05 23:55:42 +02:00
if (source.hasOwnProperty(nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}