bitburner-src/utils/SafeObjectAssign.ts

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);
}