Skip to content

Commit

Permalink
Merge pull request #1171 from samchon/features/clone
Browse files Browse the repository at this point in the history
Enhance internal `$clone()` function to consider older NodeJS versions.
  • Loading branch information
samchon authored Jul 18, 2024
2 parents c208a50 + c376919 commit 628124c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functional/$clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const $cloneMain = (value: any): any => {
else if (value instanceof SharedArrayBuffer) return value.slice(0);
else if (value instanceof DataView)
return new DataView(value.buffer.slice(0));
else if (value instanceof File)
else if (typeof File !== "undefined" && value instanceof File)
return new File([value], value.name, { type: value.type });
else if (value instanceof Blob)
else if (typeof Blob !== "undefined" && value instanceof Blob)
return new Blob([value], { type: value.type });
else if (value instanceof Set) return new Set([...value].map($cloneMain));
else if (value instanceof Map)
Expand Down

0 comments on commit 628124c

Please sign in to comment.