@prisma/migrate 6.5.0-dev.57 → 6.5.0-dev.59

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.
package/dist/bin.js CHANGED
@@ -50,9 +50,9 @@ var import_chunk_V3ZMNXZC = require("./chunk-V3ZMNXZC.js");
50
50
  var import_chunk_255BRND3 = require("./chunk-255BRND3.js");
51
51
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
52
52
  var import_chunk_LKTTJWFT = require("./chunk-LKTTJWFT.js");
53
- var import_chunk_PHD26T4E = require("./chunk-PHD26T4E.js");
53
+ var import_chunk_UUIB2ZT3 = require("./chunk-UUIB2ZT3.js");
54
54
  var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
55
- var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
55
+ var import_chunk_YYPMC5FN = require("./chunk-YYPMC5FN.js");
56
56
  var import_chunk_DLLXDCI2 = require("./chunk-DLLXDCI2.js");
57
57
  var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
58
58
  var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");
@@ -72,7 +72,7 @@ var import_config = require("@prisma/config");
72
72
  var import_debug = __toESM(require("@prisma/debug"));
73
73
  var import_engines_version = require("@prisma/engines-version");
74
74
  var import_internals = require("@prisma/internals");
75
- var version = "6.5.0-dev.57";
75
+ var version = "6.5.0-dev.59";
76
76
  process.on("uncaughtException", (e) => {
77
77
  console.log(e);
78
78
  });
@@ -99,7 +99,7 @@ async function main() {
99
99
  resolve: import_chunk_EX2UWGES.MigrateResolve.new(),
100
100
  reset: import_chunk_X6KW7BYP.MigrateReset.new(),
101
101
  deploy: import_chunk_TPJISPJ5.MigrateDeploy.new(),
102
- diff: import_chunk_PHD26T4E.MigrateDiff.new()
102
+ diff: import_chunk_UUIB2ZT3.MigrateDiff.new()
103
103
  }),
104
104
  db: import_chunk_W2SZNLK4.DbCommand.new({
105
105
  execute: import_chunk_E7OXHCDR.DbExecute.new(),
@@ -26,13 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_56PLVP2I_exports = {};
30
- __export(chunk_56PLVP2I_exports, {
29
+ var chunk_QBA7W2BT_exports = {};
30
+ __export(chunk_QBA7W2BT_exports, {
31
31
  MigrateDiff: () => MigrateDiff
32
32
  });
33
- module.exports = __toCommonJS(chunk_56PLVP2I_exports);
33
+ module.exports = __toCommonJS(chunk_QBA7W2BT_exports);
34
34
  var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
35
- var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
35
+ var import_chunk_YYPMC5FN = require("./chunk-YYPMC5FN.js");
36
36
  var import_chunk_DLLXDCI2 = require("./chunk-DLLXDCI2.js");
37
37
  var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
38
38
  var import_chunk_MATFO4ZW = require("./chunk-MATFO4ZW.js");
@@ -9197,7 +9197,7 @@ var require_from_url = (0, import_chunk_WWAWV7DQ.__commonJS)({
9197
9197
  var require_lib5 = (0, import_chunk_WWAWV7DQ.__commonJS)({
9198
9198
  "../../node_modules/.pnpm/hosted-git-info@7.0.1/node_modules/hosted-git-info/lib/index.js"(exports, module2) {
9199
9199
  "use strict";
9200
- var { LRUCache } = (0, import_chunk_XRTNIFND.require_commonjs)();
9200
+ var { LRUCache } = (0, import_chunk_YYPMC5FN.require_commonjs)();
9201
9201
  var hosts = require_hosts();
9202
9202
  var fromUrl = require_from_url();
9203
9203
  var parseUrl = require_parse_url();
@@ -26,13 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_PHD26T4E_exports = {};
30
- __export(chunk_PHD26T4E_exports, {
29
+ var chunk_UUIB2ZT3_exports = {};
30
+ __export(chunk_UUIB2ZT3_exports, {
31
31
  MigrateDiff: () => MigrateDiff
32
32
  });
33
- module.exports = __toCommonJS(chunk_PHD26T4E_exports);
33
+ module.exports = __toCommonJS(chunk_UUIB2ZT3_exports);
34
34
  var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
35
- var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
35
+ var import_chunk_YYPMC5FN = require("./chunk-YYPMC5FN.js");
36
36
  var import_chunk_DLLXDCI2 = require("./chunk-DLLXDCI2.js");
37
37
  var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
38
38
  var import_chunk_MATFO4ZW = require("./chunk-MATFO4ZW.js");
@@ -9197,7 +9197,7 @@ var require_from_url = (0, import_chunk_WWAWV7DQ.__commonJS)({
9197
9197
  var require_lib5 = (0, import_chunk_WWAWV7DQ.__commonJS)({
9198
9198
  "../../node_modules/.pnpm/hosted-git-info@7.0.1/node_modules/hosted-git-info/lib/index.js"(exports, module2) {
9199
9199
  "use strict";
9200
- var { LRUCache } = (0, import_chunk_XRTNIFND.require_commonjs)();
9200
+ var { LRUCache } = (0, import_chunk_YYPMC5FN.require_commonjs)();
9201
9201
  var hosts = require_hosts();
9202
9202
  var fromUrl = require_from_url();
9203
9203
  var parseUrl = require_parse_url();
@@ -10259,7 +10259,7 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
10259
10259
  "../internals/package.json"(exports, module2) {
10260
10260
  module2.exports = {
10261
10261
  name: "@prisma/internals",
10262
- version: "6.5.0-dev.57",
10262
+ version: "6.5.0-dev.59",
10263
10263
  description: "This package is intended for Prisma's internal use",
10264
10264
  main: "dist/index.js",
10265
10265
  types: "dist/index.d.ts",
@@ -16,14 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_XRTNIFND_exports = {};
20
- __export(chunk_XRTNIFND_exports, {
19
+ var chunk_YYPMC5FN_exports = {};
20
+ __export(chunk_YYPMC5FN_exports, {
21
21
  require_commonjs: () => require_commonjs
22
22
  });
23
- module.exports = __toCommonJS(chunk_XRTNIFND_exports);
23
+ module.exports = __toCommonJS(chunk_YYPMC5FN_exports);
24
24
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
25
25
  var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
26
- "../../node_modules/.pnpm/lru-cache@10.2.0/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
26
+ "../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
27
27
  "use strict";
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.LRUCache = void 0;
@@ -111,7 +111,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
111
111
  _constructing = /* @__PURE__ */ new WeakMap();
112
112
  (0, import_chunk_WWAWV7DQ.__privateAdd)(_Stack, _constructing, false);
113
113
  var Stack = _Stack;
114
- var _a, _b, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn;
114
+ var _a, _b, _max, _maxSize, _dispose, _disposeAfter, _fetchMethod, _memoMethod, _size, _calculatedSize, _keyMap, _keyList, _valList, _next, _prev, _head, _tail, _free, _disposed, _sizes, _starts, _ttls, _hasDispose, _hasFetchMethod, _hasDisposeAfter, _LRUCache_instances, initializeTTLTracking_fn, _updateItemAge, _statusTTL, _setItemTTL, _isStale, initializeSizeTracking_fn, _removeItemSize, _addItemSize, _requireSize, indexes_fn, rindexes_fn, isValidIndex_fn, evict_fn, backgroundFetch_fn, isBackgroundFetch_fn, connect_fn, moveToTail_fn, delete_fn, clear_fn;
115
115
  var _LRUCache = class _LRUCache2 {
116
116
  constructor(options) {
117
117
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _LRUCache_instances);
@@ -120,6 +120,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
120
120
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _dispose);
121
121
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _disposeAfter);
122
122
  (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _fetchMethod);
123
+ (0, import_chunk_WWAWV7DQ.__privateAdd)(this, _memoMethod);
123
124
  (0, import_chunk_WWAWV7DQ.__publicField)(this, "ttl");
124
125
  (0, import_chunk_WWAWV7DQ.__publicField)(this, "ttlResolution");
125
126
  (0, import_chunk_WWAWV7DQ.__publicField)(this, "ttlAutopurge");
@@ -170,7 +171,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
170
171
  return 0;
171
172
  });
172
173
  (0, import_chunk_WWAWV7DQ.__publicField)(this, _a, "LRUCache");
173
- 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;
174
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
174
175
  if (max !== 0 && !isPosInt(max)) {
175
176
  throw new TypeError("max option must be a nonnegative integer");
176
177
  }
@@ -190,6 +191,10 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
190
191
  throw new TypeError("sizeCalculation set to non-function");
191
192
  }
192
193
  }
194
+ if (memoMethod !== void 0 && typeof memoMethod !== "function") {
195
+ throw new TypeError("memoMethod must be a function if defined");
196
+ }
197
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _memoMethod, memoMethod);
193
198
  if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
194
199
  throw new TypeError("fetchMethod must be a function if specified");
195
200
  }
@@ -344,6 +349,9 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
344
349
  get fetchMethod() {
345
350
  return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _fetchMethod);
346
351
  }
352
+ get memoMethod() {
353
+ return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _memoMethod);
354
+ }
347
355
  /**
348
356
  * {@link LRUCache.OptionsBase.dispose} (read-only)
349
357
  */
@@ -357,7 +365,8 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
357
365
  return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter);
358
366
  }
359
367
  /**
360
- * Return the remaining TTL time for a given entry key
368
+ * Return the number of ms left in the item's TTL. If item is not in cache,
369
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
361
370
  */
362
371
  getRemainingTTL(key) {
363
372
  return (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).has(key) ? Infinity : 0;
@@ -447,7 +456,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
447
456
  }
448
457
  /**
449
458
  * Find a value for which the supplied fn method returns a truthy value,
450
- * similar to Array.find(). fn is called as fn(value, key, cache).
459
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
451
460
  */
452
461
  find(fn, getOptions = {}) {
453
462
  for (const i of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, indexes_fn).call(this)) {
@@ -461,10 +470,15 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
461
470
  }
462
471
  }
463
472
  /**
464
- * Call the supplied function on each item in the cache, in order from
465
- * most recently used to least recently used. fn is called as
466
- * fn(value, key, cache). Does not update age or recenty of use.
467
- * Does not iterate over stale values.
473
+ * Call the supplied function on each item in the cache, in order from most
474
+ * recently used to least recently used.
475
+ *
476
+ * `fn` is called as `fn(value, key, cache)`.
477
+ *
478
+ * If `thisp` is provided, function will be called in the `this`-context of
479
+ * the provided object, or the cache if no `thisp` object is provided.
480
+ *
481
+ * Does not update age or recenty of use, or iterate over stale values.
468
482
  */
469
483
  forEach(fn, thisp = this) {
470
484
  for (const i of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, indexes_fn).call(this)) {
@@ -496,7 +510,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
496
510
  let deleted = false;
497
511
  for (const i of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
498
512
  if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _isStale).call(this, i)) {
499
- this.delete((0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[i]);
513
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[i], "expire");
500
514
  deleted = true;
501
515
  }
502
516
  }
@@ -504,9 +518,15 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
504
518
  }
505
519
  /**
506
520
  * Get the extended info about a given entry, to get its value, size, and
507
- * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a
508
- * single key. Always returns stale values, if their info is found in the
509
- * cache, so be sure to check for expired TTLs if relevant.
521
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
522
+ *
523
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
524
+ * serialization, the `start` value is always the current timestamp, and the
525
+ * `ttl` is a calculated remaining time to live (negative if expired).
526
+ *
527
+ * Always returns stale values, if their info is found in the cache, so be
528
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
529
+ * if relevant.
510
530
  */
511
531
  info(key) {
512
532
  const i = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(key);
@@ -533,7 +553,16 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
533
553
  }
534
554
  /**
535
555
  * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
536
- * passed to cache.load()
556
+ * passed to {@link LRLUCache#load}.
557
+ *
558
+ * The `start` fields are calculated relative to a portable `Date.now()`
559
+ * timestamp, even if `performance.now()` is available.
560
+ *
561
+ * Stale entries are always included in the `dump`, even if
562
+ * {@link LRUCache.OptionsBase.allowStale} is false.
563
+ *
564
+ * Note: this returns an actual array, not a generator, so it can be more
565
+ * easily passed around.
537
566
  */
538
567
  dump() {
539
568
  const arr = [];
@@ -558,8 +587,12 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
558
587
  }
559
588
  /**
560
589
  * Reset the cache and load in the items in entries in the order listed.
561
- * Note that the shape of the resulting cache may be different if the
562
- * same options are not used in both caches.
590
+ *
591
+ * The shape of the resulting cache may be different if the same options are
592
+ * not used in both caches.
593
+ *
594
+ * The `start` fields are assumed to be calculated relative to a portable
595
+ * `Date.now()` timestamp, even if `performance.now()` is available.
563
596
  */
564
597
  load(arr) {
565
598
  this.clear();
@@ -576,6 +609,30 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
576
609
  *
577
610
  * Note: if `undefined` is specified as a value, this is an alias for
578
611
  * {@link LRUCache#delete}
612
+ *
613
+ * Fields on the {@link LRUCache.SetOptions} options param will override
614
+ * their corresponding values in the constructor options for the scope
615
+ * of this single `set()` operation.
616
+ *
617
+ * If `start` is provided, then that will set the effective start
618
+ * time for the TTL calculation. Note that this must be a previous
619
+ * value of `performance.now()` if supported, or a previous value of
620
+ * `Date.now()` if not.
621
+ *
622
+ * Options object may also include `size`, which will prevent
623
+ * calling the `sizeCalculation` function and just use the specified
624
+ * number if it is a positive integer, and `noDisposeOnSet` which
625
+ * will prevent calling a `dispose` function in the case of
626
+ * overwrites.
627
+ *
628
+ * If the `size` (or return value of `sizeCalculation`) for a given
629
+ * entry is greater than `maxEntrySize`, then the item will not be
630
+ * added to the cache.
631
+ *
632
+ * Will update the recency of the entry.
633
+ *
634
+ * If the value is `undefined`, then this is an alias for
635
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
579
636
  */
580
637
  set(k, v, setOptions = {}) {
581
638
  var _a2, _b2, _c;
@@ -591,7 +648,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
591
648
  status.set = "miss";
592
649
  status.maxEntrySizeExceeded = true;
593
650
  }
594
- this.delete(k);
651
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "set");
595
652
  return this;
596
653
  }
597
654
  let index = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) === 0 ? void 0 : (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(k);
@@ -696,6 +753,14 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
696
753
  * Will return false if the item is stale, even though it is technically
697
754
  * in the cache.
698
755
  *
756
+ * Check if a key is in the cache, without updating the recency of
757
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
758
+ * to `true` in either the options or the constructor.
759
+ *
760
+ * Will return `false` if the item is stale, even though it is technically in
761
+ * the cache. The difference can be determined (if it matters) by using a
762
+ * `status` argument, and inspecting the `has` field.
763
+ *
699
764
  * Will not update item age unless
700
765
  * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
701
766
  */
@@ -829,6 +894,28 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
829
894
  return staleVal ? p.__staleWhileFetching : p.__returned = p;
830
895
  }
831
896
  }
897
+ async forceFetch(k, fetchOptions = {}) {
898
+ const v = await this.fetch(k, fetchOptions);
899
+ if (v === void 0)
900
+ throw new Error("fetch() returned undefined");
901
+ return v;
902
+ }
903
+ memo(k, memoOptions = {}) {
904
+ const memoMethod = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _memoMethod);
905
+ if (!memoMethod) {
906
+ throw new Error("no memoMethod provided to constructor");
907
+ }
908
+ const { context, forceRefresh, ...options } = memoOptions;
909
+ const v = this.get(k, options);
910
+ if (!forceRefresh && v !== void 0)
911
+ return v;
912
+ const vv = memoMethod(k, v, {
913
+ options,
914
+ context
915
+ });
916
+ this.set(k, vv, options);
917
+ return vv;
918
+ }
832
919
  /**
833
920
  * Return a value from the cache. Will update the recency of the cache
834
921
  * entry found.
@@ -848,7 +935,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
848
935
  status.get = "stale";
849
936
  if (!fetching) {
850
937
  if (!noDeleteOnStaleGet) {
851
- this.delete(k);
938
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "expire");
852
939
  }
853
940
  if (status && allowStale)
854
941
  status.returnedStale = true;
@@ -877,98 +964,17 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
877
964
  }
878
965
  /**
879
966
  * Deletes a key out of the cache.
967
+ *
880
968
  * Returns true if the key was deleted, false otherwise.
881
969
  */
882
970
  delete(k) {
883
- var _a2, _b2;
884
- let deleted = false;
885
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) !== 0) {
886
- const index = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(k);
887
- if (index !== void 0) {
888
- deleted = true;
889
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) === 1) {
890
- this.clear();
891
- } else {
892
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _removeItemSize).call(this, index);
893
- const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
894
- if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
895
- v.__abortController.abort(new Error("deleted"));
896
- } else if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose) || (0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
897
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
898
- (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, "delete");
899
- }
900
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
901
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, "delete"]);
902
- }
903
- }
904
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).delete(k);
905
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index] = void 0;
906
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = void 0;
907
- if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _tail)) {
908
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index]);
909
- } else if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _head)) {
910
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index]);
911
- } else {
912
- const pi = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
913
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[pi] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
914
- const ni = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
915
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[ni] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
916
- }
917
- (0, import_chunk_WWAWV7DQ.__privateWrapper)(this, _size)._--;
918
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).push(index);
919
- }
920
- }
921
- }
922
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.length) {
923
- const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
924
- let task;
925
- while (task = dt?.shift()) {
926
- (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
927
- }
928
- }
929
- return deleted;
971
+ return (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "delete");
930
972
  }
931
973
  /**
932
974
  * Clear the cache entirely, throwing away all values.
933
975
  */
934
976
  clear() {
935
- var _a2, _b2;
936
- for (const index of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
937
- const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
938
- if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
939
- v.__abortController.abort(new Error("deleted"));
940
- } else {
941
- const k = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index];
942
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
943
- (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, "delete");
944
- }
945
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
946
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, "delete"]);
947
- }
948
- }
949
- }
950
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).clear();
951
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList).fill(void 0);
952
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList).fill(void 0);
953
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts)) {
954
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls).fill(0);
955
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts).fill(0);
956
- }
957
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes)) {
958
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes).fill(0);
959
- }
960
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, 0);
961
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, 0);
962
- (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).length = 0;
963
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _calculatedSize, 0);
964
- (0, import_chunk_WWAWV7DQ.__privateSet)(this, _size, 0);
965
- if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)) {
966
- const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
967
- let task;
968
- while (task = dt?.shift()) {
969
- (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
970
- }
971
- }
977
+ return (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, clear_fn).call(this, "delete");
972
978
  }
973
979
  };
974
980
  _max = /* @__PURE__ */ new WeakMap();
@@ -976,6 +982,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
976
982
  _dispose = /* @__PURE__ */ new WeakMap();
977
983
  _disposeAfter = /* @__PURE__ */ new WeakMap();
978
984
  _fetchMethod = /* @__PURE__ */ new WeakMap();
985
+ _memoMethod = /* @__PURE__ */ new WeakMap();
979
986
  _size = /* @__PURE__ */ new WeakMap();
980
987
  _calculatedSize = /* @__PURE__ */ new WeakMap();
981
988
  _keyMap = /* @__PURE__ */ new WeakMap();
@@ -1005,7 +1012,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
1005
1012
  if (ttl !== 0 && this.ttlAutopurge) {
1006
1013
  const t = setTimeout(() => {
1007
1014
  if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _isStale).call(this, index)) {
1008
- this.delete((0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index]);
1015
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index], "expire");
1009
1016
  }
1010
1017
  }, ttl + 1);
1011
1018
  if (t.unref) {
@@ -1214,7 +1221,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
1214
1221
  if (bf2.__staleWhileFetching) {
1215
1222
  (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = bf2.__staleWhileFetching;
1216
1223
  } else {
1217
- this.delete(k);
1224
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
1218
1225
  }
1219
1226
  } else {
1220
1227
  if (options.status)
@@ -1240,7 +1247,7 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
1240
1247
  if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] === p) {
1241
1248
  const del = !noDelete || bf2.__staleWhileFetching === void 0;
1242
1249
  if (del) {
1243
- this.delete(k);
1250
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, delete_fn).call(this, k, "fetch");
1244
1251
  } else if (!allowStaleAborted) {
1245
1252
  (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = bf2.__staleWhileFetching;
1246
1253
  }
@@ -1306,6 +1313,94 @@ var require_commonjs = (0, import_chunk_WWAWV7DQ.__commonJS)({
1306
1313
  (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, index);
1307
1314
  }
1308
1315
  };
1316
+ delete_fn = function(k, reason) {
1317
+ var _a2, _b2;
1318
+ let deleted = false;
1319
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) !== 0) {
1320
+ const index = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).get(k);
1321
+ if (index !== void 0) {
1322
+ deleted = true;
1323
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _size) === 1) {
1324
+ (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, clear_fn).call(this, reason);
1325
+ } else {
1326
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _removeItemSize).call(this, index);
1327
+ const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
1328
+ if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
1329
+ v.__abortController.abort(new Error("deleted"));
1330
+ } else if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose) || (0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
1331
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
1332
+ (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, reason);
1333
+ }
1334
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
1335
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, reason]);
1336
+ }
1337
+ }
1338
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).delete(k);
1339
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index] = void 0;
1340
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index] = void 0;
1341
+ if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _tail)) {
1342
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index]);
1343
+ } else if (index === (0, import_chunk_WWAWV7DQ.__privateGet)(this, _head)) {
1344
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index]);
1345
+ } else {
1346
+ const pi = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
1347
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[pi] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
1348
+ const ni = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _next)[index];
1349
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[ni] = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _prev)[index];
1350
+ }
1351
+ (0, import_chunk_WWAWV7DQ.__privateWrapper)(this, _size)._--;
1352
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).push(index);
1353
+ }
1354
+ }
1355
+ }
1356
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.length) {
1357
+ const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
1358
+ let task;
1359
+ while (task = dt?.shift()) {
1360
+ (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
1361
+ }
1362
+ }
1363
+ return deleted;
1364
+ };
1365
+ clear_fn = function(reason) {
1366
+ var _a2, _b2;
1367
+ for (const index of (0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, rindexes_fn).call(this, { allowStale: true })) {
1368
+ const v = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList)[index];
1369
+ if ((0, import_chunk_WWAWV7DQ.__privateMethod)(this, _LRUCache_instances, isBackgroundFetch_fn).call(this, v)) {
1370
+ v.__abortController.abort(new Error("deleted"));
1371
+ } else {
1372
+ const k = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList)[index];
1373
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDispose)) {
1374
+ (_a2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _dispose)) == null ? void 0 : _a2.call(this, v, k, reason);
1375
+ }
1376
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter)) {
1377
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)?.push([v, k, reason]);
1378
+ }
1379
+ }
1380
+ }
1381
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyMap).clear();
1382
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _valList).fill(void 0);
1383
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _keyList).fill(void 0);
1384
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts)) {
1385
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _ttls).fill(0);
1386
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _starts).fill(0);
1387
+ }
1388
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes)) {
1389
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _sizes).fill(0);
1390
+ }
1391
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _head, 0);
1392
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _tail, 0);
1393
+ (0, import_chunk_WWAWV7DQ.__privateGet)(this, _free).length = 0;
1394
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _calculatedSize, 0);
1395
+ (0, import_chunk_WWAWV7DQ.__privateSet)(this, _size, 0);
1396
+ if ((0, import_chunk_WWAWV7DQ.__privateGet)(this, _hasDisposeAfter) && (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed)) {
1397
+ const dt = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposed);
1398
+ let task;
1399
+ while (task = dt?.shift()) {
1400
+ (_b2 = (0, import_chunk_WWAWV7DQ.__privateGet)(this, _disposeAfter)) == null ? void 0 : _b2.call(this, ...task);
1401
+ }
1402
+ }
1403
+ };
1309
1404
  var LRUCache = _LRUCache;
1310
1405
  exports.LRUCache = LRUCache;
1311
1406
  }
@@ -18,12 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var MigrateDiff_exports = {};
20
20
  __export(MigrateDiff_exports, {
21
- MigrateDiff: () => import_chunk_PHD26T4E.MigrateDiff
21
+ MigrateDiff: () => import_chunk_UUIB2ZT3.MigrateDiff
22
22
  });
23
23
  module.exports = __toCommonJS(MigrateDiff_exports);
24
- var import_chunk_PHD26T4E = require("../chunk-PHD26T4E.js");
24
+ var import_chunk_UUIB2ZT3 = require("../chunk-UUIB2ZT3.js");
25
25
  var import_chunk_A6PMXMMT = require("../chunk-A6PMXMMT.js");
26
- var import_chunk_XRTNIFND = require("../chunk-XRTNIFND.js");
26
+ var import_chunk_YYPMC5FN = require("../chunk-YYPMC5FN.js");
27
27
  var import_chunk_DLLXDCI2 = require("../chunk-DLLXDCI2.js");
28
28
  var import_chunk_KXMACMQC = require("../chunk-KXMACMQC.js");
29
29
  var import_chunk_6C7ESGWY = require("../chunk-6C7ESGWY.js");
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ __export(index_exports, {
29
29
  MigrateCommand: () => import_chunk_VVKOFN3Y.MigrateCommand,
30
30
  MigrateDeploy: () => import_chunk_TPJISPJ5.MigrateDeploy,
31
31
  MigrateDev: () => import_chunk_A4BCLP6K.MigrateDev,
32
- MigrateDiff: () => import_chunk_PHD26T4E.MigrateDiff,
32
+ MigrateDiff: () => import_chunk_UUIB2ZT3.MigrateDiff,
33
33
  MigrateReset: () => import_chunk_X6KW7BYP.MigrateReset,
34
34
  MigrateResolve: () => import_chunk_EX2UWGES.MigrateResolve,
35
35
  MigrateStatus: () => import_chunk_LZOZZRHB.MigrateStatus,
@@ -69,9 +69,9 @@ var import_chunk_V3ZMNXZC = require("./chunk-V3ZMNXZC.js");
69
69
  var import_chunk_255BRND3 = require("./chunk-255BRND3.js");
70
70
  var import_chunk_UP6FVCDK = require("./chunk-UP6FVCDK.js");
71
71
  var import_chunk_LKTTJWFT = require("./chunk-LKTTJWFT.js");
72
- var import_chunk_PHD26T4E = require("./chunk-PHD26T4E.js");
72
+ var import_chunk_UUIB2ZT3 = require("./chunk-UUIB2ZT3.js");
73
73
  var import_chunk_A6PMXMMT = require("./chunk-A6PMXMMT.js");
74
- var import_chunk_XRTNIFND = require("./chunk-XRTNIFND.js");
74
+ var import_chunk_YYPMC5FN = require("./chunk-YYPMC5FN.js");
75
75
  var import_chunk_DLLXDCI2 = require("./chunk-DLLXDCI2.js");
76
76
  var import_chunk_KXMACMQC = require("./chunk-KXMACMQC.js");
77
77
  var import_chunk_6C7ESGWY = require("./chunk-6C7ESGWY.js");