Skip to content

Commit

Permalink
fix: transferSymbols nullish values
Browse files Browse the repository at this point in the history
  • Loading branch information
eliassjogreen committed Jun 3, 2024
1 parent e61f796 commit a076a9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions utils/transfer_symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* Transfer symbols and their values as is from {@link value} to {@link target}.
*/
export function transferSymbols<T>(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];
Expand Down

0 comments on commit a076a9a

Please sign in to comment.