diff options
| author | Christian Cleberg <[email protected]> | 2026-04-18 22:32:53 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-18 22:32:53 -0500 |
| commit | 580e798e16346eb894eb899edac82d2efdf40adc (patch) | |
| tree | 6dec3b7db678f781138b40d34da37d21ac8fbe7d /node_modules/@babel/traverse/lib/cache.js | |
| download | brand-bench-580e798e16346eb894eb899edac82d2efdf40adc.tar.gz brand-bench-580e798e16346eb894eb899edac82d2efdf40adc.tar.bz2 brand-bench-580e798e16346eb894eb899edac82d2efdf40adc.zip | |
initial commit
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 |
