diff --git a/deno.json b/deno.json index 0adb412..774940b 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@denosaurs/log", - "version": "0.0.15", + "version": "0.0.16", "exports": { ".": "./mod.ts", "./utils/noop_console": "./utils/noop_console.ts", diff --git a/utils/transfer_symbols.ts b/utils/transfer_symbols.ts index 2e31733..3e65f20 100644 --- a/utils/transfer_symbols.ts +++ b/utils/transfer_symbols.ts @@ -2,10 +2,10 @@ * Transfer symbols and their values as is from {@link value} to {@link target}. */ export function transferSymbols(value: T, target: T): T { - const properties = Object.getOwnPropertyNames( - value, - ) as (keyof typeof value)[]; - const symbols = Object.getOwnPropertySymbols(value) as (keyof typeof value)[]; + if (value === null || value === undefined) return target; + + const properties = Object.getOwnPropertyNames(value) as (keyof T)[]; + const symbols = Object.getOwnPropertySymbols(value) as (keyof T)[]; for (const property of properties) { const entry = value[property];