mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
8 lines
289 B
TypeScript
8 lines
289 B
TypeScript
// Modified version of Object.assign() that prevents you from
|
|
// accidentally modifying the 'target' (first argument)
|
|
export function SafeObjectAssign(...args: any[]) {
|
|
const argsCopy: any[] = Array.from(arguments);
|
|
argsCopy.unshift({});
|
|
Object.assign.apply(null, argsCopy);
|
|
}
|