Skip to content

Commit

Permalink
perf: augmentstubs perf
Browse files Browse the repository at this point in the history
  • Loading branch information
thesophiaxu committed Jan 13, 2022
1 parent d5c2a4d commit b6d76a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/unigraph-dev-common/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,12 @@ export function augmentStubs(objWithStubs: any, origObj: any) {
} else {
if (curr.uid && seen.includes(curr.uid)) return;
if (curr.uid) seen = [...seen, curr.uid];
if (curr.uid && uidDict[curr.uid] && JSON.stringify(curr, getCircularReplacer()).length < 100) {
if (
curr.uid &&
uidDict[curr.uid] &&
Object.keys(curr).length <= 2 &&
JSON.stringify(curr, getCircularReplacer()).length < 50
) {
_.merge(curr, uidDict[curr.uid], JSON.parse(JSON.stringify(curr)));
}
Object.keys(curr).forEach((el) => {
Expand Down

0 comments on commit b6d76a1

Please sign in to comment.