diff options
Diffstat (limited to 'node_modules/@babel/traverse/lib/cache.js')
| -rw-r--r-- | node_modules/@babel/traverse/lib/cache.js | 37 |
1 files changed, 37 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 0000000..1b4f743 --- /dev/null +++ b/node_modules/@babel/traverse/lib/cache.js @@ -0,0 +1,37 @@ +"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 = exports.path = new WeakMap(); +let scope = exports.scope = new WeakMap(); +function clear() { + clearPath(); + clearScope(); +} +function clearPath() { + exports.path = pathsCache = new WeakMap(); +} +function clearScope() { + exports.scope = scope = new WeakMap(); +} +function getCachedPaths(path) { + const { + parent, + parentPath + } = path; + return pathsCache.get(parent); +} +function getOrCreateCachedPaths(node, parentPath) { + let paths = pathsCache.get(node); + if (!paths) pathsCache.set(node, paths = new Map()); + return paths; +} + +//# sourceMappingURL=cache.js.map |
