source: imaps-frontend/node_modules/@babel/traverse/lib/cache.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.clear = clear;
7exports.clearPath = clearPath;
8exports.clearScope = clearScope;
9exports.getCachedPaths = getCachedPaths;
10exports.getOrCreateCachedPaths = getOrCreateCachedPaths;
11exports.scope = exports.path = void 0;
12let pathsCache = exports.path = new WeakMap();
13let scope = exports.scope = new WeakMap();
14function clear() {
15 clearPath();
16 clearScope();
17}
18function clearPath() {
19 exports.path = pathsCache = new WeakMap();
20}
21function clearScope() {
22 exports.scope = scope = new WeakMap();
23}
24const nullHub = Object.freeze({});
25function getCachedPaths(hub, parent) {
26 var _pathsCache$get, _hub;
27 {
28 hub = null;
29 }
30 return (_pathsCache$get = pathsCache.get((_hub = hub) != null ? _hub : nullHub)) == null ? void 0 : _pathsCache$get.get(parent);
31}
32function getOrCreateCachedPaths(hub, parent) {
33 var _hub2, _hub3;
34 {
35 hub = null;
36 }
37 let parents = pathsCache.get((_hub2 = hub) != null ? _hub2 : nullHub);
38 if (!parents) pathsCache.set((_hub3 = hub) != null ? _hub3 : nullHub, parents = new WeakMap());
39 let paths = parents.get(parent);
40 if (!paths) parents.set(parent, paths = new Map());
41 return paths;
42}
43
44//# sourceMappingURL=cache.js.map
Note: See TracBrowser for help on using the repository browser.