Skip to content

Commit

Permalink
cache
Browse files Browse the repository at this point in the history
  • Loading branch information
straker committed Jun 29, 2023
1 parent d10bd0c commit 827fda8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/utils/clone.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const seen = new Map();
import cache from '../base/cache';

/**
* Deeply clones an object or array
Expand All @@ -23,6 +23,7 @@ export default function clone(obj, recursed) {
// handle circular references by caching the cloned object and returning it
// clear for every new call to clone so we don't return a cached value for
// a different object
const seen = cache.get('utils.clone', () => new Map());
if (!recursed) {
seen.clear();
}
Expand Down

0 comments on commit 827fda8

Please sign in to comment.