Skip to content

Commit c21f39c

Browse files
fix: revert changes of stop-184 (#147)
* fix: Optimised code for performance * fix: changes in logic for resolve test case issue * fix: performance issue for decycle * fix(build): fixing module build * fix: reverting changes for 184
1 parent 38fdc62 commit c21f39c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/decycle.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { pathToPointer } from './pathToPointer';
33

44
export const decycle = (obj: unknown, replacer?: (value: any) => any) => {
55
const objs = new WeakMap<object, string>();
6-
const processedObjs = new WeakSet<object>();
7-
86
return (function derez(value: any, path: string[]) {
97
// The new object or array
108
let curObj: any;
@@ -30,10 +28,7 @@ export const decycle = (obj: unknown, replacer?: (value: any) => any) => {
3028
curObj[name] = derez(value[name], [...path, name]);
3129
});
3230
}
33-
if (!processedObjs.has(value)) {
34-
objs.delete(value);
35-
}
36-
processedObjs.add(value);
31+
objs.delete(value);
3732
return curObj;
3833
}
3934
return value;

0 commit comments

Comments
 (0)