diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:31:11 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:31:11 +0800 |
| commit | aa773172311dcada759dfbaac485f4bc6e00bc21 (patch) | |
| tree | ca6d9a5eff3ab8f689f9acb4f0df791d9486813d /node_modules/@babel/traverse/lib/cache.js | |
| parent | c5a5384e846f242e901e859fe600d695d8990a9a (diff) | |
added babel
Diffstat (limited to 'node_modules/@babel/traverse/lib/cache.js')
| -rw-r--r-- | node_modules/@babel/traverse/lib/cache.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/node_modules/@babel/traverse/lib/cache.js b/node_modules/@babel/traverse/lib/cache.js new file mode 100644 index 00000000..0455cfa0 --- /dev/null +++ b/node_modules/@babel/traverse/lib/cache.js @@ -0,0 +1,46 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.clear = clear; +exports.clearPath = clearPath; +exports.clearScope = clearScope; +exports.getCachedPaths = getCachedPaths; +exports.getOrCreateCachedPaths = getOrCreateCachedPaths; +exports.scope = exports.path = void 0; +let pathsCache = new WeakMap(); +exports.path = pathsCache; +let scope = new WeakMap(); +exports.scope = scope; +function clear() { + clearPath(); + clearScope(); +} +function clearPath() { + exports.path = pathsCache = new WeakMap(); +} +function clearScope() { + exports.scope = scope = new WeakMap(); +} +const nullHub = Object.freeze({}); +function getCachedPaths(hub, parent) { + var _pathsCache$get, _hub; + { + hub = null; + } + return (_pathsCache$get = pathsCache.get((_hub = hub) != null ? _hub : nullHub)) == null ? void 0 : _pathsCache$get.get(parent); +} +function getOrCreateCachedPaths(hub, parent) { + var _hub2, _hub3; + { + hub = null; + } + let parents = pathsCache.get((_hub2 = hub) != null ? _hub2 : nullHub); + if (!parents) pathsCache.set((_hub3 = hub) != null ? _hub3 : nullHub, parents = new WeakMap()); + let paths = parents.get(parent); + if (!paths) parents.set(parent, paths = new Map()); + return paths; +} + +//# sourceMappingURL=cache.js.map |
