@slicemachine/adapter-next 0.3.85-beta.2 → 0.3.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/_node_modules/lru-cache/index.cjs +267 -0
  2. package/dist/_node_modules/lru-cache/index.cjs.map +1 -0
  3. package/dist/_node_modules/lru-cache/index.js +267 -0
  4. package/dist/_node_modules/lru-cache/index.js.map +1 -0
  5. package/dist/_node_modules/yallist/iterator.cjs +18 -0
  6. package/dist/_node_modules/yallist/iterator.cjs.map +1 -0
  7. package/dist/_node_modules/yallist/iterator.js +18 -0
  8. package/dist/_node_modules/yallist/iterator.js.map +1 -0
  9. package/dist/_node_modules/yallist/yallist.cjs +367 -0
  10. package/dist/_node_modules/yallist/yallist.cjs.map +1 -0
  11. package/dist/_node_modules/yallist/yallist.js +367 -0
  12. package/dist/_node_modules/yallist/yallist.js.map +1 -0
  13. package/dist/_virtual/_commonjsHelpers.cjs +7 -0
  14. package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
  15. package/dist/_virtual/_commonjsHelpers.js +7 -0
  16. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  17. package/dist/_virtual/re.cjs +5 -0
  18. package/dist/_virtual/re.cjs.map +1 -0
  19. package/dist/_virtual/re.js +5 -0
  20. package/dist/_virtual/re.js.map +1 -0
  21. package/dist/hooks/project-init.cjs +5 -1
  22. package/dist/hooks/project-init.cjs.map +1 -1
  23. package/dist/hooks/project-init.js +5 -1
  24. package/dist/hooks/project-init.js.map +1 -1
  25. package/dist/lib/getNextJSVersion.cjs +34 -0
  26. package/dist/lib/getNextJSVersion.cjs.map +1 -0
  27. package/dist/lib/getNextJSVersion.d.ts +1 -0
  28. package/dist/lib/getNextJSVersion.js +12 -0
  29. package/dist/lib/getNextJSVersion.js.map +1 -0
  30. package/dist/lib/requireResolve.cjs +16 -0
  31. package/dist/lib/requireResolve.cjs.map +1 -0
  32. package/dist/lib/requireResolve.d.ts +10 -0
  33. package/dist/lib/requireResolve.js +16 -0
  34. package/dist/lib/requireResolve.js.map +1 -0
  35. package/dist/packages/adapter-next/_node_modules/semver/classes/comparator.cjs +122 -0
  36. package/dist/packages/adapter-next/_node_modules/semver/classes/comparator.cjs.map +1 -0
  37. package/dist/packages/adapter-next/_node_modules/semver/classes/comparator.js +122 -0
  38. package/dist/packages/adapter-next/_node_modules/semver/classes/comparator.js.map +1 -0
  39. package/dist/packages/adapter-next/_node_modules/semver/classes/range.cjs +373 -0
  40. package/dist/packages/adapter-next/_node_modules/semver/classes/range.cjs.map +1 -0
  41. package/dist/packages/adapter-next/_node_modules/semver/classes/range.js +373 -0
  42. package/dist/packages/adapter-next/_node_modules/semver/classes/range.js.map +1 -0
  43. package/dist/packages/adapter-next/_node_modules/semver/classes/semver.cjs +243 -0
  44. package/dist/packages/adapter-next/_node_modules/semver/classes/semver.cjs.map +1 -0
  45. package/dist/packages/adapter-next/_node_modules/semver/classes/semver.js +243 -0
  46. package/dist/packages/adapter-next/_node_modules/semver/classes/semver.js.map +1 -0
  47. package/dist/packages/adapter-next/_node_modules/semver/functions/clean.cjs +11 -0
  48. package/dist/packages/adapter-next/_node_modules/semver/functions/clean.cjs.map +1 -0
  49. package/dist/packages/adapter-next/_node_modules/semver/functions/clean.js +11 -0
  50. package/dist/packages/adapter-next/_node_modules/semver/functions/clean.js.map +1 -0
  51. package/dist/packages/adapter-next/_node_modules/semver/functions/cmp.cjs +53 -0
  52. package/dist/packages/adapter-next/_node_modules/semver/functions/cmp.cjs.map +1 -0
  53. package/dist/packages/adapter-next/_node_modules/semver/functions/cmp.js +53 -0
  54. package/dist/packages/adapter-next/_node_modules/semver/functions/cmp.js.map +1 -0
  55. package/dist/packages/adapter-next/_node_modules/semver/functions/coerce.cjs +40 -0
  56. package/dist/packages/adapter-next/_node_modules/semver/functions/coerce.cjs.map +1 -0
  57. package/dist/packages/adapter-next/_node_modules/semver/functions/coerce.js +40 -0
  58. package/dist/packages/adapter-next/_node_modules/semver/functions/coerce.js.map +1 -0
  59. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-build.cjs +12 -0
  60. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-build.cjs.map +1 -0
  61. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-build.js +12 -0
  62. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-build.js.map +1 -0
  63. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-loose.cjs +8 -0
  64. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-loose.cjs.map +1 -0
  65. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-loose.js +8 -0
  66. package/dist/packages/adapter-next/_node_modules/semver/functions/compare-loose.js.map +1 -0
  67. package/dist/packages/adapter-next/_node_modules/semver/functions/compare.cjs +8 -0
  68. package/dist/packages/adapter-next/_node_modules/semver/functions/compare.cjs.map +1 -0
  69. package/dist/packages/adapter-next/_node_modules/semver/functions/compare.js +8 -0
  70. package/dist/packages/adapter-next/_node_modules/semver/functions/compare.js.map +1 -0
  71. package/dist/packages/adapter-next/_node_modules/semver/functions/diff.cjs +39 -0
  72. package/dist/packages/adapter-next/_node_modules/semver/functions/diff.cjs.map +1 -0
  73. package/dist/packages/adapter-next/_node_modules/semver/functions/diff.js +39 -0
  74. package/dist/packages/adapter-next/_node_modules/semver/functions/diff.js.map +1 -0
  75. package/dist/packages/adapter-next/_node_modules/semver/functions/eq.cjs +8 -0
  76. package/dist/packages/adapter-next/_node_modules/semver/functions/eq.cjs.map +1 -0
  77. package/dist/packages/adapter-next/_node_modules/semver/functions/eq.js +8 -0
  78. package/dist/packages/adapter-next/_node_modules/semver/functions/eq.js.map +1 -0
  79. package/dist/packages/adapter-next/_node_modules/semver/functions/gt.cjs +8 -0
  80. package/dist/packages/adapter-next/_node_modules/semver/functions/gt.cjs.map +1 -0
  81. package/dist/packages/adapter-next/_node_modules/semver/functions/gt.js +8 -0
  82. package/dist/packages/adapter-next/_node_modules/semver/functions/gt.js.map +1 -0
  83. package/dist/packages/adapter-next/_node_modules/semver/functions/gte.cjs +8 -0
  84. package/dist/packages/adapter-next/_node_modules/semver/functions/gte.cjs.map +1 -0
  85. package/dist/packages/adapter-next/_node_modules/semver/functions/gte.js +8 -0
  86. package/dist/packages/adapter-next/_node_modules/semver/functions/gte.js.map +1 -0
  87. package/dist/packages/adapter-next/_node_modules/semver/functions/inc.cjs +22 -0
  88. package/dist/packages/adapter-next/_node_modules/semver/functions/inc.cjs.map +1 -0
  89. package/dist/packages/adapter-next/_node_modules/semver/functions/inc.js +22 -0
  90. package/dist/packages/adapter-next/_node_modules/semver/functions/inc.js.map +1 -0
  91. package/dist/packages/adapter-next/_node_modules/semver/functions/lt.cjs +8 -0
  92. package/dist/packages/adapter-next/_node_modules/semver/functions/lt.cjs.map +1 -0
  93. package/dist/packages/adapter-next/_node_modules/semver/functions/lt.js +8 -0
  94. package/dist/packages/adapter-next/_node_modules/semver/functions/lt.js.map +1 -0
  95. package/dist/packages/adapter-next/_node_modules/semver/functions/lte.cjs +8 -0
  96. package/dist/packages/adapter-next/_node_modules/semver/functions/lte.cjs.map +1 -0
  97. package/dist/packages/adapter-next/_node_modules/semver/functions/lte.js +8 -0
  98. package/dist/packages/adapter-next/_node_modules/semver/functions/lte.js.map +1 -0
  99. package/dist/packages/adapter-next/_node_modules/semver/functions/major.cjs +8 -0
  100. package/dist/packages/adapter-next/_node_modules/semver/functions/major.cjs.map +1 -0
  101. package/dist/packages/adapter-next/_node_modules/semver/functions/major.js +8 -0
  102. package/dist/packages/adapter-next/_node_modules/semver/functions/major.js.map +1 -0
  103. package/dist/packages/adapter-next/_node_modules/semver/functions/minor.cjs +8 -0
  104. package/dist/packages/adapter-next/_node_modules/semver/functions/minor.cjs.map +1 -0
  105. package/dist/packages/adapter-next/_node_modules/semver/functions/minor.js +8 -0
  106. package/dist/packages/adapter-next/_node_modules/semver/functions/minor.js.map +1 -0
  107. package/dist/packages/adapter-next/_node_modules/semver/functions/neq.cjs +8 -0
  108. package/dist/packages/adapter-next/_node_modules/semver/functions/neq.cjs.map +1 -0
  109. package/dist/packages/adapter-next/_node_modules/semver/functions/neq.js +8 -0
  110. package/dist/packages/adapter-next/_node_modules/semver/functions/neq.js.map +1 -0
  111. package/dist/packages/adapter-next/_node_modules/semver/functions/parse.cjs +20 -0
  112. package/dist/packages/adapter-next/_node_modules/semver/functions/parse.cjs.map +1 -0
  113. package/dist/packages/adapter-next/_node_modules/semver/functions/parse.js +20 -0
  114. package/dist/packages/adapter-next/_node_modules/semver/functions/parse.js.map +1 -0
  115. package/dist/packages/adapter-next/_node_modules/semver/functions/patch.cjs +8 -0
  116. package/dist/packages/adapter-next/_node_modules/semver/functions/patch.cjs.map +1 -0
  117. package/dist/packages/adapter-next/_node_modules/semver/functions/patch.js +8 -0
  118. package/dist/packages/adapter-next/_node_modules/semver/functions/patch.js.map +1 -0
  119. package/dist/packages/adapter-next/_node_modules/semver/functions/prerelease.cjs +11 -0
  120. package/dist/packages/adapter-next/_node_modules/semver/functions/prerelease.cjs.map +1 -0
  121. package/dist/packages/adapter-next/_node_modules/semver/functions/prerelease.js +11 -0
  122. package/dist/packages/adapter-next/_node_modules/semver/functions/prerelease.js.map +1 -0
  123. package/dist/packages/adapter-next/_node_modules/semver/functions/rcompare.cjs +8 -0
  124. package/dist/packages/adapter-next/_node_modules/semver/functions/rcompare.cjs.map +1 -0
  125. package/dist/packages/adapter-next/_node_modules/semver/functions/rcompare.js +8 -0
  126. package/dist/packages/adapter-next/_node_modules/semver/functions/rcompare.js.map +1 -0
  127. package/dist/packages/adapter-next/_node_modules/semver/functions/rsort.cjs +8 -0
  128. package/dist/packages/adapter-next/_node_modules/semver/functions/rsort.cjs.map +1 -0
  129. package/dist/packages/adapter-next/_node_modules/semver/functions/rsort.js +8 -0
  130. package/dist/packages/adapter-next/_node_modules/semver/functions/rsort.js.map +1 -0
  131. package/dist/packages/adapter-next/_node_modules/semver/functions/satisfies.cjs +15 -0
  132. package/dist/packages/adapter-next/_node_modules/semver/functions/satisfies.cjs.map +1 -0
  133. package/dist/packages/adapter-next/_node_modules/semver/functions/satisfies.js +15 -0
  134. package/dist/packages/adapter-next/_node_modules/semver/functions/satisfies.js.map +1 -0
  135. package/dist/packages/adapter-next/_node_modules/semver/functions/sort.cjs +8 -0
  136. package/dist/packages/adapter-next/_node_modules/semver/functions/sort.cjs.map +1 -0
  137. package/dist/packages/adapter-next/_node_modules/semver/functions/sort.js +8 -0
  138. package/dist/packages/adapter-next/_node_modules/semver/functions/sort.js.map +1 -0
  139. package/dist/packages/adapter-next/_node_modules/semver/functions/valid.cjs +11 -0
  140. package/dist/packages/adapter-next/_node_modules/semver/functions/valid.cjs.map +1 -0
  141. package/dist/packages/adapter-next/_node_modules/semver/functions/valid.js +11 -0
  142. package/dist/packages/adapter-next/_node_modules/semver/functions/valid.js.map +1 -0
  143. package/dist/packages/adapter-next/_node_modules/semver/index.cjs +134 -0
  144. package/dist/packages/adapter-next/_node_modules/semver/index.cjs.map +1 -0
  145. package/dist/packages/adapter-next/_node_modules/semver/index.js +135 -0
  146. package/dist/packages/adapter-next/_node_modules/semver/index.js.map +1 -0
  147. package/dist/packages/adapter-next/_node_modules/semver/internal/constants.cjs +27 -0
  148. package/dist/packages/adapter-next/_node_modules/semver/internal/constants.cjs.map +1 -0
  149. package/dist/packages/adapter-next/_node_modules/semver/internal/constants.js +27 -0
  150. package/dist/packages/adapter-next/_node_modules/semver/internal/constants.js.map +1 -0
  151. package/dist/packages/adapter-next/_node_modules/semver/internal/debug.cjs +7 -0
  152. package/dist/packages/adapter-next/_node_modules/semver/internal/debug.cjs.map +1 -0
  153. package/dist/packages/adapter-next/_node_modules/semver/internal/debug.js +7 -0
  154. package/dist/packages/adapter-next/_node_modules/semver/internal/debug.js.map +1 -0
  155. package/dist/packages/adapter-next/_node_modules/semver/internal/identifiers.cjs +19 -0
  156. package/dist/packages/adapter-next/_node_modules/semver/internal/identifiers.cjs.map +1 -0
  157. package/dist/packages/adapter-next/_node_modules/semver/internal/identifiers.js +19 -0
  158. package/dist/packages/adapter-next/_node_modules/semver/internal/identifiers.js.map +1 -0
  159. package/dist/packages/adapter-next/_node_modules/semver/internal/parse-options.cjs +16 -0
  160. package/dist/packages/adapter-next/_node_modules/semver/internal/parse-options.cjs.map +1 -0
  161. package/dist/packages/adapter-next/_node_modules/semver/internal/parse-options.js +16 -0
  162. package/dist/packages/adapter-next/_node_modules/semver/internal/parse-options.js.map +1 -0
  163. package/dist/packages/adapter-next/_node_modules/semver/internal/re.cjs +67 -0
  164. package/dist/packages/adapter-next/_node_modules/semver/internal/re.cjs.map +1 -0
  165. package/dist/packages/adapter-next/_node_modules/semver/internal/re.js +67 -0
  166. package/dist/packages/adapter-next/_node_modules/semver/internal/re.js.map +1 -0
  167. package/dist/packages/adapter-next/_node_modules/semver/ranges/gtr.cjs +8 -0
  168. package/dist/packages/adapter-next/_node_modules/semver/ranges/gtr.cjs.map +1 -0
  169. package/dist/packages/adapter-next/_node_modules/semver/ranges/gtr.js +8 -0
  170. package/dist/packages/adapter-next/_node_modules/semver/ranges/gtr.js.map +1 -0
  171. package/dist/packages/adapter-next/_node_modules/semver/ranges/intersects.cjs +12 -0
  172. package/dist/packages/adapter-next/_node_modules/semver/ranges/intersects.cjs.map +1 -0
  173. package/dist/packages/adapter-next/_node_modules/semver/ranges/intersects.js +12 -0
  174. package/dist/packages/adapter-next/_node_modules/semver/ranges/intersects.js.map +1 -0
  175. package/dist/packages/adapter-next/_node_modules/semver/ranges/ltr.cjs +8 -0
  176. package/dist/packages/adapter-next/_node_modules/semver/ranges/ltr.cjs.map +1 -0
  177. package/dist/packages/adapter-next/_node_modules/semver/ranges/ltr.js +8 -0
  178. package/dist/packages/adapter-next/_node_modules/semver/ranges/ltr.js.map +1 -0
  179. package/dist/packages/adapter-next/_node_modules/semver/ranges/max-satisfying.cjs +28 -0
  180. package/dist/packages/adapter-next/_node_modules/semver/ranges/max-satisfying.cjs.map +1 -0
  181. package/dist/packages/adapter-next/_node_modules/semver/ranges/max-satisfying.js +28 -0
  182. package/dist/packages/adapter-next/_node_modules/semver/ranges/max-satisfying.js.map +1 -0
  183. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-satisfying.cjs +28 -0
  184. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-satisfying.cjs.map +1 -0
  185. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-satisfying.js +28 -0
  186. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-satisfying.js.map +1 -0
  187. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-version.cjs +57 -0
  188. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-version.cjs.map +1 -0
  189. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-version.js +57 -0
  190. package/dist/packages/adapter-next/_node_modules/semver/ranges/min-version.js.map +1 -0
  191. package/dist/packages/adapter-next/_node_modules/semver/ranges/outside.cjs +74 -0
  192. package/dist/packages/adapter-next/_node_modules/semver/ranges/outside.cjs.map +1 -0
  193. package/dist/packages/adapter-next/_node_modules/semver/ranges/outside.js +74 -0
  194. package/dist/packages/adapter-next/_node_modules/semver/ranges/outside.js.map +1 -0
  195. package/dist/packages/adapter-next/_node_modules/semver/ranges/simplify.cjs +49 -0
  196. package/dist/packages/adapter-next/_node_modules/semver/ranges/simplify.cjs.map +1 -0
  197. package/dist/packages/adapter-next/_node_modules/semver/ranges/simplify.js +49 -0
  198. package/dist/packages/adapter-next/_node_modules/semver/ranges/simplify.js.map +1 -0
  199. package/dist/packages/adapter-next/_node_modules/semver/ranges/subset.cjs +163 -0
  200. package/dist/packages/adapter-next/_node_modules/semver/ranges/subset.cjs.map +1 -0
  201. package/dist/packages/adapter-next/_node_modules/semver/ranges/subset.js +163 -0
  202. package/dist/packages/adapter-next/_node_modules/semver/ranges/subset.js.map +1 -0
  203. package/dist/packages/adapter-next/_node_modules/semver/ranges/to-comparators.cjs +8 -0
  204. package/dist/packages/adapter-next/_node_modules/semver/ranges/to-comparators.cjs.map +1 -0
  205. package/dist/packages/adapter-next/_node_modules/semver/ranges/to-comparators.js +8 -0
  206. package/dist/packages/adapter-next/_node_modules/semver/ranges/to-comparators.js.map +1 -0
  207. package/dist/packages/adapter-next/_node_modules/semver/ranges/valid.cjs +14 -0
  208. package/dist/packages/adapter-next/_node_modules/semver/ranges/valid.cjs.map +1 -0
  209. package/dist/packages/adapter-next/_node_modules/semver/ranges/valid.js +14 -0
  210. package/dist/packages/adapter-next/_node_modules/semver/ranges/valid.js.map +1 -0
  211. package/dist/plugin.cjs +1 -1
  212. package/dist/plugin.js +1 -1
  213. package/package.json +7 -8
  214. package/src/hooks/project-init.ts +6 -1
  215. package/src/lib/getNextJSVersion.ts +16 -0
  216. package/src/lib/requireResolve.ts +30 -0
  217. /package/dist/{package.json.cjs → packages/adapter-next/package.json.cjs} +0 -0
  218. /package/dist/{package.json.cjs.map → packages/adapter-next/package.json.cjs.map} +0 -0
  219. /package/dist/{package.json.js → packages/adapter-next/package.json.js} +0 -0
  220. /package/dist/{package.json.js.map → packages/adapter-next/package.json.js.map} +0 -0
@@ -0,0 +1,267 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const yallist = require("../yallist/yallist.cjs");
4
+ const Yallist = yallist.yallist;
5
+ const MAX = Symbol("max");
6
+ const LENGTH = Symbol("length");
7
+ const LENGTH_CALCULATOR = Symbol("lengthCalculator");
8
+ const ALLOW_STALE = Symbol("allowStale");
9
+ const MAX_AGE = Symbol("maxAge");
10
+ const DISPOSE = Symbol("dispose");
11
+ const NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
12
+ const LRU_LIST = Symbol("lruList");
13
+ const CACHE = Symbol("cache");
14
+ const UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
15
+ const naiveLength = () => 1;
16
+ class LRUCache {
17
+ constructor(options) {
18
+ if (typeof options === "number")
19
+ options = { max: options };
20
+ if (!options)
21
+ options = {};
22
+ if (options.max && (typeof options.max !== "number" || options.max < 0))
23
+ throw new TypeError("max must be a non-negative number");
24
+ this[MAX] = options.max || Infinity;
25
+ const lc = options.length || naiveLength;
26
+ this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
27
+ this[ALLOW_STALE] = options.stale || false;
28
+ if (options.maxAge && typeof options.maxAge !== "number")
29
+ throw new TypeError("maxAge must be a number");
30
+ this[MAX_AGE] = options.maxAge || 0;
31
+ this[DISPOSE] = options.dispose;
32
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
33
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
34
+ this.reset();
35
+ }
36
+ // resize the cache when the max changes.
37
+ set max(mL) {
38
+ if (typeof mL !== "number" || mL < 0)
39
+ throw new TypeError("max must be a non-negative number");
40
+ this[MAX] = mL || Infinity;
41
+ trim(this);
42
+ }
43
+ get max() {
44
+ return this[MAX];
45
+ }
46
+ set allowStale(allowStale) {
47
+ this[ALLOW_STALE] = !!allowStale;
48
+ }
49
+ get allowStale() {
50
+ return this[ALLOW_STALE];
51
+ }
52
+ set maxAge(mA) {
53
+ if (typeof mA !== "number")
54
+ throw new TypeError("maxAge must be a non-negative number");
55
+ this[MAX_AGE] = mA;
56
+ trim(this);
57
+ }
58
+ get maxAge() {
59
+ return this[MAX_AGE];
60
+ }
61
+ // resize the cache when the lengthCalculator changes.
62
+ set lengthCalculator(lC) {
63
+ if (typeof lC !== "function")
64
+ lC = naiveLength;
65
+ if (lC !== this[LENGTH_CALCULATOR]) {
66
+ this[LENGTH_CALCULATOR] = lC;
67
+ this[LENGTH] = 0;
68
+ this[LRU_LIST].forEach((hit) => {
69
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
70
+ this[LENGTH] += hit.length;
71
+ });
72
+ }
73
+ trim(this);
74
+ }
75
+ get lengthCalculator() {
76
+ return this[LENGTH_CALCULATOR];
77
+ }
78
+ get length() {
79
+ return this[LENGTH];
80
+ }
81
+ get itemCount() {
82
+ return this[LRU_LIST].length;
83
+ }
84
+ rforEach(fn, thisp) {
85
+ thisp = thisp || this;
86
+ for (let walker = this[LRU_LIST].tail; walker !== null; ) {
87
+ const prev = walker.prev;
88
+ forEachStep(this, fn, walker, thisp);
89
+ walker = prev;
90
+ }
91
+ }
92
+ forEach(fn, thisp) {
93
+ thisp = thisp || this;
94
+ for (let walker = this[LRU_LIST].head; walker !== null; ) {
95
+ const next = walker.next;
96
+ forEachStep(this, fn, walker, thisp);
97
+ walker = next;
98
+ }
99
+ }
100
+ keys() {
101
+ return this[LRU_LIST].toArray().map((k) => k.key);
102
+ }
103
+ values() {
104
+ return this[LRU_LIST].toArray().map((k) => k.value);
105
+ }
106
+ reset() {
107
+ if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
108
+ this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
109
+ }
110
+ this[CACHE] = /* @__PURE__ */ new Map();
111
+ this[LRU_LIST] = new Yallist();
112
+ this[LENGTH] = 0;
113
+ }
114
+ dump() {
115
+ return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
116
+ k: hit.key,
117
+ v: hit.value,
118
+ e: hit.now + (hit.maxAge || 0)
119
+ }).toArray().filter((h) => h);
120
+ }
121
+ dumpLru() {
122
+ return this[LRU_LIST];
123
+ }
124
+ set(key, value, maxAge) {
125
+ maxAge = maxAge || this[MAX_AGE];
126
+ if (maxAge && typeof maxAge !== "number")
127
+ throw new TypeError("maxAge must be a number");
128
+ const now = maxAge ? Date.now() : 0;
129
+ const len = this[LENGTH_CALCULATOR](value, key);
130
+ if (this[CACHE].has(key)) {
131
+ if (len > this[MAX]) {
132
+ del(this, this[CACHE].get(key));
133
+ return false;
134
+ }
135
+ const node = this[CACHE].get(key);
136
+ const item = node.value;
137
+ if (this[DISPOSE]) {
138
+ if (!this[NO_DISPOSE_ON_SET])
139
+ this[DISPOSE](key, item.value);
140
+ }
141
+ item.now = now;
142
+ item.maxAge = maxAge;
143
+ item.value = value;
144
+ this[LENGTH] += len - item.length;
145
+ item.length = len;
146
+ this.get(key);
147
+ trim(this);
148
+ return true;
149
+ }
150
+ const hit = new Entry(key, value, len, now, maxAge);
151
+ if (hit.length > this[MAX]) {
152
+ if (this[DISPOSE])
153
+ this[DISPOSE](key, value);
154
+ return false;
155
+ }
156
+ this[LENGTH] += hit.length;
157
+ this[LRU_LIST].unshift(hit);
158
+ this[CACHE].set(key, this[LRU_LIST].head);
159
+ trim(this);
160
+ return true;
161
+ }
162
+ has(key) {
163
+ if (!this[CACHE].has(key)) return false;
164
+ const hit = this[CACHE].get(key).value;
165
+ return !isStale(this, hit);
166
+ }
167
+ get(key) {
168
+ return get(this, key, true);
169
+ }
170
+ peek(key) {
171
+ return get(this, key, false);
172
+ }
173
+ pop() {
174
+ const node = this[LRU_LIST].tail;
175
+ if (!node)
176
+ return null;
177
+ del(this, node);
178
+ return node.value;
179
+ }
180
+ del(key) {
181
+ del(this, this[CACHE].get(key));
182
+ }
183
+ load(arr) {
184
+ this.reset();
185
+ const now = Date.now();
186
+ for (let l = arr.length - 1; l >= 0; l--) {
187
+ const hit = arr[l];
188
+ const expiresAt = hit.e || 0;
189
+ if (expiresAt === 0)
190
+ this.set(hit.k, hit.v);
191
+ else {
192
+ const maxAge = expiresAt - now;
193
+ if (maxAge > 0) {
194
+ this.set(hit.k, hit.v, maxAge);
195
+ }
196
+ }
197
+ }
198
+ }
199
+ prune() {
200
+ this[CACHE].forEach((value, key) => get(this, key, false));
201
+ }
202
+ }
203
+ const get = (self, key, doUse) => {
204
+ const node = self[CACHE].get(key);
205
+ if (node) {
206
+ const hit = node.value;
207
+ if (isStale(self, hit)) {
208
+ del(self, node);
209
+ if (!self[ALLOW_STALE])
210
+ return void 0;
211
+ } else {
212
+ if (doUse) {
213
+ if (self[UPDATE_AGE_ON_GET])
214
+ node.value.now = Date.now();
215
+ self[LRU_LIST].unshiftNode(node);
216
+ }
217
+ }
218
+ return hit.value;
219
+ }
220
+ };
221
+ const isStale = (self, hit) => {
222
+ if (!hit || !hit.maxAge && !self[MAX_AGE])
223
+ return false;
224
+ const diff = Date.now() - hit.now;
225
+ return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
226
+ };
227
+ const trim = (self) => {
228
+ if (self[LENGTH] > self[MAX]) {
229
+ for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
230
+ const prev = walker.prev;
231
+ del(self, walker);
232
+ walker = prev;
233
+ }
234
+ }
235
+ };
236
+ const del = (self, node) => {
237
+ if (node) {
238
+ const hit = node.value;
239
+ if (self[DISPOSE])
240
+ self[DISPOSE](hit.key, hit.value);
241
+ self[LENGTH] -= hit.length;
242
+ self[CACHE].delete(hit.key);
243
+ self[LRU_LIST].removeNode(node);
244
+ }
245
+ };
246
+ class Entry {
247
+ constructor(key, value, length, now, maxAge) {
248
+ this.key = key;
249
+ this.value = value;
250
+ this.length = length;
251
+ this.now = now;
252
+ this.maxAge = maxAge || 0;
253
+ }
254
+ }
255
+ const forEachStep = (self, fn, node, thisp) => {
256
+ let hit = node.value;
257
+ if (isStale(self, hit)) {
258
+ del(self, node);
259
+ if (!self[ALLOW_STALE])
260
+ hit = void 0;
261
+ }
262
+ if (hit)
263
+ fn.call(thisp, hit.value, hit.key, self);
264
+ };
265
+ var lruCache = LRUCache;
266
+ exports.lruCache = lruCache;
267
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../../../../node_modules/lru-cache/index.js"],"sourcesContent":["'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n"],"names":["require$$0"],"mappings":";;;AAGA,MAAM,UAAUA,QAAAA;AAEhB,MAAM,MAAM,OAAO,KAAK;AACxB,MAAM,SAAS,OAAO,QAAQ;AAC9B,MAAM,oBAAoB,OAAO,kBAAkB;AACnD,MAAM,cAAc,OAAO,YAAY;AACvC,MAAM,UAAU,OAAO,QAAQ;AAC/B,MAAM,UAAU,OAAO,SAAS;AAChC,MAAM,oBAAoB,OAAO,gBAAgB;AACjD,MAAM,WAAW,OAAO,SAAS;AACjC,MAAM,QAAQ,OAAO,OAAO;AAC5B,MAAM,oBAAoB,OAAO,gBAAgB;AAEjD,MAAM,cAAc,MAAM;AAU1B,MAAM,SAAS;AAAA,EACb,YAAa,SAAS;AACpB,QAAI,OAAO,YAAY;AACrB,gBAAU,EAAE,KAAK,QAAO;AAE1B,QAAI,CAAC;AACH,gBAAU,CAAA;AAEZ,QAAI,QAAQ,QAAQ,OAAO,QAAQ,QAAQ,YAAY,QAAQ,MAAM;AACnE,YAAM,IAAI,UAAU,mCAAmC;AAE7C,SAAK,GAAG,IAAI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K,MAAM;AACX,SAAK,QAAQ;AACb,SAAK,SAAS;AACd,SAAK,MAAM;AACX,SAAK,SAAS,UAAU;AAAA,EAC5B;AACA;AAEA,MAAM,cAAc,CAAC,MAAM,IAAI,MAAM,UAAU;AAC7C,MAAI,MAAM,KAAK;AACf,MAAI,QAAQ,MAAM,GAAG,GAAG;AACtB,QAAI,MAAM,IAAI;AACd,QAAI,CAAC,KAAK,WAAW;AACnB,YAAM;AAAA,EACZ;AACE,MAAI;AACF,OAAG,KAAK,OAAO,IAAI,OAAO,IAAI,KAAK,IAAI;AAC3C;AAEA,IAAA,WAAiB;;","x_google_ignoreList":[0]}
@@ -0,0 +1,267 @@
1
+ import { y as yallist } from "../yallist/yallist.js";
2
+ const Yallist = yallist;
3
+ const MAX = Symbol("max");
4
+ const LENGTH = Symbol("length");
5
+ const LENGTH_CALCULATOR = Symbol("lengthCalculator");
6
+ const ALLOW_STALE = Symbol("allowStale");
7
+ const MAX_AGE = Symbol("maxAge");
8
+ const DISPOSE = Symbol("dispose");
9
+ const NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
10
+ const LRU_LIST = Symbol("lruList");
11
+ const CACHE = Symbol("cache");
12
+ const UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
13
+ const naiveLength = () => 1;
14
+ class LRUCache {
15
+ constructor(options) {
16
+ if (typeof options === "number")
17
+ options = { max: options };
18
+ if (!options)
19
+ options = {};
20
+ if (options.max && (typeof options.max !== "number" || options.max < 0))
21
+ throw new TypeError("max must be a non-negative number");
22
+ this[MAX] = options.max || Infinity;
23
+ const lc = options.length || naiveLength;
24
+ this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
25
+ this[ALLOW_STALE] = options.stale || false;
26
+ if (options.maxAge && typeof options.maxAge !== "number")
27
+ throw new TypeError("maxAge must be a number");
28
+ this[MAX_AGE] = options.maxAge || 0;
29
+ this[DISPOSE] = options.dispose;
30
+ this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
31
+ this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
32
+ this.reset();
33
+ }
34
+ // resize the cache when the max changes.
35
+ set max(mL) {
36
+ if (typeof mL !== "number" || mL < 0)
37
+ throw new TypeError("max must be a non-negative number");
38
+ this[MAX] = mL || Infinity;
39
+ trim(this);
40
+ }
41
+ get max() {
42
+ return this[MAX];
43
+ }
44
+ set allowStale(allowStale) {
45
+ this[ALLOW_STALE] = !!allowStale;
46
+ }
47
+ get allowStale() {
48
+ return this[ALLOW_STALE];
49
+ }
50
+ set maxAge(mA) {
51
+ if (typeof mA !== "number")
52
+ throw new TypeError("maxAge must be a non-negative number");
53
+ this[MAX_AGE] = mA;
54
+ trim(this);
55
+ }
56
+ get maxAge() {
57
+ return this[MAX_AGE];
58
+ }
59
+ // resize the cache when the lengthCalculator changes.
60
+ set lengthCalculator(lC) {
61
+ if (typeof lC !== "function")
62
+ lC = naiveLength;
63
+ if (lC !== this[LENGTH_CALCULATOR]) {
64
+ this[LENGTH_CALCULATOR] = lC;
65
+ this[LENGTH] = 0;
66
+ this[LRU_LIST].forEach((hit) => {
67
+ hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
68
+ this[LENGTH] += hit.length;
69
+ });
70
+ }
71
+ trim(this);
72
+ }
73
+ get lengthCalculator() {
74
+ return this[LENGTH_CALCULATOR];
75
+ }
76
+ get length() {
77
+ return this[LENGTH];
78
+ }
79
+ get itemCount() {
80
+ return this[LRU_LIST].length;
81
+ }
82
+ rforEach(fn, thisp) {
83
+ thisp = thisp || this;
84
+ for (let walker = this[LRU_LIST].tail; walker !== null; ) {
85
+ const prev = walker.prev;
86
+ forEachStep(this, fn, walker, thisp);
87
+ walker = prev;
88
+ }
89
+ }
90
+ forEach(fn, thisp) {
91
+ thisp = thisp || this;
92
+ for (let walker = this[LRU_LIST].head; walker !== null; ) {
93
+ const next = walker.next;
94
+ forEachStep(this, fn, walker, thisp);
95
+ walker = next;
96
+ }
97
+ }
98
+ keys() {
99
+ return this[LRU_LIST].toArray().map((k) => k.key);
100
+ }
101
+ values() {
102
+ return this[LRU_LIST].toArray().map((k) => k.value);
103
+ }
104
+ reset() {
105
+ if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
106
+ this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
107
+ }
108
+ this[CACHE] = /* @__PURE__ */ new Map();
109
+ this[LRU_LIST] = new Yallist();
110
+ this[LENGTH] = 0;
111
+ }
112
+ dump() {
113
+ return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
114
+ k: hit.key,
115
+ v: hit.value,
116
+ e: hit.now + (hit.maxAge || 0)
117
+ }).toArray().filter((h) => h);
118
+ }
119
+ dumpLru() {
120
+ return this[LRU_LIST];
121
+ }
122
+ set(key, value, maxAge) {
123
+ maxAge = maxAge || this[MAX_AGE];
124
+ if (maxAge && typeof maxAge !== "number")
125
+ throw new TypeError("maxAge must be a number");
126
+ const now = maxAge ? Date.now() : 0;
127
+ const len = this[LENGTH_CALCULATOR](value, key);
128
+ if (this[CACHE].has(key)) {
129
+ if (len > this[MAX]) {
130
+ del(this, this[CACHE].get(key));
131
+ return false;
132
+ }
133
+ const node = this[CACHE].get(key);
134
+ const item = node.value;
135
+ if (this[DISPOSE]) {
136
+ if (!this[NO_DISPOSE_ON_SET])
137
+ this[DISPOSE](key, item.value);
138
+ }
139
+ item.now = now;
140
+ item.maxAge = maxAge;
141
+ item.value = value;
142
+ this[LENGTH] += len - item.length;
143
+ item.length = len;
144
+ this.get(key);
145
+ trim(this);
146
+ return true;
147
+ }
148
+ const hit = new Entry(key, value, len, now, maxAge);
149
+ if (hit.length > this[MAX]) {
150
+ if (this[DISPOSE])
151
+ this[DISPOSE](key, value);
152
+ return false;
153
+ }
154
+ this[LENGTH] += hit.length;
155
+ this[LRU_LIST].unshift(hit);
156
+ this[CACHE].set(key, this[LRU_LIST].head);
157
+ trim(this);
158
+ return true;
159
+ }
160
+ has(key) {
161
+ if (!this[CACHE].has(key)) return false;
162
+ const hit = this[CACHE].get(key).value;
163
+ return !isStale(this, hit);
164
+ }
165
+ get(key) {
166
+ return get(this, key, true);
167
+ }
168
+ peek(key) {
169
+ return get(this, key, false);
170
+ }
171
+ pop() {
172
+ const node = this[LRU_LIST].tail;
173
+ if (!node)
174
+ return null;
175
+ del(this, node);
176
+ return node.value;
177
+ }
178
+ del(key) {
179
+ del(this, this[CACHE].get(key));
180
+ }
181
+ load(arr) {
182
+ this.reset();
183
+ const now = Date.now();
184
+ for (let l = arr.length - 1; l >= 0; l--) {
185
+ const hit = arr[l];
186
+ const expiresAt = hit.e || 0;
187
+ if (expiresAt === 0)
188
+ this.set(hit.k, hit.v);
189
+ else {
190
+ const maxAge = expiresAt - now;
191
+ if (maxAge > 0) {
192
+ this.set(hit.k, hit.v, maxAge);
193
+ }
194
+ }
195
+ }
196
+ }
197
+ prune() {
198
+ this[CACHE].forEach((value, key) => get(this, key, false));
199
+ }
200
+ }
201
+ const get = (self, key, doUse) => {
202
+ const node = self[CACHE].get(key);
203
+ if (node) {
204
+ const hit = node.value;
205
+ if (isStale(self, hit)) {
206
+ del(self, node);
207
+ if (!self[ALLOW_STALE])
208
+ return void 0;
209
+ } else {
210
+ if (doUse) {
211
+ if (self[UPDATE_AGE_ON_GET])
212
+ node.value.now = Date.now();
213
+ self[LRU_LIST].unshiftNode(node);
214
+ }
215
+ }
216
+ return hit.value;
217
+ }
218
+ };
219
+ const isStale = (self, hit) => {
220
+ if (!hit || !hit.maxAge && !self[MAX_AGE])
221
+ return false;
222
+ const diff = Date.now() - hit.now;
223
+ return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
224
+ };
225
+ const trim = (self) => {
226
+ if (self[LENGTH] > self[MAX]) {
227
+ for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null; ) {
228
+ const prev = walker.prev;
229
+ del(self, walker);
230
+ walker = prev;
231
+ }
232
+ }
233
+ };
234
+ const del = (self, node) => {
235
+ if (node) {
236
+ const hit = node.value;
237
+ if (self[DISPOSE])
238
+ self[DISPOSE](hit.key, hit.value);
239
+ self[LENGTH] -= hit.length;
240
+ self[CACHE].delete(hit.key);
241
+ self[LRU_LIST].removeNode(node);
242
+ }
243
+ };
244
+ class Entry {
245
+ constructor(key, value, length, now, maxAge) {
246
+ this.key = key;
247
+ this.value = value;
248
+ this.length = length;
249
+ this.now = now;
250
+ this.maxAge = maxAge || 0;
251
+ }
252
+ }
253
+ const forEachStep = (self, fn, node, thisp) => {
254
+ let hit = node.value;
255
+ if (isStale(self, hit)) {
256
+ del(self, node);
257
+ if (!self[ALLOW_STALE])
258
+ hit = void 0;
259
+ }
260
+ if (hit)
261
+ fn.call(thisp, hit.value, hit.key, self);
262
+ };
263
+ var lruCache = LRUCache;
264
+ export {
265
+ lruCache as l
266
+ };
267
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../node_modules/lru-cache/index.js"],"sourcesContent":["'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n"],"names":["require$$0"],"mappings":";AAGA,MAAM,UAAUA;AAEhB,MAAM,MAAM,OAAO,KAAK;AACxB,MAAM,SAAS,OAAO,QAAQ;AAC9B,MAAM,oBAAoB,OAAO,kBAAkB;AACnD,MAAM,cAAc,OAAO,YAAY;AACvC,MAAM,UAAU,OAAO,QAAQ;AAC/B,MAAM,UAAU,OAAO,SAAS;AAChC,MAAM,oBAAoB,OAAO,gBAAgB;AACjD,MAAM,WAAW,OAAO,SAAS;AACjC,MAAM,QAAQ,OAAO,OAAO;AAC5B,MAAM,oBAAoB,OAAO,gBAAgB;AAEjD,MAAM,cAAc,MAAM;AAU1B,MAAM,SAAS;AAAA,EACb,YAAa,SAAS;AACpB,QAAI,OAAO,YAAY;AACrB,gBAAU,EAAE,KAAK,QAAO;AAE1B,QAAI,CAAC;AACH,gBAAU,CAAA;AAEZ,QAAI,QAAQ,QAAQ,OAAO,QAAQ,QAAQ,YAAY,QAAQ,MAAM;AACnE,YAAM,IAAI,UAAU,mCAAmC;AAE7C,SAAK,GAAG,IAAI,QAAQ,OAAO;AAEvC,UAAM,KAAK,QAAQ,UAAU;AAC7B,SAAK,iBAAiB,IAAK,OAAO,OAAO,aAAc,cAAc;AACrE,SAAK,WAAW,IAAI,QAAQ,SAAS;AACrC,QAAI,QAAQ,UAAU,OAAO,QAAQ,WAAW;AAC9C,YAAM,IAAI,UAAU,yBAAyB;AAC/C,SAAK,OAAO,IAAI,QAAQ,UAAU;AAClC,SAAK,OAAO,IAAI,QAAQ;AACxB,SAAK,iBAAiB,IAAI,QAAQ,kBAAkB;AACpD,SAAK,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,KAAK,IAAI;AAC3C;AAEA,IAAA,WAAiB;","x_google_ignoreList":[0]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var iterator;
4
+ var hasRequiredIterator;
5
+ function requireIterator() {
6
+ if (hasRequiredIterator) return iterator;
7
+ hasRequiredIterator = 1;
8
+ iterator = function(Yallist) {
9
+ Yallist.prototype[Symbol.iterator] = function* () {
10
+ for (let walker = this.head; walker; walker = walker.next) {
11
+ yield walker.value;
12
+ }
13
+ };
14
+ };
15
+ return iterator;
16
+ }
17
+ exports.__require = requireIterator;
18
+ //# sourceMappingURL=iterator.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterator.cjs","sources":["../../../../../node_modules/yallist/iterator.js"],"sourcesContent":["'use strict'\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;AACA,aAAiB,SAAU,SAAS;AAClC,YAAQ,UAAU,OAAO,QAAQ,IAAI,aAAa;AAChD,eAAS,SAAS,KAAK,MAAM,QAAQ,SAAS,OAAO,MAAM;AACzD,cAAM,OAAO;AAAA,MACnB;AAAA,IACA;AAAA,EACA;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,18 @@
1
+ var iterator;
2
+ var hasRequiredIterator;
3
+ function requireIterator() {
4
+ if (hasRequiredIterator) return iterator;
5
+ hasRequiredIterator = 1;
6
+ iterator = function(Yallist) {
7
+ Yallist.prototype[Symbol.iterator] = function* () {
8
+ for (let walker = this.head; walker; walker = walker.next) {
9
+ yield walker.value;
10
+ }
11
+ };
12
+ };
13
+ return iterator;
14
+ }
15
+ export {
16
+ requireIterator as __require
17
+ };
18
+ //# sourceMappingURL=iterator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterator.js","sources":["../../../../../node_modules/yallist/iterator.js"],"sourcesContent":["'use strict'\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n"],"names":[],"mappings":";;;;;AACA,aAAiB,SAAU,SAAS;AAClC,YAAQ,UAAU,OAAO,QAAQ,IAAI,aAAa;AAChD,eAAS,SAAS,KAAK,MAAM,QAAQ,SAAS,OAAO,MAAM;AACzD,cAAM,OAAO;AAAA,MACnB;AAAA,IACA;AAAA,EACA;;;","x_google_ignoreList":[0]}