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
|
Rev | Line | |
---|
[d565449] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.clear = clear;
|
---|
| 7 | exports.clearPath = clearPath;
|
---|
| 8 | exports.clearScope = clearScope;
|
---|
| 9 | exports.getCachedPaths = getCachedPaths;
|
---|
| 10 | exports.getOrCreateCachedPaths = getOrCreateCachedPaths;
|
---|
| 11 | exports.scope = exports.path = void 0;
|
---|
| 12 | let pathsCache = exports.path = new WeakMap();
|
---|
| 13 | let scope = exports.scope = new WeakMap();
|
---|
| 14 | function clear() {
|
---|
| 15 | clearPath();
|
---|
| 16 | clearScope();
|
---|
| 17 | }
|
---|
| 18 | function clearPath() {
|
---|
| 19 | exports.path = pathsCache = new WeakMap();
|
---|
| 20 | }
|
---|
| 21 | function clearScope() {
|
---|
| 22 | exports.scope = scope = new WeakMap();
|
---|
| 23 | }
|
---|
| 24 | const nullHub = Object.freeze({});
|
---|
| 25 | function 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 | }
|
---|
| 32 | function 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.