diff --git a/src/runtime/browser/util.inspect.polyfil.ts b/src/runtime/browser/util.inspect.polyfil.ts index 9f15b1f..f953176 100644 --- a/src/runtime/browser/util.inspect.polyfil.ts +++ b/src/runtime/browser/util.inspect.polyfil.ts @@ -377,19 +377,18 @@ function reduceToSingleString(output: string[], base: string, braces: string[]): return braces[0] + (base === "" ? "" : base + "\n") + " " + output.join(",\n ") + " " + braces[1]; } -function _extend(origin: object, add: object): object { - const typedOrigin = { ...origin } as { [key: string]: unknown }; +function _extend(origin: object, add: object): void { + const typedOrigin = origin as {[key: string]: unknown}; // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; + if (!add || !isObject(add)) return; - const clonedAdd = { ...add } as { [key: string]: unknown }; + const clonedAdd = {...add} as {[key: string]: unknown}; const keys = Object.keys(add); let i = keys.length; while (i--) { typedOrigin[keys[i]] = clonedAdd[keys[i]]; } - return typedOrigin; } export function formatWithOptions(inspectOptions: InspectOptions, ...args: unknown[]) {