Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function extend() {
let args = toArray(arguments),
arg = args.shift();
if (objectAssign) {
return objectAssign.call(null, arg, ...args);
} else {
if (Object.assign) {
for (let i = 0; i < args.length; i++) {
arg = Object.assign(arg, args[i]);
}
return arg;
} else {
for (let i = 0; i < args.length; i++) {
prop(args[i], function (p) {
arg[p] = args[i][p];
});
}
return arg;
}
}
}
export function extend () {
let args = toArray(arguments),
arg = args.shift();
if (objectAssign) {
return objectAssign.call(null, arg, ...args);
} else {
if (Object.assign) {
for (let i = 0; i < args.length; i++ ) {
arg = Object.assign(arg, args[i]);
}
return arg;
} else {
for (let i = 0; i < args.length; i++ ) {
prop (args[i], function (p) {
arg[p] = args[i][p];
});
}
return arg;
}
}
}
export function extend (...argument: any[]): any {
let args = toArray(arguments),
arg = args.shift();
if (objectAssign) {
return objectAssign.call(null, arg, ...args);
} else {
if (Object.assign) {
for (let i = 0; i < args.length; i++ ) {
arg = Object.assign(arg, args[i]);
}
return arg;
} else {
for (let i = 0; i < args.length; i++ ) {
prop (args[i], function (p) {
arg[p] = args[i][p];
});
}
return arg;
}
}
}