Skip to content

Commit

Permalink
refactor(cloneDeep): Refactoring cloneDeep (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi02014 authored Oct 17, 2024
1 parent 4b2de1f commit a78ad42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/object/cloneDeep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function cloneDeepImpl<T>(obj: T, stack = new Map<any, any>()): T {
const result = new Map();
stack.set(obj, result);

for (const [key, value] of obj.entries()) {
for (const [key, value] of obj) {
result.set(key, cloneDeepImpl(value, stack));
}

Expand All @@ -111,7 +111,7 @@ function cloneDeepImpl<T>(obj: T, stack = new Map<any, any>()): T {
const result = new Set();
stack.set(obj, result);

for (const value of obj.values()) {
for (const value of obj) {
result.add(cloneDeepImpl(value, stack));
}

Expand Down

0 comments on commit a78ad42

Please sign in to comment.