Skip to content

Commit 3b2486d

Browse files
committed
fix object extension
1 parent c4e6ead commit 3b2486d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: src/runtime/browser/util.inspect.polyfil.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -377,19 +377,18 @@ function reduceToSingleString(output: string[], base: string, braces: string[]):
377377
return braces[0] + (base === "" ? "" : base + "\n") + " " + output.join(",\n ") + " " + braces[1];
378378
}
379379

380-
function _extend(origin: object, add: object): object {
381-
const typedOrigin = { ...origin } as { [key: string]: unknown };
380+
function _extend(origin: object, add: object): void {
381+
const typedOrigin = origin as {[key: string]: unknown};
382382
// Don't do anything if add isn't an object
383-
if (!add || !isObject(add)) return origin;
383+
if (!add || !isObject(add)) return;
384384

385-
const clonedAdd = { ...add } as { [key: string]: unknown };
385+
const clonedAdd = {...add} as {[key: string]: unknown};
386386

387387
const keys = Object.keys(add);
388388
let i = keys.length;
389389
while (i--) {
390390
typedOrigin[keys[i]] = clonedAdd[keys[i]];
391391
}
392-
return typedOrigin;
393392
}
394393

395394
export function formatWithOptions(inspectOptions: InspectOptions, ...args: unknown[]) {

0 commit comments

Comments
 (0)