@forsakringskassan/vite-lib-config 3.6.6 → 4.0.1

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.
@@ -681,6 +681,7 @@ var require_is_ci = __commonJS({
681
681
  // node_modules/semver/internal/constants.js
682
682
  var require_constants = __commonJS({
683
683
  "node_modules/semver/internal/constants.js"(exports2, module2) {
684
+ "use strict";
684
685
  var SEMVER_SPEC_VERSION = "2.0.0";
685
686
  var MAX_LENGTH = 256;
686
687
  var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
@@ -712,6 +713,7 @@ var require_constants = __commonJS({
712
713
  // node_modules/semver/internal/debug.js
713
714
  var require_debug = __commonJS({
714
715
  "node_modules/semver/internal/debug.js"(exports2, module2) {
716
+ "use strict";
715
717
  var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
716
718
  };
717
719
  module2.exports = debug;
@@ -721,6 +723,7 @@ var require_debug = __commonJS({
721
723
  // node_modules/semver/internal/re.js
722
724
  var require_re = __commonJS({
723
725
  "node_modules/semver/internal/re.js"(exports2, module2) {
726
+ "use strict";
724
727
  var {
725
728
  MAX_SAFE_COMPONENT_LENGTH,
726
729
  MAX_SAFE_BUILD_LENGTH,
@@ -761,8 +764,8 @@ var require_re = __commonJS({
761
764
  createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
762
765
  createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
763
766
  createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
764
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
765
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
767
+ createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
768
+ createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
766
769
  createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
767
770
  createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
768
771
  createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
@@ -808,6 +811,7 @@ var require_re = __commonJS({
808
811
  // node_modules/semver/internal/parse-options.js
809
812
  var require_parse_options = __commonJS({
810
813
  "node_modules/semver/internal/parse-options.js"(exports2, module2) {
814
+ "use strict";
811
815
  var looseOption = Object.freeze({ loose: true });
812
816
  var emptyOpts = Object.freeze({});
813
817
  var parseOptions = (options) => {
@@ -826,6 +830,7 @@ var require_parse_options = __commonJS({
826
830
  // node_modules/semver/internal/identifiers.js
827
831
  var require_identifiers = __commonJS({
828
832
  "node_modules/semver/internal/identifiers.js"(exports2, module2) {
833
+ "use strict";
829
834
  var numeric = /^[0-9]+$/;
830
835
  var compareIdentifiers = (a, b) => {
831
836
  const anum = numeric.test(a);
@@ -847,9 +852,10 @@ var require_identifiers = __commonJS({
847
852
  // node_modules/semver/classes/semver.js
848
853
  var require_semver = __commonJS({
849
854
  "node_modules/semver/classes/semver.js"(exports2, module2) {
855
+ "use strict";
850
856
  var debug = require_debug();
851
857
  var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
852
- var { safeRe: re, safeSrc: src, t } = require_re();
858
+ var { safeRe: re, t } = require_re();
853
859
  var parseOptions = require_parse_options();
854
860
  var { compareIdentifiers } = require_identifiers();
855
861
  var SemVer = class _SemVer {
@@ -994,8 +1000,7 @@ var require_semver = __commonJS({
994
1000
  throw new Error("invalid increment argument: identifier is empty");
995
1001
  }
996
1002
  if (identifier) {
997
- const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
998
- const match2 = `-${identifier}`.match(r);
1003
+ const match2 = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
999
1004
  if (!match2 || match2[1] !== identifier) {
1000
1005
  throw new Error(`invalid identifier: ${identifier}`);
1001
1006
  }
@@ -1108,6 +1113,7 @@ var require_semver = __commonJS({
1108
1113
  // node_modules/semver/functions/parse.js
1109
1114
  var require_parse = __commonJS({
1110
1115
  "node_modules/semver/functions/parse.js"(exports2, module2) {
1116
+ "use strict";
1111
1117
  var SemVer = require_semver();
1112
1118
  var parse = (version2, options, throwErrors = false) => {
1113
1119
  if (version2 instanceof SemVer) {
@@ -1129,6 +1135,7 @@ var require_parse = __commonJS({
1129
1135
  // node_modules/semver/functions/valid.js
1130
1136
  var require_valid = __commonJS({
1131
1137
  "node_modules/semver/functions/valid.js"(exports2, module2) {
1138
+ "use strict";
1132
1139
  var parse = require_parse();
1133
1140
  var valid = (version2, options) => {
1134
1141
  const v = parse(version2, options);
@@ -1141,6 +1148,7 @@ var require_valid = __commonJS({
1141
1148
  // node_modules/semver/functions/clean.js
1142
1149
  var require_clean = __commonJS({
1143
1150
  "node_modules/semver/functions/clean.js"(exports2, module2) {
1151
+ "use strict";
1144
1152
  var parse = require_parse();
1145
1153
  var clean = (version2, options) => {
1146
1154
  const s = parse(version2.trim().replace(/^[=v]+/, ""), options);
@@ -1153,6 +1161,7 @@ var require_clean = __commonJS({
1153
1161
  // node_modules/semver/functions/inc.js
1154
1162
  var require_inc = __commonJS({
1155
1163
  "node_modules/semver/functions/inc.js"(exports2, module2) {
1164
+ "use strict";
1156
1165
  var SemVer = require_semver();
1157
1166
  var inc = (version2, release, options, identifier, identifierBase) => {
1158
1167
  if (typeof options === "string") {
@@ -1176,6 +1185,7 @@ var require_inc = __commonJS({
1176
1185
  // node_modules/semver/functions/diff.js
1177
1186
  var require_diff = __commonJS({
1178
1187
  "node_modules/semver/functions/diff.js"(exports2, module2) {
1188
+ "use strict";
1179
1189
  var parse = require_parse();
1180
1190
  var diff = (version1, version2) => {
1181
1191
  const v1 = parse(version1, null, true);
@@ -1219,6 +1229,7 @@ var require_diff = __commonJS({
1219
1229
  // node_modules/semver/functions/major.js
1220
1230
  var require_major = __commonJS({
1221
1231
  "node_modules/semver/functions/major.js"(exports2, module2) {
1232
+ "use strict";
1222
1233
  var SemVer = require_semver();
1223
1234
  var major2 = (a, loose) => new SemVer(a, loose).major;
1224
1235
  module2.exports = major2;
@@ -1228,6 +1239,7 @@ var require_major = __commonJS({
1228
1239
  // node_modules/semver/functions/minor.js
1229
1240
  var require_minor = __commonJS({
1230
1241
  "node_modules/semver/functions/minor.js"(exports2, module2) {
1242
+ "use strict";
1231
1243
  var SemVer = require_semver();
1232
1244
  var minor = (a, loose) => new SemVer(a, loose).minor;
1233
1245
  module2.exports = minor;
@@ -1237,6 +1249,7 @@ var require_minor = __commonJS({
1237
1249
  // node_modules/semver/functions/patch.js
1238
1250
  var require_patch = __commonJS({
1239
1251
  "node_modules/semver/functions/patch.js"(exports2, module2) {
1252
+ "use strict";
1240
1253
  var SemVer = require_semver();
1241
1254
  var patch = (a, loose) => new SemVer(a, loose).patch;
1242
1255
  module2.exports = patch;
@@ -1246,6 +1259,7 @@ var require_patch = __commonJS({
1246
1259
  // node_modules/semver/functions/prerelease.js
1247
1260
  var require_prerelease = __commonJS({
1248
1261
  "node_modules/semver/functions/prerelease.js"(exports2, module2) {
1262
+ "use strict";
1249
1263
  var parse = require_parse();
1250
1264
  var prerelease = (version2, options) => {
1251
1265
  const parsed = parse(version2, options);
@@ -1258,6 +1272,7 @@ var require_prerelease = __commonJS({
1258
1272
  // node_modules/semver/functions/compare.js
1259
1273
  var require_compare = __commonJS({
1260
1274
  "node_modules/semver/functions/compare.js"(exports2, module2) {
1275
+ "use strict";
1261
1276
  var SemVer = require_semver();
1262
1277
  var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
1263
1278
  module2.exports = compare;
@@ -1267,6 +1282,7 @@ var require_compare = __commonJS({
1267
1282
  // node_modules/semver/functions/rcompare.js
1268
1283
  var require_rcompare = __commonJS({
1269
1284
  "node_modules/semver/functions/rcompare.js"(exports2, module2) {
1285
+ "use strict";
1270
1286
  var compare = require_compare();
1271
1287
  var rcompare = (a, b, loose) => compare(b, a, loose);
1272
1288
  module2.exports = rcompare;
@@ -1276,6 +1292,7 @@ var require_rcompare = __commonJS({
1276
1292
  // node_modules/semver/functions/compare-loose.js
1277
1293
  var require_compare_loose = __commonJS({
1278
1294
  "node_modules/semver/functions/compare-loose.js"(exports2, module2) {
1295
+ "use strict";
1279
1296
  var compare = require_compare();
1280
1297
  var compareLoose = (a, b) => compare(a, b, true);
1281
1298
  module2.exports = compareLoose;
@@ -1285,6 +1302,7 @@ var require_compare_loose = __commonJS({
1285
1302
  // node_modules/semver/functions/compare-build.js
1286
1303
  var require_compare_build = __commonJS({
1287
1304
  "node_modules/semver/functions/compare-build.js"(exports2, module2) {
1305
+ "use strict";
1288
1306
  var SemVer = require_semver();
1289
1307
  var compareBuild = (a, b, loose) => {
1290
1308
  const versionA = new SemVer(a, loose);
@@ -1298,6 +1316,7 @@ var require_compare_build = __commonJS({
1298
1316
  // node_modules/semver/functions/sort.js
1299
1317
  var require_sort = __commonJS({
1300
1318
  "node_modules/semver/functions/sort.js"(exports2, module2) {
1319
+ "use strict";
1301
1320
  var compareBuild = require_compare_build();
1302
1321
  var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
1303
1322
  module2.exports = sort;
@@ -1307,6 +1326,7 @@ var require_sort = __commonJS({
1307
1326
  // node_modules/semver/functions/rsort.js
1308
1327
  var require_rsort = __commonJS({
1309
1328
  "node_modules/semver/functions/rsort.js"(exports2, module2) {
1329
+ "use strict";
1310
1330
  var compareBuild = require_compare_build();
1311
1331
  var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
1312
1332
  module2.exports = rsort;
@@ -1316,6 +1336,7 @@ var require_rsort = __commonJS({
1316
1336
  // node_modules/semver/functions/gt.js
1317
1337
  var require_gt = __commonJS({
1318
1338
  "node_modules/semver/functions/gt.js"(exports2, module2) {
1339
+ "use strict";
1319
1340
  var compare = require_compare();
1320
1341
  var gt = (a, b, loose) => compare(a, b, loose) > 0;
1321
1342
  module2.exports = gt;
@@ -1325,6 +1346,7 @@ var require_gt = __commonJS({
1325
1346
  // node_modules/semver/functions/lt.js
1326
1347
  var require_lt = __commonJS({
1327
1348
  "node_modules/semver/functions/lt.js"(exports2, module2) {
1349
+ "use strict";
1328
1350
  var compare = require_compare();
1329
1351
  var lt = (a, b, loose) => compare(a, b, loose) < 0;
1330
1352
  module2.exports = lt;
@@ -1334,6 +1356,7 @@ var require_lt = __commonJS({
1334
1356
  // node_modules/semver/functions/eq.js
1335
1357
  var require_eq = __commonJS({
1336
1358
  "node_modules/semver/functions/eq.js"(exports2, module2) {
1359
+ "use strict";
1337
1360
  var compare = require_compare();
1338
1361
  var eq = (a, b, loose) => compare(a, b, loose) === 0;
1339
1362
  module2.exports = eq;
@@ -1343,6 +1366,7 @@ var require_eq = __commonJS({
1343
1366
  // node_modules/semver/functions/neq.js
1344
1367
  var require_neq = __commonJS({
1345
1368
  "node_modules/semver/functions/neq.js"(exports2, module2) {
1369
+ "use strict";
1346
1370
  var compare = require_compare();
1347
1371
  var neq = (a, b, loose) => compare(a, b, loose) !== 0;
1348
1372
  module2.exports = neq;
@@ -1352,6 +1376,7 @@ var require_neq = __commonJS({
1352
1376
  // node_modules/semver/functions/gte.js
1353
1377
  var require_gte = __commonJS({
1354
1378
  "node_modules/semver/functions/gte.js"(exports2, module2) {
1379
+ "use strict";
1355
1380
  var compare = require_compare();
1356
1381
  var gte = (a, b, loose) => compare(a, b, loose) >= 0;
1357
1382
  module2.exports = gte;
@@ -1361,6 +1386,7 @@ var require_gte = __commonJS({
1361
1386
  // node_modules/semver/functions/lte.js
1362
1387
  var require_lte = __commonJS({
1363
1388
  "node_modules/semver/functions/lte.js"(exports2, module2) {
1389
+ "use strict";
1364
1390
  var compare = require_compare();
1365
1391
  var lte = (a, b, loose) => compare(a, b, loose) <= 0;
1366
1392
  module2.exports = lte;
@@ -1370,6 +1396,7 @@ var require_lte = __commonJS({
1370
1396
  // node_modules/semver/functions/cmp.js
1371
1397
  var require_cmp = __commonJS({
1372
1398
  "node_modules/semver/functions/cmp.js"(exports2, module2) {
1399
+ "use strict";
1373
1400
  var eq = require_eq();
1374
1401
  var neq = require_neq();
1375
1402
  var gt = require_gt();
@@ -1419,6 +1446,7 @@ var require_cmp = __commonJS({
1419
1446
  // node_modules/semver/functions/coerce.js
1420
1447
  var require_coerce = __commonJS({
1421
1448
  "node_modules/semver/functions/coerce.js"(exports2, module2) {
1449
+ "use strict";
1422
1450
  var SemVer = require_semver();
1423
1451
  var parse = require_parse();
1424
1452
  var { safeRe: re, t } = require_re();
@@ -1464,6 +1492,7 @@ var require_coerce = __commonJS({
1464
1492
  // node_modules/semver/internal/lrucache.js
1465
1493
  var require_lrucache = __commonJS({
1466
1494
  "node_modules/semver/internal/lrucache.js"(exports2, module2) {
1495
+ "use strict";
1467
1496
  var LRUCache2 = class {
1468
1497
  constructor() {
1469
1498
  this.max = 1e3;
@@ -1501,6 +1530,7 @@ var require_lrucache = __commonJS({
1501
1530
  // node_modules/semver/classes/range.js
1502
1531
  var require_range = __commonJS({
1503
1532
  "node_modules/semver/classes/range.js"(exports2, module2) {
1533
+ "use strict";
1504
1534
  var SPACE_CHARACTERS = /\s+/g;
1505
1535
  var Range = class _Range {
1506
1536
  constructor(range, options) {
@@ -1876,6 +1906,7 @@ var require_range = __commonJS({
1876
1906
  // node_modules/semver/classes/comparator.js
1877
1907
  var require_comparator = __commonJS({
1878
1908
  "node_modules/semver/classes/comparator.js"(exports2, module2) {
1909
+ "use strict";
1879
1910
  var ANY = Symbol("SemVer ANY");
1880
1911
  var Comparator = class _Comparator {
1881
1912
  static get ANY() {
@@ -1988,6 +2019,7 @@ var require_comparator = __commonJS({
1988
2019
  // node_modules/semver/functions/satisfies.js
1989
2020
  var require_satisfies = __commonJS({
1990
2021
  "node_modules/semver/functions/satisfies.js"(exports2, module2) {
2022
+ "use strict";
1991
2023
  var Range = require_range();
1992
2024
  var satisfies = (version2, range, options) => {
1993
2025
  try {
@@ -2004,6 +2036,7 @@ var require_satisfies = __commonJS({
2004
2036
  // node_modules/semver/ranges/to-comparators.js
2005
2037
  var require_to_comparators = __commonJS({
2006
2038
  "node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
2039
+ "use strict";
2007
2040
  var Range = require_range();
2008
2041
  var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
2009
2042
  module2.exports = toComparators;
@@ -2013,6 +2046,7 @@ var require_to_comparators = __commonJS({
2013
2046
  // node_modules/semver/ranges/max-satisfying.js
2014
2047
  var require_max_satisfying = __commonJS({
2015
2048
  "node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
2049
+ "use strict";
2016
2050
  var SemVer = require_semver();
2017
2051
  var Range = require_range();
2018
2052
  var maxSatisfying = (versions, range, options) => {
@@ -2041,6 +2075,7 @@ var require_max_satisfying = __commonJS({
2041
2075
  // node_modules/semver/ranges/min-satisfying.js
2042
2076
  var require_min_satisfying = __commonJS({
2043
2077
  "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
2078
+ "use strict";
2044
2079
  var SemVer = require_semver();
2045
2080
  var Range = require_range();
2046
2081
  var minSatisfying = (versions, range, options) => {
@@ -2069,6 +2104,7 @@ var require_min_satisfying = __commonJS({
2069
2104
  // node_modules/semver/ranges/min-version.js
2070
2105
  var require_min_version = __commonJS({
2071
2106
  "node_modules/semver/ranges/min-version.js"(exports2, module2) {
2107
+ "use strict";
2072
2108
  var SemVer = require_semver();
2073
2109
  var Range = require_range();
2074
2110
  var gt = require_gt();
@@ -2127,6 +2163,7 @@ var require_min_version = __commonJS({
2127
2163
  // node_modules/semver/ranges/valid.js
2128
2164
  var require_valid2 = __commonJS({
2129
2165
  "node_modules/semver/ranges/valid.js"(exports2, module2) {
2166
+ "use strict";
2130
2167
  var Range = require_range();
2131
2168
  var validRange = (range, options) => {
2132
2169
  try {
@@ -2142,6 +2179,7 @@ var require_valid2 = __commonJS({
2142
2179
  // node_modules/semver/ranges/outside.js
2143
2180
  var require_outside = __commonJS({
2144
2181
  "node_modules/semver/ranges/outside.js"(exports2, module2) {
2182
+ "use strict";
2145
2183
  var SemVer = require_semver();
2146
2184
  var Comparator = require_comparator();
2147
2185
  var { ANY } = Comparator;
@@ -2210,6 +2248,7 @@ var require_outside = __commonJS({
2210
2248
  // node_modules/semver/ranges/gtr.js
2211
2249
  var require_gtr = __commonJS({
2212
2250
  "node_modules/semver/ranges/gtr.js"(exports2, module2) {
2251
+ "use strict";
2213
2252
  var outside = require_outside();
2214
2253
  var gtr = (version2, range, options) => outside(version2, range, ">", options);
2215
2254
  module2.exports = gtr;
@@ -2219,6 +2258,7 @@ var require_gtr = __commonJS({
2219
2258
  // node_modules/semver/ranges/ltr.js
2220
2259
  var require_ltr = __commonJS({
2221
2260
  "node_modules/semver/ranges/ltr.js"(exports2, module2) {
2261
+ "use strict";
2222
2262
  var outside = require_outside();
2223
2263
  var ltr = (version2, range, options) => outside(version2, range, "<", options);
2224
2264
  module2.exports = ltr;
@@ -2228,6 +2268,7 @@ var require_ltr = __commonJS({
2228
2268
  // node_modules/semver/ranges/intersects.js
2229
2269
  var require_intersects = __commonJS({
2230
2270
  "node_modules/semver/ranges/intersects.js"(exports2, module2) {
2271
+ "use strict";
2231
2272
  var Range = require_range();
2232
2273
  var intersects = (r1, r2, options) => {
2233
2274
  r1 = new Range(r1, options);
@@ -2241,6 +2282,7 @@ var require_intersects = __commonJS({
2241
2282
  // node_modules/semver/ranges/simplify.js
2242
2283
  var require_simplify = __commonJS({
2243
2284
  "node_modules/semver/ranges/simplify.js"(exports2, module2) {
2285
+ "use strict";
2244
2286
  var satisfies = require_satisfies();
2245
2287
  var compare = require_compare();
2246
2288
  module2.exports = (versions, range, options) => {
@@ -2290,6 +2332,7 @@ var require_simplify = __commonJS({
2290
2332
  // node_modules/semver/ranges/subset.js
2291
2333
  var require_subset = __commonJS({
2292
2334
  "node_modules/semver/ranges/subset.js"(exports2, module2) {
2335
+ "use strict";
2293
2336
  var Range = require_range();
2294
2337
  var Comparator = require_comparator();
2295
2338
  var { ANY } = Comparator;
@@ -2451,6 +2494,7 @@ var require_subset = __commonJS({
2451
2494
  // node_modules/semver/index.js
2452
2495
  var require_semver2 = __commonJS({
2453
2496
  "node_modules/semver/index.js"(exports2, module2) {
2497
+ "use strict";
2454
2498
  var internalRe = require_re();
2455
2499
  var constants = require_constants();
2456
2500
  var SemVer = require_semver();
@@ -3967,14 +4011,14 @@ var Stack = class _Stack {
3967
4011
  }
3968
4012
  };
3969
4013
  var LRUCache = class _LRUCache {
3970
- // properties coming in from the options of these, only max and maxSize
3971
- // really *need* to be protected. The rest can be modified, as they just
3972
- // set defaults for various methods.
4014
+ // options that cannot be changed without disaster
3973
4015
  #max;
3974
4016
  #maxSize;
3975
4017
  #dispose;
4018
+ #onInsert;
3976
4019
  #disposeAfter;
3977
4020
  #fetchMethod;
4021
+ #memoMethod;
3978
4022
  /**
3979
4023
  * {@link LRUCache.OptionsBase.ttl}
3980
4024
  */
@@ -4053,6 +4097,7 @@ var LRUCache = class _LRUCache {
4053
4097
  #hasDispose;
4054
4098
  #hasFetchMethod;
4055
4099
  #hasDisposeAfter;
4100
+ #hasOnInsert;
4056
4101
  /**
4057
4102
  * Do not call this method unless you need to inspect the
4058
4103
  * inner workings of the cache. If anything returned by this
@@ -4120,12 +4165,21 @@ var LRUCache = class _LRUCache {
4120
4165
  get fetchMethod() {
4121
4166
  return this.#fetchMethod;
4122
4167
  }
4168
+ get memoMethod() {
4169
+ return this.#memoMethod;
4170
+ }
4123
4171
  /**
4124
4172
  * {@link LRUCache.OptionsBase.dispose} (read-only)
4125
4173
  */
4126
4174
  get dispose() {
4127
4175
  return this.#dispose;
4128
4176
  }
4177
+ /**
4178
+ * {@link LRUCache.OptionsBase.onInsert} (read-only)
4179
+ */
4180
+ get onInsert() {
4181
+ return this.#onInsert;
4182
+ }
4129
4183
  /**
4130
4184
  * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
4131
4185
  */
@@ -4133,7 +4187,7 @@ var LRUCache = class _LRUCache {
4133
4187
  return this.#disposeAfter;
4134
4188
  }
4135
4189
  constructor(options) {
4136
- const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
4190
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
4137
4191
  if (max !== 0 && !isPosInt(max)) {
4138
4192
  throw new TypeError("max option must be a nonnegative integer");
4139
4193
  }
@@ -4153,6 +4207,10 @@ var LRUCache = class _LRUCache {
4153
4207
  throw new TypeError("sizeCalculation set to non-function");
4154
4208
  }
4155
4209
  }
4210
+ if (memoMethod !== void 0 && typeof memoMethod !== "function") {
4211
+ throw new TypeError("memoMethod must be a function if defined");
4212
+ }
4213
+ this.#memoMethod = memoMethod;
4156
4214
  if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
4157
4215
  throw new TypeError("fetchMethod must be a function if specified");
4158
4216
  }
@@ -4171,6 +4229,9 @@ var LRUCache = class _LRUCache {
4171
4229
  if (typeof dispose === "function") {
4172
4230
  this.#dispose = dispose;
4173
4231
  }
4232
+ if (typeof onInsert === "function") {
4233
+ this.#onInsert = onInsert;
4234
+ }
4174
4235
  if (typeof disposeAfter === "function") {
4175
4236
  this.#disposeAfter = disposeAfter;
4176
4237
  this.#disposed = [];
@@ -4179,6 +4240,7 @@ var LRUCache = class _LRUCache {
4179
4240
  this.#disposed = void 0;
4180
4241
  }
4181
4242
  this.#hasDispose = !!this.#dispose;
4243
+ this.#hasOnInsert = !!this.#onInsert;
4182
4244
  this.#hasDisposeAfter = !!this.#disposeAfter;
4183
4245
  this.noDisposeOnSet = !!noDisposeOnSet;
4184
4246
  this.noUpdateTTL = !!noUpdateTTL;
@@ -4223,7 +4285,8 @@ var LRUCache = class _LRUCache {
4223
4285
  }
4224
4286
  }
4225
4287
  /**
4226
- * Return the remaining TTL time for a given entry key
4288
+ * Return the number of ms left in the item's TTL. If item is not in cache,
4289
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
4227
4290
  */
4228
4291
  getRemainingTTL(key) {
4229
4292
  return this.#keyMap.has(key) ? Infinity : 0;
@@ -4239,7 +4302,7 @@ var LRUCache = class _LRUCache {
4239
4302
  if (ttl !== 0 && this.ttlAutopurge) {
4240
4303
  const t = setTimeout(() => {
4241
4304
  if (this.#isStale(index)) {
4242
- this.delete(this.#keyList[index]);
4305
+ this.#delete(this.#keyList[index], "expire");
4243
4306
  }
4244
4307
  }, ttl + 1);
4245
4308
  if (t.unref) {
@@ -4476,13 +4539,14 @@ var LRUCache = class _LRUCache {
4476
4539
  return this.entries();
4477
4540
  }
4478
4541
  /**
4479
- * A String value that is used in the creation of the default string description of an object.
4480
- * Called by the built-in method Object.prototype.toString.
4542
+ * A String value that is used in the creation of the default string
4543
+ * description of an object. Called by the built-in method
4544
+ * `Object.prototype.toString`.
4481
4545
  */
4482
4546
  [Symbol.toStringTag] = "LRUCache";
4483
4547
  /**
4484
4548
  * Find a value for which the supplied fn method returns a truthy value,
4485
- * similar to Array.find(). fn is called as fn(value, key, cache).
4549
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
4486
4550
  */
4487
4551
  find(fn, getOptions = {}) {
4488
4552
  for (const i of this.#indexes()) {
@@ -4496,10 +4560,15 @@ var LRUCache = class _LRUCache {
4496
4560
  }
4497
4561
  }
4498
4562
  /**
4499
- * Call the supplied function on each item in the cache, in order from
4500
- * most recently used to least recently used. fn is called as
4501
- * fn(value, key, cache). Does not update age or recenty of use.
4502
- * Does not iterate over stale values.
4563
+ * Call the supplied function on each item in the cache, in order from most
4564
+ * recently used to least recently used.
4565
+ *
4566
+ * `fn` is called as `fn(value, key, cache)`.
4567
+ *
4568
+ * If `thisp` is provided, function will be called in the `this`-context of
4569
+ * the provided object, or the cache if no `thisp` object is provided.
4570
+ *
4571
+ * Does not update age or recenty of use, or iterate over stale values.
4503
4572
  */
4504
4573
  forEach(fn, thisp = this) {
4505
4574
  for (const i of this.#indexes()) {
@@ -4531,7 +4600,7 @@ var LRUCache = class _LRUCache {
4531
4600
  let deleted = false;
4532
4601
  for (const i of this.#rindexes({ allowStale: true })) {
4533
4602
  if (this.#isStale(i)) {
4534
- this.delete(this.#keyList[i]);
4603
+ this.#delete(this.#keyList[i], "expire");
4535
4604
  deleted = true;
4536
4605
  }
4537
4606
  }
@@ -4539,9 +4608,15 @@ var LRUCache = class _LRUCache {
4539
4608
  }
4540
4609
  /**
4541
4610
  * Get the extended info about a given entry, to get its value, size, and
4542
- * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a
4543
- * single key. Always returns stale values, if their info is found in the
4544
- * cache, so be sure to check for expired TTLs if relevant.
4611
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
4612
+ *
4613
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
4614
+ * serialization, the `start` value is always the current timestamp, and the
4615
+ * `ttl` is a calculated remaining time to live (negative if expired).
4616
+ *
4617
+ * Always returns stale values, if their info is found in the cache, so be
4618
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
4619
+ * if relevant.
4545
4620
  */
4546
4621
  info(key) {
4547
4622
  const i = this.#keyMap.get(key);
@@ -4568,7 +4643,16 @@ var LRUCache = class _LRUCache {
4568
4643
  }
4569
4644
  /**
4570
4645
  * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
4571
- * passed to cache.load()
4646
+ * passed to {@link LRUCache#load}.
4647
+ *
4648
+ * The `start` fields are calculated relative to a portable `Date.now()`
4649
+ * timestamp, even if `performance.now()` is available.
4650
+ *
4651
+ * Stale entries are always included in the `dump`, even if
4652
+ * {@link LRUCache.OptionsBase.allowStale} is false.
4653
+ *
4654
+ * Note: this returns an actual array, not a generator, so it can be more
4655
+ * easily passed around.
4572
4656
  */
4573
4657
  dump() {
4574
4658
  const arr = [];
@@ -4593,8 +4677,12 @@ var LRUCache = class _LRUCache {
4593
4677
  }
4594
4678
  /**
4595
4679
  * Reset the cache and load in the items in entries in the order listed.
4596
- * Note that the shape of the resulting cache may be different if the
4597
- * same options are not used in both caches.
4680
+ *
4681
+ * The shape of the resulting cache may be different if the same options are
4682
+ * not used in both caches.
4683
+ *
4684
+ * The `start` fields are assumed to be calculated relative to a portable
4685
+ * `Date.now()` timestamp, even if `performance.now()` is available.
4598
4686
  */
4599
4687
  load(arr) {
4600
4688
  this.clear();
@@ -4611,6 +4699,30 @@ var LRUCache = class _LRUCache {
4611
4699
  *
4612
4700
  * Note: if `undefined` is specified as a value, this is an alias for
4613
4701
  * {@link LRUCache#delete}
4702
+ *
4703
+ * Fields on the {@link LRUCache.SetOptions} options param will override
4704
+ * their corresponding values in the constructor options for the scope
4705
+ * of this single `set()` operation.
4706
+ *
4707
+ * If `start` is provided, then that will set the effective start
4708
+ * time for the TTL calculation. Note that this must be a previous
4709
+ * value of `performance.now()` if supported, or a previous value of
4710
+ * `Date.now()` if not.
4711
+ *
4712
+ * Options object may also include `size`, which will prevent
4713
+ * calling the `sizeCalculation` function and just use the specified
4714
+ * number if it is a positive integer, and `noDisposeOnSet` which
4715
+ * will prevent calling a `dispose` function in the case of
4716
+ * overwrites.
4717
+ *
4718
+ * If the `size` (or return value of `sizeCalculation`) for a given
4719
+ * entry is greater than `maxEntrySize`, then the item will not be
4720
+ * added to the cache.
4721
+ *
4722
+ * Will update the recency of the entry.
4723
+ *
4724
+ * If the value is `undefined`, then this is an alias for
4725
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
4614
4726
  */
4615
4727
  set(k, v, setOptions = {}) {
4616
4728
  if (v === void 0) {
@@ -4625,7 +4737,7 @@ var LRUCache = class _LRUCache {
4625
4737
  status.set = "miss";
4626
4738
  status.maxEntrySizeExceeded = true;
4627
4739
  }
4628
- this.delete(k);
4740
+ this.#delete(k, "set");
4629
4741
  return this;
4630
4742
  }
4631
4743
  let index = this.#size === 0 ? void 0 : this.#keyMap.get(k);
@@ -4642,6 +4754,9 @@ var LRUCache = class _LRUCache {
4642
4754
  if (status)
4643
4755
  status.set = "add";
4644
4756
  noUpdateTTL = false;
4757
+ if (this.#hasOnInsert) {
4758
+ this.#onInsert?.(v, k, "add");
4759
+ }
4645
4760
  } else {
4646
4761
  this.#moveToTail(index);
4647
4762
  const oldVal = this.#valList[index];
@@ -4677,6 +4792,9 @@ var LRUCache = class _LRUCache {
4677
4792
  } else if (status) {
4678
4793
  status.set = "update";
4679
4794
  }
4795
+ if (this.#hasOnInsert) {
4796
+ this.onInsert?.(v, k, v === oldVal ? "update" : "replace");
4797
+ }
4680
4798
  }
4681
4799
  if (ttl !== 0 && !this.#ttls) {
4682
4800
  this.#initializeTTLTracking();
@@ -4759,6 +4877,14 @@ var LRUCache = class _LRUCache {
4759
4877
  * Will return false if the item is stale, even though it is technically
4760
4878
  * in the cache.
4761
4879
  *
4880
+ * Check if a key is in the cache, without updating the recency of
4881
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
4882
+ * to `true` in either the options or the constructor.
4883
+ *
4884
+ * Will return `false` if the item is stale, even though it is technically in
4885
+ * the cache. The difference can be determined (if it matters) by using a
4886
+ * `status` argument, and inspecting the `has` field.
4887
+ *
4762
4888
  * Will not update item age unless
4763
4889
  * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
4764
4890
  */
@@ -4841,7 +4967,7 @@ var LRUCache = class _LRUCache {
4841
4967
  if (bf2.__staleWhileFetching) {
4842
4968
  this.#valList[index] = bf2.__staleWhileFetching;
4843
4969
  } else {
4844
- this.delete(k);
4970
+ this.#delete(k, "fetch");
4845
4971
  }
4846
4972
  } else {
4847
4973
  if (options.status)
@@ -4867,7 +4993,7 @@ var LRUCache = class _LRUCache {
4867
4993
  if (this.#valList[index] === p) {
4868
4994
  const del = !noDelete || bf2.__staleWhileFetching === void 0;
4869
4995
  if (del) {
4870
- this.delete(k);
4996
+ this.#delete(k, "fetch");
4871
4997
  } else if (!allowStaleAborted) {
4872
4998
  this.#valList[index] = bf2.__staleWhileFetching;
4873
4999
  }
@@ -5005,6 +5131,28 @@ var LRUCache = class _LRUCache {
5005
5131
  return staleVal ? p.__staleWhileFetching : p.__returned = p;
5006
5132
  }
5007
5133
  }
5134
+ async forceFetch(k, fetchOptions = {}) {
5135
+ const v = await this.fetch(k, fetchOptions);
5136
+ if (v === void 0)
5137
+ throw new Error("fetch() returned undefined");
5138
+ return v;
5139
+ }
5140
+ memo(k, memoOptions = {}) {
5141
+ const memoMethod = this.#memoMethod;
5142
+ if (!memoMethod) {
5143
+ throw new Error("no memoMethod provided to constructor");
5144
+ }
5145
+ const { context, forceRefresh, ...options } = memoOptions;
5146
+ const v = this.get(k, options);
5147
+ if (!forceRefresh && v !== void 0)
5148
+ return v;
5149
+ const vv = memoMethod(k, v, {
5150
+ options,
5151
+ context
5152
+ });
5153
+ this.set(k, vv, options);
5154
+ return vv;
5155
+ }
5008
5156
  /**
5009
5157
  * Return a value from the cache. Will update the recency of the cache
5010
5158
  * entry found.
@@ -5024,7 +5172,7 @@ var LRUCache = class _LRUCache {
5024
5172
  status.get = "stale";
5025
5173
  if (!fetching) {
5026
5174
  if (!noDeleteOnStaleGet) {
5027
- this.delete(k);
5175
+ this.#delete(k, "expire");
5028
5176
  }
5029
5177
  if (status && allowStale)
5030
5178
  status.returnedStale = true;
@@ -5068,16 +5216,20 @@ var LRUCache = class _LRUCache {
5068
5216
  }
5069
5217
  /**
5070
5218
  * Deletes a key out of the cache.
5219
+ *
5071
5220
  * Returns true if the key was deleted, false otherwise.
5072
5221
  */
5073
5222
  delete(k) {
5223
+ return this.#delete(k, "delete");
5224
+ }
5225
+ #delete(k, reason) {
5074
5226
  let deleted = false;
5075
5227
  if (this.#size !== 0) {
5076
5228
  const index = this.#keyMap.get(k);
5077
5229
  if (index !== void 0) {
5078
5230
  deleted = true;
5079
5231
  if (this.#size === 1) {
5080
- this.clear();
5232
+ this.#clear(reason);
5081
5233
  } else {
5082
5234
  this.#removeItemSize(index);
5083
5235
  const v = this.#valList[index];
@@ -5085,10 +5237,10 @@ var LRUCache = class _LRUCache {
5085
5237
  v.__abortController.abort(new Error("deleted"));
5086
5238
  } else if (this.#hasDispose || this.#hasDisposeAfter) {
5087
5239
  if (this.#hasDispose) {
5088
- this.#dispose?.(v, k, "delete");
5240
+ this.#dispose?.(v, k, reason);
5089
5241
  }
5090
5242
  if (this.#hasDisposeAfter) {
5091
- this.#disposed?.push([v, k, "delete"]);
5243
+ this.#disposed?.push([v, k, reason]);
5092
5244
  }
5093
5245
  }
5094
5246
  this.#keyMap.delete(k);
@@ -5122,6 +5274,9 @@ var LRUCache = class _LRUCache {
5122
5274
  * Clear the cache entirely, throwing away all values.
5123
5275
  */
5124
5276
  clear() {
5277
+ return this.#clear("delete");
5278
+ }
5279
+ #clear(reason) {
5125
5280
  for (const index of this.#rindexes({ allowStale: true })) {
5126
5281
  const v = this.#valList[index];
5127
5282
  if (this.#isBackgroundFetch(v)) {
@@ -5129,10 +5284,10 @@ var LRUCache = class _LRUCache {
5129
5284
  } else {
5130
5285
  const k = this.#keyList[index];
5131
5286
  if (this.#hasDispose) {
5132
- this.#dispose?.(v, k, "delete");
5287
+ this.#dispose?.(v, k, reason);
5133
5288
  }
5134
5289
  if (this.#hasDisposeAfter) {
5135
- this.#disposed?.push([v, k, "delete"]);
5290
+ this.#disposed?.push([v, k, reason]);
5136
5291
  }
5137
5292
  }
5138
5293
  }
@@ -6260,6 +6415,8 @@ var PathBase = class {
6260
6415
  /**
6261
6416
  * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
6262
6417
  * this property refers to the *parent* path, not the path object itself.
6418
+ *
6419
+ * @deprecated
6263
6420
  */
6264
6421
  get path() {
6265
6422
  return this.parentPath;