@settlemint/sdk-cli 2.2.3-pr0f5033c1 → 2.2.3-pr19ac75c7
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/cli.js +3329 -643
- package/dist/cli.js.map +22 -6
- package/package.json +6 -6
package/dist/cli.js
CHANGED
@@ -29768,7 +29768,7 @@ var require_lib3 = __commonJS((exports, module) => {
|
|
29768
29768
|
};
|
29769
29769
|
});
|
29770
29770
|
|
29771
|
-
// ../../node_modules/lru-cache/dist/commonjs/index.js
|
29771
|
+
// ../../node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/index.js
|
29772
29772
|
var require_commonjs = __commonJS((exports) => {
|
29773
29773
|
Object.defineProperty(exports, "__esModule", { value: true });
|
29774
29774
|
exports.LRUCache = undefined;
|
@@ -32623,8 +32623,1123 @@ globstar while`, file, fr, pattern, pr, swallowee);
|
|
32623
32623
|
exports.minimatch.unescape = unescape_js_1.unescape;
|
32624
32624
|
});
|
32625
32625
|
|
32626
|
-
// ../../node_modules/
|
32626
|
+
// ../../node_modules/path-scurry/node_modules/lru-cache/dist/commonjs/index.js
|
32627
32627
|
var require_commonjs3 = __commonJS((exports) => {
|
32628
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
32629
|
+
exports.LRUCache = undefined;
|
32630
|
+
var perf2 = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
32631
|
+
var warned2 = new Set;
|
32632
|
+
var PROCESS2 = typeof process === "object" && !!process ? process : {};
|
32633
|
+
var emitWarning2 = (msg, type2, code, fn) => {
|
32634
|
+
typeof PROCESS2.emitWarning === "function" ? PROCESS2.emitWarning(msg, type2, code, fn) : console.error(`[${code}] ${type2}: ${msg}`);
|
32635
|
+
};
|
32636
|
+
var AC2 = globalThis.AbortController;
|
32637
|
+
var AS2 = globalThis.AbortSignal;
|
32638
|
+
if (typeof AC2 === "undefined") {
|
32639
|
+
AS2 = class AbortSignal2 {
|
32640
|
+
onabort;
|
32641
|
+
_onabort = [];
|
32642
|
+
reason;
|
32643
|
+
aborted = false;
|
32644
|
+
addEventListener(_, fn) {
|
32645
|
+
this._onabort.push(fn);
|
32646
|
+
}
|
32647
|
+
};
|
32648
|
+
AC2 = class AbortController2 {
|
32649
|
+
constructor() {
|
32650
|
+
warnACPolyfill();
|
32651
|
+
}
|
32652
|
+
signal = new AS2;
|
32653
|
+
abort(reason) {
|
32654
|
+
if (this.signal.aborted)
|
32655
|
+
return;
|
32656
|
+
this.signal.reason = reason;
|
32657
|
+
this.signal.aborted = true;
|
32658
|
+
for (const fn of this.signal._onabort) {
|
32659
|
+
fn(reason);
|
32660
|
+
}
|
32661
|
+
this.signal.onabort?.(reason);
|
32662
|
+
}
|
32663
|
+
};
|
32664
|
+
let printACPolyfillWarning = PROCESS2.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
32665
|
+
const warnACPolyfill = () => {
|
32666
|
+
if (!printACPolyfillWarning)
|
32667
|
+
return;
|
32668
|
+
printACPolyfillWarning = false;
|
32669
|
+
emitWarning2("AbortController is not defined. If using lru-cache in " + "node 14, load an AbortController polyfill from the " + "`node-abort-controller` package. A minimal polyfill is " + "provided for use by LRUCache.fetch(), but it should not be " + "relied upon in other contexts (eg, passing it to other APIs that " + "use AbortController/AbortSignal might have undesirable effects). " + "You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
|
32670
|
+
};
|
32671
|
+
}
|
32672
|
+
var shouldWarn2 = (code) => !warned2.has(code);
|
32673
|
+
var TYPE2 = Symbol("type");
|
32674
|
+
var isPosInt2 = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
|
32675
|
+
var getUintArray2 = (max) => !isPosInt2(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray2 : null;
|
32676
|
+
|
32677
|
+
class ZeroArray2 extends Array {
|
32678
|
+
constructor(size) {
|
32679
|
+
super(size);
|
32680
|
+
this.fill(0);
|
32681
|
+
}
|
32682
|
+
}
|
32683
|
+
|
32684
|
+
class Stack2 {
|
32685
|
+
heap;
|
32686
|
+
length;
|
32687
|
+
static #constructing = false;
|
32688
|
+
static create(max) {
|
32689
|
+
const HeapCls = getUintArray2(max);
|
32690
|
+
if (!HeapCls)
|
32691
|
+
return [];
|
32692
|
+
Stack2.#constructing = true;
|
32693
|
+
const s = new Stack2(max, HeapCls);
|
32694
|
+
Stack2.#constructing = false;
|
32695
|
+
return s;
|
32696
|
+
}
|
32697
|
+
constructor(max, HeapCls) {
|
32698
|
+
if (!Stack2.#constructing) {
|
32699
|
+
throw new TypeError("instantiate Stack using Stack.create(n)");
|
32700
|
+
}
|
32701
|
+
this.heap = new HeapCls(max);
|
32702
|
+
this.length = 0;
|
32703
|
+
}
|
32704
|
+
push(n2) {
|
32705
|
+
this.heap[this.length++] = n2;
|
32706
|
+
}
|
32707
|
+
pop() {
|
32708
|
+
return this.heap[--this.length];
|
32709
|
+
}
|
32710
|
+
}
|
32711
|
+
|
32712
|
+
class LRUCache2 {
|
32713
|
+
#max;
|
32714
|
+
#maxSize;
|
32715
|
+
#dispose;
|
32716
|
+
#disposeAfter;
|
32717
|
+
#fetchMethod;
|
32718
|
+
#memoMethod;
|
32719
|
+
ttl;
|
32720
|
+
ttlResolution;
|
32721
|
+
ttlAutopurge;
|
32722
|
+
updateAgeOnGet;
|
32723
|
+
updateAgeOnHas;
|
32724
|
+
allowStale;
|
32725
|
+
noDisposeOnSet;
|
32726
|
+
noUpdateTTL;
|
32727
|
+
maxEntrySize;
|
32728
|
+
sizeCalculation;
|
32729
|
+
noDeleteOnFetchRejection;
|
32730
|
+
noDeleteOnStaleGet;
|
32731
|
+
allowStaleOnFetchAbort;
|
32732
|
+
allowStaleOnFetchRejection;
|
32733
|
+
ignoreFetchAbort;
|
32734
|
+
#size;
|
32735
|
+
#calculatedSize;
|
32736
|
+
#keyMap;
|
32737
|
+
#keyList;
|
32738
|
+
#valList;
|
32739
|
+
#next;
|
32740
|
+
#prev;
|
32741
|
+
#head;
|
32742
|
+
#tail;
|
32743
|
+
#free;
|
32744
|
+
#disposed;
|
32745
|
+
#sizes;
|
32746
|
+
#starts;
|
32747
|
+
#ttls;
|
32748
|
+
#hasDispose;
|
32749
|
+
#hasFetchMethod;
|
32750
|
+
#hasDisposeAfter;
|
32751
|
+
static unsafeExposeInternals(c) {
|
32752
|
+
return {
|
32753
|
+
starts: c.#starts,
|
32754
|
+
ttls: c.#ttls,
|
32755
|
+
sizes: c.#sizes,
|
32756
|
+
keyMap: c.#keyMap,
|
32757
|
+
keyList: c.#keyList,
|
32758
|
+
valList: c.#valList,
|
32759
|
+
next: c.#next,
|
32760
|
+
prev: c.#prev,
|
32761
|
+
get head() {
|
32762
|
+
return c.#head;
|
32763
|
+
},
|
32764
|
+
get tail() {
|
32765
|
+
return c.#tail;
|
32766
|
+
},
|
32767
|
+
free: c.#free,
|
32768
|
+
isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
|
32769
|
+
backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
|
32770
|
+
moveToTail: (index) => c.#moveToTail(index),
|
32771
|
+
indexes: (options) => c.#indexes(options),
|
32772
|
+
rindexes: (options) => c.#rindexes(options),
|
32773
|
+
isStale: (index) => c.#isStale(index)
|
32774
|
+
};
|
32775
|
+
}
|
32776
|
+
get max() {
|
32777
|
+
return this.#max;
|
32778
|
+
}
|
32779
|
+
get maxSize() {
|
32780
|
+
return this.#maxSize;
|
32781
|
+
}
|
32782
|
+
get calculatedSize() {
|
32783
|
+
return this.#calculatedSize;
|
32784
|
+
}
|
32785
|
+
get size() {
|
32786
|
+
return this.#size;
|
32787
|
+
}
|
32788
|
+
get fetchMethod() {
|
32789
|
+
return this.#fetchMethod;
|
32790
|
+
}
|
32791
|
+
get memoMethod() {
|
32792
|
+
return this.#memoMethod;
|
32793
|
+
}
|
32794
|
+
get dispose() {
|
32795
|
+
return this.#dispose;
|
32796
|
+
}
|
32797
|
+
get disposeAfter() {
|
32798
|
+
return this.#disposeAfter;
|
32799
|
+
}
|
32800
|
+
constructor(options) {
|
32801
|
+
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;
|
32802
|
+
if (max !== 0 && !isPosInt2(max)) {
|
32803
|
+
throw new TypeError("max option must be a nonnegative integer");
|
32804
|
+
}
|
32805
|
+
const UintArray = max ? getUintArray2(max) : Array;
|
32806
|
+
if (!UintArray) {
|
32807
|
+
throw new Error("invalid max value: " + max);
|
32808
|
+
}
|
32809
|
+
this.#max = max;
|
32810
|
+
this.#maxSize = maxSize;
|
32811
|
+
this.maxEntrySize = maxEntrySize || this.#maxSize;
|
32812
|
+
this.sizeCalculation = sizeCalculation;
|
32813
|
+
if (this.sizeCalculation) {
|
32814
|
+
if (!this.#maxSize && !this.maxEntrySize) {
|
32815
|
+
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
32816
|
+
}
|
32817
|
+
if (typeof this.sizeCalculation !== "function") {
|
32818
|
+
throw new TypeError("sizeCalculation set to non-function");
|
32819
|
+
}
|
32820
|
+
}
|
32821
|
+
if (memoMethod !== undefined && typeof memoMethod !== "function") {
|
32822
|
+
throw new TypeError("memoMethod must be a function if defined");
|
32823
|
+
}
|
32824
|
+
this.#memoMethod = memoMethod;
|
32825
|
+
if (fetchMethod !== undefined && typeof fetchMethod !== "function") {
|
32826
|
+
throw new TypeError("fetchMethod must be a function if specified");
|
32827
|
+
}
|
32828
|
+
this.#fetchMethod = fetchMethod;
|
32829
|
+
this.#hasFetchMethod = !!fetchMethod;
|
32830
|
+
this.#keyMap = new Map;
|
32831
|
+
this.#keyList = new Array(max).fill(undefined);
|
32832
|
+
this.#valList = new Array(max).fill(undefined);
|
32833
|
+
this.#next = new UintArray(max);
|
32834
|
+
this.#prev = new UintArray(max);
|
32835
|
+
this.#head = 0;
|
32836
|
+
this.#tail = 0;
|
32837
|
+
this.#free = Stack2.create(max);
|
32838
|
+
this.#size = 0;
|
32839
|
+
this.#calculatedSize = 0;
|
32840
|
+
if (typeof dispose === "function") {
|
32841
|
+
this.#dispose = dispose;
|
32842
|
+
}
|
32843
|
+
if (typeof disposeAfter === "function") {
|
32844
|
+
this.#disposeAfter = disposeAfter;
|
32845
|
+
this.#disposed = [];
|
32846
|
+
} else {
|
32847
|
+
this.#disposeAfter = undefined;
|
32848
|
+
this.#disposed = undefined;
|
32849
|
+
}
|
32850
|
+
this.#hasDispose = !!this.#dispose;
|
32851
|
+
this.#hasDisposeAfter = !!this.#disposeAfter;
|
32852
|
+
this.noDisposeOnSet = !!noDisposeOnSet;
|
32853
|
+
this.noUpdateTTL = !!noUpdateTTL;
|
32854
|
+
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
32855
|
+
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
32856
|
+
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
32857
|
+
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
32858
|
+
if (this.maxEntrySize !== 0) {
|
32859
|
+
if (this.#maxSize !== 0) {
|
32860
|
+
if (!isPosInt2(this.#maxSize)) {
|
32861
|
+
throw new TypeError("maxSize must be a positive integer if specified");
|
32862
|
+
}
|
32863
|
+
}
|
32864
|
+
if (!isPosInt2(this.maxEntrySize)) {
|
32865
|
+
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
32866
|
+
}
|
32867
|
+
this.#initializeSizeTracking();
|
32868
|
+
}
|
32869
|
+
this.allowStale = !!allowStale;
|
32870
|
+
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
32871
|
+
this.updateAgeOnGet = !!updateAgeOnGet;
|
32872
|
+
this.updateAgeOnHas = !!updateAgeOnHas;
|
32873
|
+
this.ttlResolution = isPosInt2(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
32874
|
+
this.ttlAutopurge = !!ttlAutopurge;
|
32875
|
+
this.ttl = ttl || 0;
|
32876
|
+
if (this.ttl) {
|
32877
|
+
if (!isPosInt2(this.ttl)) {
|
32878
|
+
throw new TypeError("ttl must be a positive integer if specified");
|
32879
|
+
}
|
32880
|
+
this.#initializeTTLTracking();
|
32881
|
+
}
|
32882
|
+
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
|
32883
|
+
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
32884
|
+
}
|
32885
|
+
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
32886
|
+
const code = "LRU_CACHE_UNBOUNDED";
|
32887
|
+
if (shouldWarn2(code)) {
|
32888
|
+
warned2.add(code);
|
32889
|
+
const msg = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
|
32890
|
+
emitWarning2(msg, "UnboundedCacheWarning", code, LRUCache2);
|
32891
|
+
}
|
32892
|
+
}
|
32893
|
+
}
|
32894
|
+
getRemainingTTL(key2) {
|
32895
|
+
return this.#keyMap.has(key2) ? Infinity : 0;
|
32896
|
+
}
|
32897
|
+
#initializeTTLTracking() {
|
32898
|
+
const ttls = new ZeroArray2(this.#max);
|
32899
|
+
const starts = new ZeroArray2(this.#max);
|
32900
|
+
this.#ttls = ttls;
|
32901
|
+
this.#starts = starts;
|
32902
|
+
this.#setItemTTL = (index, ttl, start = perf2.now()) => {
|
32903
|
+
starts[index] = ttl !== 0 ? start : 0;
|
32904
|
+
ttls[index] = ttl;
|
32905
|
+
if (ttl !== 0 && this.ttlAutopurge) {
|
32906
|
+
const t3 = setTimeout(() => {
|
32907
|
+
if (this.#isStale(index)) {
|
32908
|
+
this.#delete(this.#keyList[index], "expire");
|
32909
|
+
}
|
32910
|
+
}, ttl + 1);
|
32911
|
+
if (t3.unref) {
|
32912
|
+
t3.unref();
|
32913
|
+
}
|
32914
|
+
}
|
32915
|
+
};
|
32916
|
+
this.#updateItemAge = (index) => {
|
32917
|
+
starts[index] = ttls[index] !== 0 ? perf2.now() : 0;
|
32918
|
+
};
|
32919
|
+
this.#statusTTL = (status, index) => {
|
32920
|
+
if (ttls[index]) {
|
32921
|
+
const ttl = ttls[index];
|
32922
|
+
const start = starts[index];
|
32923
|
+
if (!ttl || !start)
|
32924
|
+
return;
|
32925
|
+
status.ttl = ttl;
|
32926
|
+
status.start = start;
|
32927
|
+
status.now = cachedNow || getNow();
|
32928
|
+
const age = status.now - start;
|
32929
|
+
status.remainingTTL = ttl - age;
|
32930
|
+
}
|
32931
|
+
};
|
32932
|
+
let cachedNow = 0;
|
32933
|
+
const getNow = () => {
|
32934
|
+
const n2 = perf2.now();
|
32935
|
+
if (this.ttlResolution > 0) {
|
32936
|
+
cachedNow = n2;
|
32937
|
+
const t3 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
32938
|
+
if (t3.unref) {
|
32939
|
+
t3.unref();
|
32940
|
+
}
|
32941
|
+
}
|
32942
|
+
return n2;
|
32943
|
+
};
|
32944
|
+
this.getRemainingTTL = (key2) => {
|
32945
|
+
const index = this.#keyMap.get(key2);
|
32946
|
+
if (index === undefined) {
|
32947
|
+
return 0;
|
32948
|
+
}
|
32949
|
+
const ttl = ttls[index];
|
32950
|
+
const start = starts[index];
|
32951
|
+
if (!ttl || !start) {
|
32952
|
+
return Infinity;
|
32953
|
+
}
|
32954
|
+
const age = (cachedNow || getNow()) - start;
|
32955
|
+
return ttl - age;
|
32956
|
+
};
|
32957
|
+
this.#isStale = (index) => {
|
32958
|
+
const s = starts[index];
|
32959
|
+
const t3 = ttls[index];
|
32960
|
+
return !!t3 && !!s && (cachedNow || getNow()) - s > t3;
|
32961
|
+
};
|
32962
|
+
}
|
32963
|
+
#updateItemAge = () => {};
|
32964
|
+
#statusTTL = () => {};
|
32965
|
+
#setItemTTL = () => {};
|
32966
|
+
#isStale = () => false;
|
32967
|
+
#initializeSizeTracking() {
|
32968
|
+
const sizes = new ZeroArray2(this.#max);
|
32969
|
+
this.#calculatedSize = 0;
|
32970
|
+
this.#sizes = sizes;
|
32971
|
+
this.#removeItemSize = (index) => {
|
32972
|
+
this.#calculatedSize -= sizes[index];
|
32973
|
+
sizes[index] = 0;
|
32974
|
+
};
|
32975
|
+
this.#requireSize = (k, v, size, sizeCalculation) => {
|
32976
|
+
if (this.#isBackgroundFetch(v)) {
|
32977
|
+
return 0;
|
32978
|
+
}
|
32979
|
+
if (!isPosInt2(size)) {
|
32980
|
+
if (sizeCalculation) {
|
32981
|
+
if (typeof sizeCalculation !== "function") {
|
32982
|
+
throw new TypeError("sizeCalculation must be a function");
|
32983
|
+
}
|
32984
|
+
size = sizeCalculation(v, k);
|
32985
|
+
if (!isPosInt2(size)) {
|
32986
|
+
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
32987
|
+
}
|
32988
|
+
} else {
|
32989
|
+
throw new TypeError("invalid size value (must be positive integer). " + "When maxSize or maxEntrySize is used, sizeCalculation " + "or size must be set.");
|
32990
|
+
}
|
32991
|
+
}
|
32992
|
+
return size;
|
32993
|
+
};
|
32994
|
+
this.#addItemSize = (index, size, status) => {
|
32995
|
+
sizes[index] = size;
|
32996
|
+
if (this.#maxSize) {
|
32997
|
+
const maxSize = this.#maxSize - sizes[index];
|
32998
|
+
while (this.#calculatedSize > maxSize) {
|
32999
|
+
this.#evict(true);
|
33000
|
+
}
|
33001
|
+
}
|
33002
|
+
this.#calculatedSize += sizes[index];
|
33003
|
+
if (status) {
|
33004
|
+
status.entrySize = size;
|
33005
|
+
status.totalCalculatedSize = this.#calculatedSize;
|
33006
|
+
}
|
33007
|
+
};
|
33008
|
+
}
|
33009
|
+
#removeItemSize = (_i) => {};
|
33010
|
+
#addItemSize = (_i, _s, _st) => {};
|
33011
|
+
#requireSize = (_k, _v, size, sizeCalculation) => {
|
33012
|
+
if (size || sizeCalculation) {
|
33013
|
+
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
33014
|
+
}
|
33015
|
+
return 0;
|
33016
|
+
};
|
33017
|
+
*#indexes({ allowStale = this.allowStale } = {}) {
|
33018
|
+
if (this.#size) {
|
33019
|
+
for (let i2 = this.#tail;; ) {
|
33020
|
+
if (!this.#isValidIndex(i2)) {
|
33021
|
+
break;
|
33022
|
+
}
|
33023
|
+
if (allowStale || !this.#isStale(i2)) {
|
33024
|
+
yield i2;
|
33025
|
+
}
|
33026
|
+
if (i2 === this.#head) {
|
33027
|
+
break;
|
33028
|
+
} else {
|
33029
|
+
i2 = this.#prev[i2];
|
33030
|
+
}
|
33031
|
+
}
|
33032
|
+
}
|
33033
|
+
}
|
33034
|
+
*#rindexes({ allowStale = this.allowStale } = {}) {
|
33035
|
+
if (this.#size) {
|
33036
|
+
for (let i2 = this.#head;; ) {
|
33037
|
+
if (!this.#isValidIndex(i2)) {
|
33038
|
+
break;
|
33039
|
+
}
|
33040
|
+
if (allowStale || !this.#isStale(i2)) {
|
33041
|
+
yield i2;
|
33042
|
+
}
|
33043
|
+
if (i2 === this.#tail) {
|
33044
|
+
break;
|
33045
|
+
} else {
|
33046
|
+
i2 = this.#next[i2];
|
33047
|
+
}
|
33048
|
+
}
|
33049
|
+
}
|
33050
|
+
}
|
33051
|
+
#isValidIndex(index) {
|
33052
|
+
return index !== undefined && this.#keyMap.get(this.#keyList[index]) === index;
|
33053
|
+
}
|
33054
|
+
*entries() {
|
33055
|
+
for (const i2 of this.#indexes()) {
|
33056
|
+
if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
33057
|
+
yield [this.#keyList[i2], this.#valList[i2]];
|
33058
|
+
}
|
33059
|
+
}
|
33060
|
+
}
|
33061
|
+
*rentries() {
|
33062
|
+
for (const i2 of this.#rindexes()) {
|
33063
|
+
if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
33064
|
+
yield [this.#keyList[i2], this.#valList[i2]];
|
33065
|
+
}
|
33066
|
+
}
|
33067
|
+
}
|
33068
|
+
*keys() {
|
33069
|
+
for (const i2 of this.#indexes()) {
|
33070
|
+
const k = this.#keyList[i2];
|
33071
|
+
if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
33072
|
+
yield k;
|
33073
|
+
}
|
33074
|
+
}
|
33075
|
+
}
|
33076
|
+
*rkeys() {
|
33077
|
+
for (const i2 of this.#rindexes()) {
|
33078
|
+
const k = this.#keyList[i2];
|
33079
|
+
if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
33080
|
+
yield k;
|
33081
|
+
}
|
33082
|
+
}
|
33083
|
+
}
|
33084
|
+
*values() {
|
33085
|
+
for (const i2 of this.#indexes()) {
|
33086
|
+
const v = this.#valList[i2];
|
33087
|
+
if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
33088
|
+
yield this.#valList[i2];
|
33089
|
+
}
|
33090
|
+
}
|
33091
|
+
}
|
33092
|
+
*rvalues() {
|
33093
|
+
for (const i2 of this.#rindexes()) {
|
33094
|
+
const v = this.#valList[i2];
|
33095
|
+
if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
33096
|
+
yield this.#valList[i2];
|
33097
|
+
}
|
33098
|
+
}
|
33099
|
+
}
|
33100
|
+
[Symbol.iterator]() {
|
33101
|
+
return this.entries();
|
33102
|
+
}
|
33103
|
+
[Symbol.toStringTag] = "LRUCache";
|
33104
|
+
find(fn, getOptions = {}) {
|
33105
|
+
for (const i2 of this.#indexes()) {
|
33106
|
+
const v = this.#valList[i2];
|
33107
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
33108
|
+
if (value2 === undefined)
|
33109
|
+
continue;
|
33110
|
+
if (fn(value2, this.#keyList[i2], this)) {
|
33111
|
+
return this.get(this.#keyList[i2], getOptions);
|
33112
|
+
}
|
33113
|
+
}
|
33114
|
+
}
|
33115
|
+
forEach(fn, thisp = this) {
|
33116
|
+
for (const i2 of this.#indexes()) {
|
33117
|
+
const v = this.#valList[i2];
|
33118
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
33119
|
+
if (value2 === undefined)
|
33120
|
+
continue;
|
33121
|
+
fn.call(thisp, value2, this.#keyList[i2], this);
|
33122
|
+
}
|
33123
|
+
}
|
33124
|
+
rforEach(fn, thisp = this) {
|
33125
|
+
for (const i2 of this.#rindexes()) {
|
33126
|
+
const v = this.#valList[i2];
|
33127
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
33128
|
+
if (value2 === undefined)
|
33129
|
+
continue;
|
33130
|
+
fn.call(thisp, value2, this.#keyList[i2], this);
|
33131
|
+
}
|
33132
|
+
}
|
33133
|
+
purgeStale() {
|
33134
|
+
let deleted = false;
|
33135
|
+
for (const i2 of this.#rindexes({ allowStale: true })) {
|
33136
|
+
if (this.#isStale(i2)) {
|
33137
|
+
this.#delete(this.#keyList[i2], "expire");
|
33138
|
+
deleted = true;
|
33139
|
+
}
|
33140
|
+
}
|
33141
|
+
return deleted;
|
33142
|
+
}
|
33143
|
+
info(key2) {
|
33144
|
+
const i2 = this.#keyMap.get(key2);
|
33145
|
+
if (i2 === undefined)
|
33146
|
+
return;
|
33147
|
+
const v = this.#valList[i2];
|
33148
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
33149
|
+
if (value2 === undefined)
|
33150
|
+
return;
|
33151
|
+
const entry = { value: value2 };
|
33152
|
+
if (this.#ttls && this.#starts) {
|
33153
|
+
const ttl = this.#ttls[i2];
|
33154
|
+
const start = this.#starts[i2];
|
33155
|
+
if (ttl && start) {
|
33156
|
+
const remain = ttl - (perf2.now() - start);
|
33157
|
+
entry.ttl = remain;
|
33158
|
+
entry.start = Date.now();
|
33159
|
+
}
|
33160
|
+
}
|
33161
|
+
if (this.#sizes) {
|
33162
|
+
entry.size = this.#sizes[i2];
|
33163
|
+
}
|
33164
|
+
return entry;
|
33165
|
+
}
|
33166
|
+
dump() {
|
33167
|
+
const arr = [];
|
33168
|
+
for (const i2 of this.#indexes({ allowStale: true })) {
|
33169
|
+
const key2 = this.#keyList[i2];
|
33170
|
+
const v = this.#valList[i2];
|
33171
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
33172
|
+
if (value2 === undefined || key2 === undefined)
|
33173
|
+
continue;
|
33174
|
+
const entry = { value: value2 };
|
33175
|
+
if (this.#ttls && this.#starts) {
|
33176
|
+
entry.ttl = this.#ttls[i2];
|
33177
|
+
const age = perf2.now() - this.#starts[i2];
|
33178
|
+
entry.start = Math.floor(Date.now() - age);
|
33179
|
+
}
|
33180
|
+
if (this.#sizes) {
|
33181
|
+
entry.size = this.#sizes[i2];
|
33182
|
+
}
|
33183
|
+
arr.unshift([key2, entry]);
|
33184
|
+
}
|
33185
|
+
return arr;
|
33186
|
+
}
|
33187
|
+
load(arr) {
|
33188
|
+
this.clear();
|
33189
|
+
for (const [key2, entry] of arr) {
|
33190
|
+
if (entry.start) {
|
33191
|
+
const age = Date.now() - entry.start;
|
33192
|
+
entry.start = perf2.now() - age;
|
33193
|
+
}
|
33194
|
+
this.set(key2, entry.value, entry);
|
33195
|
+
}
|
33196
|
+
}
|
33197
|
+
set(k, v, setOptions = {}) {
|
33198
|
+
if (v === undefined) {
|
33199
|
+
this.delete(k);
|
33200
|
+
return this;
|
33201
|
+
}
|
33202
|
+
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
|
33203
|
+
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
33204
|
+
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
33205
|
+
if (this.maxEntrySize && size > this.maxEntrySize) {
|
33206
|
+
if (status) {
|
33207
|
+
status.set = "miss";
|
33208
|
+
status.maxEntrySizeExceeded = true;
|
33209
|
+
}
|
33210
|
+
this.#delete(k, "set");
|
33211
|
+
return this;
|
33212
|
+
}
|
33213
|
+
let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
|
33214
|
+
if (index === undefined) {
|
33215
|
+
index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size;
|
33216
|
+
this.#keyList[index] = k;
|
33217
|
+
this.#valList[index] = v;
|
33218
|
+
this.#keyMap.set(k, index);
|
33219
|
+
this.#next[this.#tail] = index;
|
33220
|
+
this.#prev[index] = this.#tail;
|
33221
|
+
this.#tail = index;
|
33222
|
+
this.#size++;
|
33223
|
+
this.#addItemSize(index, size, status);
|
33224
|
+
if (status)
|
33225
|
+
status.set = "add";
|
33226
|
+
noUpdateTTL = false;
|
33227
|
+
} else {
|
33228
|
+
this.#moveToTail(index);
|
33229
|
+
const oldVal = this.#valList[index];
|
33230
|
+
if (v !== oldVal) {
|
33231
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
33232
|
+
oldVal.__abortController.abort(new Error("replaced"));
|
33233
|
+
const { __staleWhileFetching: s } = oldVal;
|
33234
|
+
if (s !== undefined && !noDisposeOnSet) {
|
33235
|
+
if (this.#hasDispose) {
|
33236
|
+
this.#dispose?.(s, k, "set");
|
33237
|
+
}
|
33238
|
+
if (this.#hasDisposeAfter) {
|
33239
|
+
this.#disposed?.push([s, k, "set"]);
|
33240
|
+
}
|
33241
|
+
}
|
33242
|
+
} else if (!noDisposeOnSet) {
|
33243
|
+
if (this.#hasDispose) {
|
33244
|
+
this.#dispose?.(oldVal, k, "set");
|
33245
|
+
}
|
33246
|
+
if (this.#hasDisposeAfter) {
|
33247
|
+
this.#disposed?.push([oldVal, k, "set"]);
|
33248
|
+
}
|
33249
|
+
}
|
33250
|
+
this.#removeItemSize(index);
|
33251
|
+
this.#addItemSize(index, size, status);
|
33252
|
+
this.#valList[index] = v;
|
33253
|
+
if (status) {
|
33254
|
+
status.set = "replace";
|
33255
|
+
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
33256
|
+
if (oldValue !== undefined)
|
33257
|
+
status.oldValue = oldValue;
|
33258
|
+
}
|
33259
|
+
} else if (status) {
|
33260
|
+
status.set = "update";
|
33261
|
+
}
|
33262
|
+
}
|
33263
|
+
if (ttl !== 0 && !this.#ttls) {
|
33264
|
+
this.#initializeTTLTracking();
|
33265
|
+
}
|
33266
|
+
if (this.#ttls) {
|
33267
|
+
if (!noUpdateTTL) {
|
33268
|
+
this.#setItemTTL(index, ttl, start);
|
33269
|
+
}
|
33270
|
+
if (status)
|
33271
|
+
this.#statusTTL(status, index);
|
33272
|
+
}
|
33273
|
+
if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
33274
|
+
const dt2 = this.#disposed;
|
33275
|
+
let task;
|
33276
|
+
while (task = dt2?.shift()) {
|
33277
|
+
this.#disposeAfter?.(...task);
|
33278
|
+
}
|
33279
|
+
}
|
33280
|
+
return this;
|
33281
|
+
}
|
33282
|
+
pop() {
|
33283
|
+
try {
|
33284
|
+
while (this.#size) {
|
33285
|
+
const val = this.#valList[this.#head];
|
33286
|
+
this.#evict(true);
|
33287
|
+
if (this.#isBackgroundFetch(val)) {
|
33288
|
+
if (val.__staleWhileFetching) {
|
33289
|
+
return val.__staleWhileFetching;
|
33290
|
+
}
|
33291
|
+
} else if (val !== undefined) {
|
33292
|
+
return val;
|
33293
|
+
}
|
33294
|
+
}
|
33295
|
+
} finally {
|
33296
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
33297
|
+
const dt2 = this.#disposed;
|
33298
|
+
let task;
|
33299
|
+
while (task = dt2?.shift()) {
|
33300
|
+
this.#disposeAfter?.(...task);
|
33301
|
+
}
|
33302
|
+
}
|
33303
|
+
}
|
33304
|
+
}
|
33305
|
+
#evict(free) {
|
33306
|
+
const head = this.#head;
|
33307
|
+
const k = this.#keyList[head];
|
33308
|
+
const v = this.#valList[head];
|
33309
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
|
33310
|
+
v.__abortController.abort(new Error("evicted"));
|
33311
|
+
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
33312
|
+
if (this.#hasDispose) {
|
33313
|
+
this.#dispose?.(v, k, "evict");
|
33314
|
+
}
|
33315
|
+
if (this.#hasDisposeAfter) {
|
33316
|
+
this.#disposed?.push([v, k, "evict"]);
|
33317
|
+
}
|
33318
|
+
}
|
33319
|
+
this.#removeItemSize(head);
|
33320
|
+
if (free) {
|
33321
|
+
this.#keyList[head] = undefined;
|
33322
|
+
this.#valList[head] = undefined;
|
33323
|
+
this.#free.push(head);
|
33324
|
+
}
|
33325
|
+
if (this.#size === 1) {
|
33326
|
+
this.#head = this.#tail = 0;
|
33327
|
+
this.#free.length = 0;
|
33328
|
+
} else {
|
33329
|
+
this.#head = this.#next[head];
|
33330
|
+
}
|
33331
|
+
this.#keyMap.delete(k);
|
33332
|
+
this.#size--;
|
33333
|
+
return head;
|
33334
|
+
}
|
33335
|
+
has(k, hasOptions = {}) {
|
33336
|
+
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
33337
|
+
const index = this.#keyMap.get(k);
|
33338
|
+
if (index !== undefined) {
|
33339
|
+
const v = this.#valList[index];
|
33340
|
+
if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === undefined) {
|
33341
|
+
return false;
|
33342
|
+
}
|
33343
|
+
if (!this.#isStale(index)) {
|
33344
|
+
if (updateAgeOnHas) {
|
33345
|
+
this.#updateItemAge(index);
|
33346
|
+
}
|
33347
|
+
if (status) {
|
33348
|
+
status.has = "hit";
|
33349
|
+
this.#statusTTL(status, index);
|
33350
|
+
}
|
33351
|
+
return true;
|
33352
|
+
} else if (status) {
|
33353
|
+
status.has = "stale";
|
33354
|
+
this.#statusTTL(status, index);
|
33355
|
+
}
|
33356
|
+
} else if (status) {
|
33357
|
+
status.has = "miss";
|
33358
|
+
}
|
33359
|
+
return false;
|
33360
|
+
}
|
33361
|
+
peek(k, peekOptions = {}) {
|
33362
|
+
const { allowStale = this.allowStale } = peekOptions;
|
33363
|
+
const index = this.#keyMap.get(k);
|
33364
|
+
if (index === undefined || !allowStale && this.#isStale(index)) {
|
33365
|
+
return;
|
33366
|
+
}
|
33367
|
+
const v = this.#valList[index];
|
33368
|
+
return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
33369
|
+
}
|
33370
|
+
#backgroundFetch(k, index, options, context) {
|
33371
|
+
const v = index === undefined ? undefined : this.#valList[index];
|
33372
|
+
if (this.#isBackgroundFetch(v)) {
|
33373
|
+
return v;
|
33374
|
+
}
|
33375
|
+
const ac = new AC2;
|
33376
|
+
const { signal } = options;
|
33377
|
+
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
33378
|
+
signal: ac.signal
|
33379
|
+
});
|
33380
|
+
const fetchOpts = {
|
33381
|
+
signal: ac.signal,
|
33382
|
+
options,
|
33383
|
+
context
|
33384
|
+
};
|
33385
|
+
const cb = (v2, updateCache = false) => {
|
33386
|
+
const { aborted } = ac.signal;
|
33387
|
+
const ignoreAbort = options.ignoreFetchAbort && v2 !== undefined;
|
33388
|
+
if (options.status) {
|
33389
|
+
if (aborted && !updateCache) {
|
33390
|
+
options.status.fetchAborted = true;
|
33391
|
+
options.status.fetchError = ac.signal.reason;
|
33392
|
+
if (ignoreAbort)
|
33393
|
+
options.status.fetchAbortIgnored = true;
|
33394
|
+
} else {
|
33395
|
+
options.status.fetchResolved = true;
|
33396
|
+
}
|
33397
|
+
}
|
33398
|
+
if (aborted && !ignoreAbort && !updateCache) {
|
33399
|
+
return fetchFail(ac.signal.reason);
|
33400
|
+
}
|
33401
|
+
const bf2 = p;
|
33402
|
+
if (this.#valList[index] === p) {
|
33403
|
+
if (v2 === undefined) {
|
33404
|
+
if (bf2.__staleWhileFetching) {
|
33405
|
+
this.#valList[index] = bf2.__staleWhileFetching;
|
33406
|
+
} else {
|
33407
|
+
this.#delete(k, "fetch");
|
33408
|
+
}
|
33409
|
+
} else {
|
33410
|
+
if (options.status)
|
33411
|
+
options.status.fetchUpdated = true;
|
33412
|
+
this.set(k, v2, fetchOpts.options);
|
33413
|
+
}
|
33414
|
+
}
|
33415
|
+
return v2;
|
33416
|
+
};
|
33417
|
+
const eb = (er) => {
|
33418
|
+
if (options.status) {
|
33419
|
+
options.status.fetchRejected = true;
|
33420
|
+
options.status.fetchError = er;
|
33421
|
+
}
|
33422
|
+
return fetchFail(er);
|
33423
|
+
};
|
33424
|
+
const fetchFail = (er) => {
|
33425
|
+
const { aborted } = ac.signal;
|
33426
|
+
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
|
33427
|
+
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
33428
|
+
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
33429
|
+
const bf2 = p;
|
33430
|
+
if (this.#valList[index] === p) {
|
33431
|
+
const del = !noDelete || bf2.__staleWhileFetching === undefined;
|
33432
|
+
if (del) {
|
33433
|
+
this.#delete(k, "fetch");
|
33434
|
+
} else if (!allowStaleAborted) {
|
33435
|
+
this.#valList[index] = bf2.__staleWhileFetching;
|
33436
|
+
}
|
33437
|
+
}
|
33438
|
+
if (allowStale) {
|
33439
|
+
if (options.status && bf2.__staleWhileFetching !== undefined) {
|
33440
|
+
options.status.returnedStale = true;
|
33441
|
+
}
|
33442
|
+
return bf2.__staleWhileFetching;
|
33443
|
+
} else if (bf2.__returned === bf2) {
|
33444
|
+
throw er;
|
33445
|
+
}
|
33446
|
+
};
|
33447
|
+
const pcall = (res, rej) => {
|
33448
|
+
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
33449
|
+
if (fmp && fmp instanceof Promise) {
|
33450
|
+
fmp.then((v2) => res(v2 === undefined ? undefined : v2), rej);
|
33451
|
+
}
|
33452
|
+
ac.signal.addEventListener("abort", () => {
|
33453
|
+
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
33454
|
+
res(undefined);
|
33455
|
+
if (options.allowStaleOnFetchAbort) {
|
33456
|
+
res = (v2) => cb(v2, true);
|
33457
|
+
}
|
33458
|
+
}
|
33459
|
+
});
|
33460
|
+
};
|
33461
|
+
if (options.status)
|
33462
|
+
options.status.fetchDispatched = true;
|
33463
|
+
const p = new Promise(pcall).then(cb, eb);
|
33464
|
+
const bf = Object.assign(p, {
|
33465
|
+
__abortController: ac,
|
33466
|
+
__staleWhileFetching: v,
|
33467
|
+
__returned: undefined
|
33468
|
+
});
|
33469
|
+
if (index === undefined) {
|
33470
|
+
this.set(k, bf, { ...fetchOpts.options, status: undefined });
|
33471
|
+
index = this.#keyMap.get(k);
|
33472
|
+
} else {
|
33473
|
+
this.#valList[index] = bf;
|
33474
|
+
}
|
33475
|
+
return bf;
|
33476
|
+
}
|
33477
|
+
#isBackgroundFetch(p) {
|
33478
|
+
if (!this.#hasFetchMethod)
|
33479
|
+
return false;
|
33480
|
+
const b = p;
|
33481
|
+
return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC2;
|
33482
|
+
}
|
33483
|
+
async fetch(k, fetchOptions = {}) {
|
33484
|
+
const {
|
33485
|
+
allowStale = this.allowStale,
|
33486
|
+
updateAgeOnGet = this.updateAgeOnGet,
|
33487
|
+
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
33488
|
+
ttl = this.ttl,
|
33489
|
+
noDisposeOnSet = this.noDisposeOnSet,
|
33490
|
+
size = 0,
|
33491
|
+
sizeCalculation = this.sizeCalculation,
|
33492
|
+
noUpdateTTL = this.noUpdateTTL,
|
33493
|
+
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
33494
|
+
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
33495
|
+
ignoreFetchAbort = this.ignoreFetchAbort,
|
33496
|
+
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
33497
|
+
context,
|
33498
|
+
forceRefresh = false,
|
33499
|
+
status,
|
33500
|
+
signal
|
33501
|
+
} = fetchOptions;
|
33502
|
+
if (!this.#hasFetchMethod) {
|
33503
|
+
if (status)
|
33504
|
+
status.fetch = "get";
|
33505
|
+
return this.get(k, {
|
33506
|
+
allowStale,
|
33507
|
+
updateAgeOnGet,
|
33508
|
+
noDeleteOnStaleGet,
|
33509
|
+
status
|
33510
|
+
});
|
33511
|
+
}
|
33512
|
+
const options = {
|
33513
|
+
allowStale,
|
33514
|
+
updateAgeOnGet,
|
33515
|
+
noDeleteOnStaleGet,
|
33516
|
+
ttl,
|
33517
|
+
noDisposeOnSet,
|
33518
|
+
size,
|
33519
|
+
sizeCalculation,
|
33520
|
+
noUpdateTTL,
|
33521
|
+
noDeleteOnFetchRejection,
|
33522
|
+
allowStaleOnFetchRejection,
|
33523
|
+
allowStaleOnFetchAbort,
|
33524
|
+
ignoreFetchAbort,
|
33525
|
+
status,
|
33526
|
+
signal
|
33527
|
+
};
|
33528
|
+
let index = this.#keyMap.get(k);
|
33529
|
+
if (index === undefined) {
|
33530
|
+
if (status)
|
33531
|
+
status.fetch = "miss";
|
33532
|
+
const p = this.#backgroundFetch(k, index, options, context);
|
33533
|
+
return p.__returned = p;
|
33534
|
+
} else {
|
33535
|
+
const v = this.#valList[index];
|
33536
|
+
if (this.#isBackgroundFetch(v)) {
|
33537
|
+
const stale = allowStale && v.__staleWhileFetching !== undefined;
|
33538
|
+
if (status) {
|
33539
|
+
status.fetch = "inflight";
|
33540
|
+
if (stale)
|
33541
|
+
status.returnedStale = true;
|
33542
|
+
}
|
33543
|
+
return stale ? v.__staleWhileFetching : v.__returned = v;
|
33544
|
+
}
|
33545
|
+
const isStale = this.#isStale(index);
|
33546
|
+
if (!forceRefresh && !isStale) {
|
33547
|
+
if (status)
|
33548
|
+
status.fetch = "hit";
|
33549
|
+
this.#moveToTail(index);
|
33550
|
+
if (updateAgeOnGet) {
|
33551
|
+
this.#updateItemAge(index);
|
33552
|
+
}
|
33553
|
+
if (status)
|
33554
|
+
this.#statusTTL(status, index);
|
33555
|
+
return v;
|
33556
|
+
}
|
33557
|
+
const p = this.#backgroundFetch(k, index, options, context);
|
33558
|
+
const hasStale = p.__staleWhileFetching !== undefined;
|
33559
|
+
const staleVal = hasStale && allowStale;
|
33560
|
+
if (status) {
|
33561
|
+
status.fetch = isStale ? "stale" : "refresh";
|
33562
|
+
if (staleVal && isStale)
|
33563
|
+
status.returnedStale = true;
|
33564
|
+
}
|
33565
|
+
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
33566
|
+
}
|
33567
|
+
}
|
33568
|
+
async forceFetch(k, fetchOptions = {}) {
|
33569
|
+
const v = await this.fetch(k, fetchOptions);
|
33570
|
+
if (v === undefined)
|
33571
|
+
throw new Error("fetch() returned undefined");
|
33572
|
+
return v;
|
33573
|
+
}
|
33574
|
+
memo(k, memoOptions = {}) {
|
33575
|
+
const memoMethod = this.#memoMethod;
|
33576
|
+
if (!memoMethod) {
|
33577
|
+
throw new Error("no memoMethod provided to constructor");
|
33578
|
+
}
|
33579
|
+
const { context, forceRefresh, ...options } = memoOptions;
|
33580
|
+
const v = this.get(k, options);
|
33581
|
+
if (!forceRefresh && v !== undefined)
|
33582
|
+
return v;
|
33583
|
+
const vv = memoMethod(k, v, {
|
33584
|
+
options,
|
33585
|
+
context
|
33586
|
+
});
|
33587
|
+
this.set(k, vv, options);
|
33588
|
+
return vv;
|
33589
|
+
}
|
33590
|
+
get(k, getOptions = {}) {
|
33591
|
+
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
|
33592
|
+
const index = this.#keyMap.get(k);
|
33593
|
+
if (index !== undefined) {
|
33594
|
+
const value2 = this.#valList[index];
|
33595
|
+
const fetching = this.#isBackgroundFetch(value2);
|
33596
|
+
if (status)
|
33597
|
+
this.#statusTTL(status, index);
|
33598
|
+
if (this.#isStale(index)) {
|
33599
|
+
if (status)
|
33600
|
+
status.get = "stale";
|
33601
|
+
if (!fetching) {
|
33602
|
+
if (!noDeleteOnStaleGet) {
|
33603
|
+
this.#delete(k, "expire");
|
33604
|
+
}
|
33605
|
+
if (status && allowStale)
|
33606
|
+
status.returnedStale = true;
|
33607
|
+
return allowStale ? value2 : undefined;
|
33608
|
+
} else {
|
33609
|
+
if (status && allowStale && value2.__staleWhileFetching !== undefined) {
|
33610
|
+
status.returnedStale = true;
|
33611
|
+
}
|
33612
|
+
return allowStale ? value2.__staleWhileFetching : undefined;
|
33613
|
+
}
|
33614
|
+
} else {
|
33615
|
+
if (status)
|
33616
|
+
status.get = "hit";
|
33617
|
+
if (fetching) {
|
33618
|
+
return value2.__staleWhileFetching;
|
33619
|
+
}
|
33620
|
+
this.#moveToTail(index);
|
33621
|
+
if (updateAgeOnGet) {
|
33622
|
+
this.#updateItemAge(index);
|
33623
|
+
}
|
33624
|
+
return value2;
|
33625
|
+
}
|
33626
|
+
} else if (status) {
|
33627
|
+
status.get = "miss";
|
33628
|
+
}
|
33629
|
+
}
|
33630
|
+
#connect(p, n2) {
|
33631
|
+
this.#prev[n2] = p;
|
33632
|
+
this.#next[p] = n2;
|
33633
|
+
}
|
33634
|
+
#moveToTail(index) {
|
33635
|
+
if (index !== this.#tail) {
|
33636
|
+
if (index === this.#head) {
|
33637
|
+
this.#head = this.#next[index];
|
33638
|
+
} else {
|
33639
|
+
this.#connect(this.#prev[index], this.#next[index]);
|
33640
|
+
}
|
33641
|
+
this.#connect(this.#tail, index);
|
33642
|
+
this.#tail = index;
|
33643
|
+
}
|
33644
|
+
}
|
33645
|
+
delete(k) {
|
33646
|
+
return this.#delete(k, "delete");
|
33647
|
+
}
|
33648
|
+
#delete(k, reason) {
|
33649
|
+
let deleted = false;
|
33650
|
+
if (this.#size !== 0) {
|
33651
|
+
const index = this.#keyMap.get(k);
|
33652
|
+
if (index !== undefined) {
|
33653
|
+
deleted = true;
|
33654
|
+
if (this.#size === 1) {
|
33655
|
+
this.#clear(reason);
|
33656
|
+
} else {
|
33657
|
+
this.#removeItemSize(index);
|
33658
|
+
const v = this.#valList[index];
|
33659
|
+
if (this.#isBackgroundFetch(v)) {
|
33660
|
+
v.__abortController.abort(new Error("deleted"));
|
33661
|
+
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
33662
|
+
if (this.#hasDispose) {
|
33663
|
+
this.#dispose?.(v, k, reason);
|
33664
|
+
}
|
33665
|
+
if (this.#hasDisposeAfter) {
|
33666
|
+
this.#disposed?.push([v, k, reason]);
|
33667
|
+
}
|
33668
|
+
}
|
33669
|
+
this.#keyMap.delete(k);
|
33670
|
+
this.#keyList[index] = undefined;
|
33671
|
+
this.#valList[index] = undefined;
|
33672
|
+
if (index === this.#tail) {
|
33673
|
+
this.#tail = this.#prev[index];
|
33674
|
+
} else if (index === this.#head) {
|
33675
|
+
this.#head = this.#next[index];
|
33676
|
+
} else {
|
33677
|
+
const pi = this.#prev[index];
|
33678
|
+
this.#next[pi] = this.#next[index];
|
33679
|
+
const ni = this.#next[index];
|
33680
|
+
this.#prev[ni] = this.#prev[index];
|
33681
|
+
}
|
33682
|
+
this.#size--;
|
33683
|
+
this.#free.push(index);
|
33684
|
+
}
|
33685
|
+
}
|
33686
|
+
}
|
33687
|
+
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
33688
|
+
const dt2 = this.#disposed;
|
33689
|
+
let task;
|
33690
|
+
while (task = dt2?.shift()) {
|
33691
|
+
this.#disposeAfter?.(...task);
|
33692
|
+
}
|
33693
|
+
}
|
33694
|
+
return deleted;
|
33695
|
+
}
|
33696
|
+
clear() {
|
33697
|
+
return this.#clear("delete");
|
33698
|
+
}
|
33699
|
+
#clear(reason) {
|
33700
|
+
for (const index of this.#rindexes({ allowStale: true })) {
|
33701
|
+
const v = this.#valList[index];
|
33702
|
+
if (this.#isBackgroundFetch(v)) {
|
33703
|
+
v.__abortController.abort(new Error("deleted"));
|
33704
|
+
} else {
|
33705
|
+
const k = this.#keyList[index];
|
33706
|
+
if (this.#hasDispose) {
|
33707
|
+
this.#dispose?.(v, k, reason);
|
33708
|
+
}
|
33709
|
+
if (this.#hasDisposeAfter) {
|
33710
|
+
this.#disposed?.push([v, k, reason]);
|
33711
|
+
}
|
33712
|
+
}
|
33713
|
+
}
|
33714
|
+
this.#keyMap.clear();
|
33715
|
+
this.#valList.fill(undefined);
|
33716
|
+
this.#keyList.fill(undefined);
|
33717
|
+
if (this.#ttls && this.#starts) {
|
33718
|
+
this.#ttls.fill(0);
|
33719
|
+
this.#starts.fill(0);
|
33720
|
+
}
|
33721
|
+
if (this.#sizes) {
|
33722
|
+
this.#sizes.fill(0);
|
33723
|
+
}
|
33724
|
+
this.#head = 0;
|
33725
|
+
this.#tail = 0;
|
33726
|
+
this.#free.length = 0;
|
33727
|
+
this.#calculatedSize = 0;
|
33728
|
+
this.#size = 0;
|
33729
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
33730
|
+
const dt2 = this.#disposed;
|
33731
|
+
let task;
|
33732
|
+
while (task = dt2?.shift()) {
|
33733
|
+
this.#disposeAfter?.(...task);
|
33734
|
+
}
|
33735
|
+
}
|
33736
|
+
}
|
33737
|
+
}
|
33738
|
+
exports.LRUCache = LRUCache2;
|
33739
|
+
});
|
33740
|
+
|
33741
|
+
// ../../node_modules/minipass/dist/commonjs/index.js
|
33742
|
+
var require_commonjs4 = __commonJS((exports) => {
|
32628
33743
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
32629
33744
|
return mod && mod.__esModule ? mod : { default: mod };
|
32630
33745
|
};
|
@@ -33296,7 +34411,7 @@ var require_commonjs3 = __commonJS((exports) => {
|
|
33296
34411
|
});
|
33297
34412
|
|
33298
34413
|
// ../../node_modules/path-scurry/dist/commonjs/index.js
|
33299
|
-
var
|
34414
|
+
var require_commonjs5 = __commonJS((exports) => {
|
33300
34415
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o2, m, k, k2) {
|
33301
34416
|
if (k2 === undefined)
|
33302
34417
|
k2 = k;
|
@@ -33331,14 +34446,14 @@ var require_commonjs4 = __commonJS((exports) => {
|
|
33331
34446
|
};
|
33332
34447
|
Object.defineProperty(exports, "__esModule", { value: true });
|
33333
34448
|
exports.PathScurry = exports.Path = exports.PathScurryDarwin = exports.PathScurryPosix = exports.PathScurryWin32 = exports.PathScurryBase = exports.PathPosix = exports.PathWin32 = exports.PathBase = exports.ChildrenCache = exports.ResolveCache = undefined;
|
33334
|
-
var lru_cache_1 =
|
34449
|
+
var lru_cache_1 = require_commonjs3();
|
33335
34450
|
var node_path_1 = __require("node:path");
|
33336
34451
|
var node_url_1 = __require("node:url");
|
33337
34452
|
var fs_1 = __require("fs");
|
33338
34453
|
var actualFS2 = __importStar(__require("node:fs"));
|
33339
34454
|
var realpathSync2 = fs_1.realpathSync.native;
|
33340
34455
|
var promises_1 = __require("node:fs/promises");
|
33341
|
-
var minipass_1 =
|
34456
|
+
var minipass_1 = require_commonjs4();
|
33342
34457
|
var defaultFS2 = {
|
33343
34458
|
lstatSync: fs_1.lstatSync,
|
33344
34459
|
readdir: fs_1.readdir,
|
@@ -35096,7 +36211,7 @@ var require_processor = __commonJS((exports) => {
|
|
35096
36211
|
var require_walker2 = __commonJS((exports) => {
|
35097
36212
|
Object.defineProperty(exports, "__esModule", { value: true });
|
35098
36213
|
exports.GlobStream = exports.GlobWalker = exports.GlobUtil = undefined;
|
35099
|
-
var minipass_1 =
|
36214
|
+
var minipass_1 = require_commonjs4();
|
35100
36215
|
var ignore_js_1 = require_ignore2();
|
35101
36216
|
var processor_js_1 = require_processor();
|
35102
36217
|
var makeIgnore2 = (ignore, opts) => typeof ignore === "string" ? new ignore_js_1.Ignore([ignore], opts) : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore;
|
@@ -35435,7 +36550,7 @@ var require_glob = __commonJS((exports) => {
|
|
35435
36550
|
exports.Glob = undefined;
|
35436
36551
|
var minimatch_1 = require_commonjs2();
|
35437
36552
|
var node_url_1 = __require("node:url");
|
35438
|
-
var path_scurry_1 =
|
36553
|
+
var path_scurry_1 = require_commonjs5();
|
35439
36554
|
var pattern_js_1 = require_pattern();
|
35440
36555
|
var walker_js_1 = require_walker2();
|
35441
36556
|
var defaultPlatform4 = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux";
|
@@ -35632,7 +36747,7 @@ var require_has_magic = __commonJS((exports) => {
|
|
35632
36747
|
});
|
35633
36748
|
|
35634
36749
|
// ../../node_modules/glob/dist/commonjs/index.js
|
35635
|
-
var
|
36750
|
+
var require_commonjs6 = __commonJS((exports) => {
|
35636
36751
|
Object.defineProperty(exports, "__esModule", { value: true });
|
35637
36752
|
exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = undefined;
|
35638
36753
|
exports.globStreamSync = globStreamSync2;
|
@@ -36390,454 +37505,1569 @@ var require_retry = __commonJS((exports) => {
|
|
36390
37505
|
}
|
36391
37506
|
}
|
36392
37507
|
}
|
36393
|
-
for (var i2 = 0;i2 < methods.length; i2++) {
|
36394
|
-
var method = methods[i2];
|
36395
|
-
var original = obj[method];
|
36396
|
-
obj[method] = function retryWrapper(original2) {
|
36397
|
-
var op = exports.operation(options);
|
36398
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
36399
|
-
var callback = args.pop();
|
36400
|
-
args.push(function(err) {
|
36401
|
-
if (op.retry(err)) {
|
36402
|
-
return;
|
36403
|
-
}
|
36404
|
-
if (err) {
|
36405
|
-
arguments[0] = op.mainError();
|
36406
|
-
}
|
36407
|
-
callback.apply(this, arguments);
|
36408
|
-
});
|
36409
|
-
op.attempt(function() {
|
36410
|
-
original2.apply(obj, args);
|
36411
|
-
});
|
36412
|
-
}.bind(obj, original);
|
36413
|
-
obj[method].options = options;
|
36414
|
-
}
|
36415
|
-
};
|
36416
|
-
});
|
36417
|
-
|
36418
|
-
// ../../node_modules/promise-retry/index.js
|
36419
|
-
var require_promise_retry = __commonJS((exports, module) => {
|
36420
|
-
var errcode = require_err_code();
|
36421
|
-
var retry = require_retry();
|
36422
|
-
var hasOwn = Object.prototype.hasOwnProperty;
|
36423
|
-
function isRetryError(err) {
|
36424
|
-
return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
|
36425
|
-
}
|
36426
|
-
function promiseRetry(fn, options) {
|
36427
|
-
var temp;
|
36428
|
-
var operation;
|
36429
|
-
if (typeof fn === "object" && typeof options === "function") {
|
36430
|
-
temp = options;
|
36431
|
-
options = fn;
|
36432
|
-
fn = temp;
|
37508
|
+
for (var i2 = 0;i2 < methods.length; i2++) {
|
37509
|
+
var method = methods[i2];
|
37510
|
+
var original = obj[method];
|
37511
|
+
obj[method] = function retryWrapper(original2) {
|
37512
|
+
var op = exports.operation(options);
|
37513
|
+
var args = Array.prototype.slice.call(arguments, 1);
|
37514
|
+
var callback = args.pop();
|
37515
|
+
args.push(function(err) {
|
37516
|
+
if (op.retry(err)) {
|
37517
|
+
return;
|
37518
|
+
}
|
37519
|
+
if (err) {
|
37520
|
+
arguments[0] = op.mainError();
|
37521
|
+
}
|
37522
|
+
callback.apply(this, arguments);
|
37523
|
+
});
|
37524
|
+
op.attempt(function() {
|
37525
|
+
original2.apply(obj, args);
|
37526
|
+
});
|
37527
|
+
}.bind(obj, original);
|
37528
|
+
obj[method].options = options;
|
37529
|
+
}
|
37530
|
+
};
|
37531
|
+
});
|
37532
|
+
|
37533
|
+
// ../../node_modules/promise-retry/index.js
|
37534
|
+
var require_promise_retry = __commonJS((exports, module) => {
|
37535
|
+
var errcode = require_err_code();
|
37536
|
+
var retry = require_retry();
|
37537
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
37538
|
+
function isRetryError(err) {
|
37539
|
+
return err && err.code === "EPROMISERETRY" && hasOwn.call(err, "retried");
|
37540
|
+
}
|
37541
|
+
function promiseRetry(fn, options) {
|
37542
|
+
var temp;
|
37543
|
+
var operation;
|
37544
|
+
if (typeof fn === "object" && typeof options === "function") {
|
37545
|
+
temp = options;
|
37546
|
+
options = fn;
|
37547
|
+
fn = temp;
|
37548
|
+
}
|
37549
|
+
operation = retry.operation(options);
|
37550
|
+
return new Promise(function(resolve2, reject) {
|
37551
|
+
operation.attempt(function(number) {
|
37552
|
+
Promise.resolve().then(function() {
|
37553
|
+
return fn(function(err) {
|
37554
|
+
if (isRetryError(err)) {
|
37555
|
+
err = err.retried;
|
37556
|
+
}
|
37557
|
+
throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
|
37558
|
+
}, number);
|
37559
|
+
}).then(resolve2, function(err) {
|
37560
|
+
if (isRetryError(err)) {
|
37561
|
+
err = err.retried;
|
37562
|
+
if (operation.retry(err || new Error)) {
|
37563
|
+
return;
|
37564
|
+
}
|
37565
|
+
}
|
37566
|
+
reject(err);
|
37567
|
+
});
|
37568
|
+
});
|
37569
|
+
});
|
37570
|
+
}
|
37571
|
+
module.exports = promiseRetry;
|
37572
|
+
});
|
37573
|
+
|
37574
|
+
// ../../node_modules/@npmcli/git/lib/errors.js
|
37575
|
+
var require_errors2 = __commonJS((exports, module) => {
|
37576
|
+
var maxRetry = 3;
|
37577
|
+
|
37578
|
+
class GitError extends Error {
|
37579
|
+
shouldRetry() {
|
37580
|
+
return false;
|
37581
|
+
}
|
37582
|
+
}
|
37583
|
+
|
37584
|
+
class GitConnectionError extends GitError {
|
37585
|
+
constructor() {
|
37586
|
+
super("A git connection error occurred");
|
37587
|
+
}
|
37588
|
+
shouldRetry(number) {
|
37589
|
+
return number < maxRetry;
|
37590
|
+
}
|
37591
|
+
}
|
37592
|
+
|
37593
|
+
class GitPathspecError extends GitError {
|
37594
|
+
constructor() {
|
37595
|
+
super("The git reference could not be found");
|
37596
|
+
}
|
37597
|
+
}
|
37598
|
+
|
37599
|
+
class GitUnknownError extends GitError {
|
37600
|
+
constructor() {
|
37601
|
+
super("An unknown git error occurred");
|
37602
|
+
}
|
37603
|
+
}
|
37604
|
+
module.exports = {
|
37605
|
+
GitConnectionError,
|
37606
|
+
GitPathspecError,
|
37607
|
+
GitUnknownError
|
37608
|
+
};
|
37609
|
+
});
|
37610
|
+
|
37611
|
+
// ../../node_modules/@npmcli/git/lib/make-error.js
|
37612
|
+
var require_make_error = __commonJS((exports, module) => {
|
37613
|
+
var {
|
37614
|
+
GitConnectionError,
|
37615
|
+
GitPathspecError,
|
37616
|
+
GitUnknownError
|
37617
|
+
} = require_errors2();
|
37618
|
+
var connectionErrorRe = new RegExp([
|
37619
|
+
"remote error: Internal Server Error",
|
37620
|
+
"The remote end hung up unexpectedly",
|
37621
|
+
"Connection timed out",
|
37622
|
+
"Operation timed out",
|
37623
|
+
"Failed to connect to .* Timed out",
|
37624
|
+
"Connection reset by peer",
|
37625
|
+
"SSL_ERROR_SYSCALL",
|
37626
|
+
"The requested URL returned error: 503"
|
37627
|
+
].join("|"));
|
37628
|
+
var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
|
37629
|
+
function makeError(er) {
|
37630
|
+
const message = er.stderr;
|
37631
|
+
let gitEr;
|
37632
|
+
if (connectionErrorRe.test(message)) {
|
37633
|
+
gitEr = new GitConnectionError(message);
|
37634
|
+
} else if (missingPathspecRe.test(message)) {
|
37635
|
+
gitEr = new GitPathspecError(message);
|
37636
|
+
} else {
|
37637
|
+
gitEr = new GitUnknownError(message);
|
37638
|
+
}
|
37639
|
+
return Object.assign(gitEr, er);
|
37640
|
+
}
|
37641
|
+
module.exports = makeError;
|
37642
|
+
});
|
37643
|
+
|
37644
|
+
// ../../node_modules/ini/lib/ini.js
|
37645
|
+
var require_ini = __commonJS((exports, module) => {
|
37646
|
+
var { hasOwnProperty } = Object.prototype;
|
37647
|
+
var encode = (obj, opt = {}) => {
|
37648
|
+
if (typeof opt === "string") {
|
37649
|
+
opt = { section: opt };
|
37650
|
+
}
|
37651
|
+
opt.align = opt.align === true;
|
37652
|
+
opt.newline = opt.newline === true;
|
37653
|
+
opt.sort = opt.sort === true;
|
37654
|
+
opt.whitespace = opt.whitespace === true || opt.align === true;
|
37655
|
+
opt.platform = opt.platform || typeof process !== "undefined" && process.platform;
|
37656
|
+
opt.bracketedArray = opt.bracketedArray !== false;
|
37657
|
+
const eol = opt.platform === "win32" ? `\r
|
37658
|
+
` : `
|
37659
|
+
`;
|
37660
|
+
const separator = opt.whitespace ? " = " : "=";
|
37661
|
+
const children = [];
|
37662
|
+
const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
|
37663
|
+
let padToChars = 0;
|
37664
|
+
if (opt.align) {
|
37665
|
+
padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a3, b) => safe(a3).length >= safe(b).length ? a3 : b)).length;
|
37666
|
+
}
|
37667
|
+
let out = "";
|
37668
|
+
const arraySuffix = opt.bracketedArray ? "[]" : "";
|
37669
|
+
for (const k of keys) {
|
37670
|
+
const val = obj[k];
|
37671
|
+
if (val && Array.isArray(val)) {
|
37672
|
+
for (const item of val) {
|
37673
|
+
out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
|
37674
|
+
}
|
37675
|
+
} else if (val && typeof val === "object") {
|
37676
|
+
children.push(k);
|
37677
|
+
} else {
|
37678
|
+
out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
|
37679
|
+
}
|
37680
|
+
}
|
37681
|
+
if (opt.section && out.length) {
|
37682
|
+
out = "[" + safe(opt.section) + "]" + (opt.newline ? eol + eol : eol) + out;
|
37683
|
+
}
|
37684
|
+
for (const k of children) {
|
37685
|
+
const nk = splitSections(k, ".").join("\\.");
|
37686
|
+
const section = (opt.section ? opt.section + "." : "") + nk;
|
37687
|
+
const child = encode(obj[k], {
|
37688
|
+
...opt,
|
37689
|
+
section
|
37690
|
+
});
|
37691
|
+
if (out.length && child.length) {
|
37692
|
+
out += eol;
|
37693
|
+
}
|
37694
|
+
out += child;
|
37695
|
+
}
|
37696
|
+
return out;
|
37697
|
+
};
|
37698
|
+
function splitSections(str, separator) {
|
37699
|
+
var lastMatchIndex = 0;
|
37700
|
+
var lastSeparatorIndex = 0;
|
37701
|
+
var nextIndex = 0;
|
37702
|
+
var sections = [];
|
37703
|
+
do {
|
37704
|
+
nextIndex = str.indexOf(separator, lastMatchIndex);
|
37705
|
+
if (nextIndex !== -1) {
|
37706
|
+
lastMatchIndex = nextIndex + separator.length;
|
37707
|
+
if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
|
37708
|
+
continue;
|
37709
|
+
}
|
37710
|
+
sections.push(str.slice(lastSeparatorIndex, nextIndex));
|
37711
|
+
lastSeparatorIndex = nextIndex + separator.length;
|
37712
|
+
}
|
37713
|
+
} while (nextIndex !== -1);
|
37714
|
+
sections.push(str.slice(lastSeparatorIndex));
|
37715
|
+
return sections;
|
37716
|
+
}
|
37717
|
+
var decode = (str, opt = {}) => {
|
37718
|
+
opt.bracketedArray = opt.bracketedArray !== false;
|
37719
|
+
const out = Object.create(null);
|
37720
|
+
let p = out;
|
37721
|
+
let section = null;
|
37722
|
+
const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
|
37723
|
+
const lines2 = str.split(/[\r\n]+/g);
|
37724
|
+
const duplicates = {};
|
37725
|
+
for (const line of lines2) {
|
37726
|
+
if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
|
37727
|
+
continue;
|
37728
|
+
}
|
37729
|
+
const match2 = line.match(re);
|
37730
|
+
if (!match2) {
|
37731
|
+
continue;
|
37732
|
+
}
|
37733
|
+
if (match2[1] !== undefined) {
|
37734
|
+
section = unsafe(match2[1]);
|
37735
|
+
if (section === "__proto__") {
|
37736
|
+
p = Object.create(null);
|
37737
|
+
continue;
|
37738
|
+
}
|
37739
|
+
p = out[section] = out[section] || Object.create(null);
|
37740
|
+
continue;
|
37741
|
+
}
|
37742
|
+
const keyRaw = unsafe(match2[2]);
|
37743
|
+
let isArray;
|
37744
|
+
if (opt.bracketedArray) {
|
37745
|
+
isArray = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
|
37746
|
+
} else {
|
37747
|
+
duplicates[keyRaw] = (duplicates?.[keyRaw] || 0) + 1;
|
37748
|
+
isArray = duplicates[keyRaw] > 1;
|
37749
|
+
}
|
37750
|
+
const key2 = isArray && keyRaw.endsWith("[]") ? keyRaw.slice(0, -2) : keyRaw;
|
37751
|
+
if (key2 === "__proto__") {
|
37752
|
+
continue;
|
37753
|
+
}
|
37754
|
+
const valueRaw = match2[3] ? unsafe(match2[4]) : true;
|
37755
|
+
const value2 = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
|
37756
|
+
if (isArray) {
|
37757
|
+
if (!hasOwnProperty.call(p, key2)) {
|
37758
|
+
p[key2] = [];
|
37759
|
+
} else if (!Array.isArray(p[key2])) {
|
37760
|
+
p[key2] = [p[key2]];
|
37761
|
+
}
|
37762
|
+
}
|
37763
|
+
if (Array.isArray(p[key2])) {
|
37764
|
+
p[key2].push(value2);
|
37765
|
+
} else {
|
37766
|
+
p[key2] = value2;
|
37767
|
+
}
|
37768
|
+
}
|
37769
|
+
const remove = [];
|
37770
|
+
for (const k of Object.keys(out)) {
|
37771
|
+
if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k])) {
|
37772
|
+
continue;
|
37773
|
+
}
|
37774
|
+
const parts = splitSections(k, ".");
|
37775
|
+
p = out;
|
37776
|
+
const l2 = parts.pop();
|
37777
|
+
const nl = l2.replace(/\\\./g, ".");
|
37778
|
+
for (const part of parts) {
|
37779
|
+
if (part === "__proto__") {
|
37780
|
+
continue;
|
37781
|
+
}
|
37782
|
+
if (!hasOwnProperty.call(p, part) || typeof p[part] !== "object") {
|
37783
|
+
p[part] = Object.create(null);
|
37784
|
+
}
|
37785
|
+
p = p[part];
|
37786
|
+
}
|
37787
|
+
if (p === out && nl === l2) {
|
37788
|
+
continue;
|
37789
|
+
}
|
37790
|
+
p[nl] = out[k];
|
37791
|
+
remove.push(k);
|
37792
|
+
}
|
37793
|
+
for (const del of remove) {
|
37794
|
+
delete out[del];
|
37795
|
+
}
|
37796
|
+
return out;
|
37797
|
+
};
|
37798
|
+
var isQuoted = (val) => {
|
37799
|
+
return val.startsWith('"') && val.endsWith('"') || val.startsWith("'") && val.endsWith("'");
|
37800
|
+
};
|
37801
|
+
var safe = (val) => {
|
37802
|
+
if (typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim()) {
|
37803
|
+
return JSON.stringify(val);
|
37804
|
+
}
|
37805
|
+
return val.split(";").join("\\;").split("#").join("\\#");
|
37806
|
+
};
|
37807
|
+
var unsafe = (val) => {
|
37808
|
+
val = (val || "").trim();
|
37809
|
+
if (isQuoted(val)) {
|
37810
|
+
if (val.charAt(0) === "'") {
|
37811
|
+
val = val.slice(1, -1);
|
37812
|
+
}
|
37813
|
+
try {
|
37814
|
+
val = JSON.parse(val);
|
37815
|
+
} catch {}
|
37816
|
+
} else {
|
37817
|
+
let esc = false;
|
37818
|
+
let unesc = "";
|
37819
|
+
for (let i2 = 0, l2 = val.length;i2 < l2; i2++) {
|
37820
|
+
const c = val.charAt(i2);
|
37821
|
+
if (esc) {
|
37822
|
+
if ("\\;#".indexOf(c) !== -1) {
|
37823
|
+
unesc += c;
|
37824
|
+
} else {
|
37825
|
+
unesc += "\\" + c;
|
37826
|
+
}
|
37827
|
+
esc = false;
|
37828
|
+
} else if (";#".indexOf(c) !== -1) {
|
37829
|
+
break;
|
37830
|
+
} else if (c === "\\") {
|
37831
|
+
esc = true;
|
37832
|
+
} else {
|
37833
|
+
unesc += c;
|
37834
|
+
}
|
37835
|
+
}
|
37836
|
+
if (esc) {
|
37837
|
+
unesc += "\\";
|
37838
|
+
}
|
37839
|
+
return unesc.trim();
|
37840
|
+
}
|
37841
|
+
return val;
|
37842
|
+
};
|
37843
|
+
module.exports = {
|
37844
|
+
parse: decode,
|
37845
|
+
decode,
|
37846
|
+
stringify: encode,
|
37847
|
+
encode,
|
37848
|
+
safe,
|
37849
|
+
unsafe
|
37850
|
+
};
|
37851
|
+
});
|
37852
|
+
|
37853
|
+
// ../../node_modules/@npmcli/git/lib/opts.js
|
37854
|
+
var require_opts = __commonJS((exports, module) => {
|
37855
|
+
var fs4 = __require("node:fs");
|
37856
|
+
var os = __require("node:os");
|
37857
|
+
var path6 = __require("node:path");
|
37858
|
+
var ini = require_ini();
|
37859
|
+
var gitConfigPath = path6.join(os.homedir(), ".gitconfig");
|
37860
|
+
var cachedConfig = null;
|
37861
|
+
var loadGitConfig = () => {
|
37862
|
+
if (cachedConfig === null) {
|
37863
|
+
try {
|
37864
|
+
cachedConfig = {};
|
37865
|
+
if (fs4.existsSync(gitConfigPath)) {
|
37866
|
+
const configContent = fs4.readFileSync(gitConfigPath, "utf-8");
|
37867
|
+
cachedConfig = ini.parse(configContent);
|
37868
|
+
}
|
37869
|
+
} catch (error2) {
|
37870
|
+
cachedConfig = {};
|
37871
|
+
}
|
37872
|
+
}
|
37873
|
+
return cachedConfig;
|
37874
|
+
};
|
37875
|
+
var checkGitConfigs = () => {
|
37876
|
+
const config3 = loadGitConfig();
|
37877
|
+
return {
|
37878
|
+
sshCommandSetInConfig: config3?.core?.sshCommand !== undefined,
|
37879
|
+
askPassSetInConfig: config3?.core?.askpass !== undefined
|
37880
|
+
};
|
37881
|
+
};
|
37882
|
+
var sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined;
|
37883
|
+
var askPassSetInEnv = process.env.GIT_ASKPASS !== undefined;
|
37884
|
+
var { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs();
|
37885
|
+
var finalGitEnv = {
|
37886
|
+
...askPassSetInEnv || askPassSetInConfig ? {} : {
|
37887
|
+
GIT_ASKPASS: "echo"
|
37888
|
+
},
|
37889
|
+
...sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
|
37890
|
+
GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
|
37891
|
+
}
|
37892
|
+
};
|
37893
|
+
module.exports = (opts = {}) => ({
|
37894
|
+
stdioString: true,
|
37895
|
+
...opts,
|
37896
|
+
shell: false,
|
37897
|
+
env: opts.env || { ...finalGitEnv, ...process.env }
|
37898
|
+
});
|
37899
|
+
module.exports.loadGitConfig = loadGitConfig;
|
37900
|
+
});
|
37901
|
+
|
37902
|
+
// ../../node_modules/@npmcli/git/lib/which.js
|
37903
|
+
var require_which = __commonJS((exports, module) => {
|
37904
|
+
var which = require_lib5();
|
37905
|
+
var gitPath;
|
37906
|
+
try {
|
37907
|
+
gitPath = which.sync("git");
|
37908
|
+
} catch {}
|
37909
|
+
module.exports = (opts = {}) => {
|
37910
|
+
if (opts.git) {
|
37911
|
+
return opts.git;
|
37912
|
+
}
|
37913
|
+
if (!gitPath || opts.git === false) {
|
37914
|
+
return Object.assign(new Error("No git binary found in $PATH"), { code: "ENOGIT" });
|
37915
|
+
}
|
37916
|
+
return gitPath;
|
37917
|
+
};
|
37918
|
+
});
|
37919
|
+
|
37920
|
+
// ../../node_modules/@npmcli/git/lib/spawn.js
|
37921
|
+
var require_spawn = __commonJS((exports, module) => {
|
37922
|
+
var spawn2 = require_lib6();
|
37923
|
+
var promiseRetry = require_promise_retry();
|
37924
|
+
var { log } = require_lib3();
|
37925
|
+
var makeError = require_make_error();
|
37926
|
+
var makeOpts = require_opts();
|
37927
|
+
module.exports = (gitArgs, opts = {}) => {
|
37928
|
+
const whichGit = require_which();
|
37929
|
+
const gitPath = whichGit(opts);
|
37930
|
+
if (gitPath instanceof Error) {
|
37931
|
+
return Promise.reject(gitPath);
|
37932
|
+
}
|
37933
|
+
const args = opts.allowReplace || gitArgs[0] === "--no-replace-objects" ? gitArgs : ["--no-replace-objects", ...gitArgs];
|
37934
|
+
let retryOpts = opts.retry;
|
37935
|
+
if (retryOpts === null || retryOpts === undefined) {
|
37936
|
+
retryOpts = {
|
37937
|
+
retries: opts.fetchRetries || 2,
|
37938
|
+
factor: opts.fetchRetryFactor || 10,
|
37939
|
+
maxTimeout: opts.fetchRetryMaxtimeout || 60000,
|
37940
|
+
minTimeout: opts.fetchRetryMintimeout || 1000
|
37941
|
+
};
|
37942
|
+
}
|
37943
|
+
return promiseRetry((retryFn, number) => {
|
37944
|
+
if (number !== 1) {
|
37945
|
+
log.silly("git", `Retrying git command: ${args.join(" ")} attempt # ${number}`);
|
37946
|
+
}
|
37947
|
+
return spawn2(gitPath, args, makeOpts(opts)).catch((er) => {
|
37948
|
+
const gitError = makeError(er);
|
37949
|
+
if (!gitError.shouldRetry(number)) {
|
37950
|
+
throw gitError;
|
37951
|
+
}
|
37952
|
+
retryFn(gitError);
|
37953
|
+
});
|
37954
|
+
}, retryOpts);
|
37955
|
+
};
|
37956
|
+
});
|
37957
|
+
|
37958
|
+
// ../../node_modules/@npmcli/git/node_modules/lru-cache/dist/commonjs/index.js
|
37959
|
+
var require_commonjs7 = __commonJS((exports) => {
|
37960
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
37961
|
+
exports.LRUCache = undefined;
|
37962
|
+
var perf2 = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
37963
|
+
var warned2 = new Set;
|
37964
|
+
var PROCESS2 = typeof process === "object" && !!process ? process : {};
|
37965
|
+
var emitWarning2 = (msg, type2, code, fn) => {
|
37966
|
+
typeof PROCESS2.emitWarning === "function" ? PROCESS2.emitWarning(msg, type2, code, fn) : console.error(`[${code}] ${type2}: ${msg}`);
|
37967
|
+
};
|
37968
|
+
var AC2 = globalThis.AbortController;
|
37969
|
+
var AS2 = globalThis.AbortSignal;
|
37970
|
+
if (typeof AC2 === "undefined") {
|
37971
|
+
AS2 = class AbortSignal2 {
|
37972
|
+
onabort;
|
37973
|
+
_onabort = [];
|
37974
|
+
reason;
|
37975
|
+
aborted = false;
|
37976
|
+
addEventListener(_, fn) {
|
37977
|
+
this._onabort.push(fn);
|
37978
|
+
}
|
37979
|
+
};
|
37980
|
+
AC2 = class AbortController2 {
|
37981
|
+
constructor() {
|
37982
|
+
warnACPolyfill();
|
37983
|
+
}
|
37984
|
+
signal = new AS2;
|
37985
|
+
abort(reason) {
|
37986
|
+
if (this.signal.aborted)
|
37987
|
+
return;
|
37988
|
+
this.signal.reason = reason;
|
37989
|
+
this.signal.aborted = true;
|
37990
|
+
for (const fn of this.signal._onabort) {
|
37991
|
+
fn(reason);
|
37992
|
+
}
|
37993
|
+
this.signal.onabort?.(reason);
|
37994
|
+
}
|
37995
|
+
};
|
37996
|
+
let printACPolyfillWarning = PROCESS2.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
37997
|
+
const warnACPolyfill = () => {
|
37998
|
+
if (!printACPolyfillWarning)
|
37999
|
+
return;
|
38000
|
+
printACPolyfillWarning = false;
|
38001
|
+
emitWarning2("AbortController is not defined. If using lru-cache in " + "node 14, load an AbortController polyfill from the " + "`node-abort-controller` package. A minimal polyfill is " + "provided for use by LRUCache.fetch(), but it should not be " + "relied upon in other contexts (eg, passing it to other APIs that " + "use AbortController/AbortSignal might have undesirable effects). " + "You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
|
38002
|
+
};
|
38003
|
+
}
|
38004
|
+
var shouldWarn2 = (code) => !warned2.has(code);
|
38005
|
+
var TYPE2 = Symbol("type");
|
38006
|
+
var isPosInt2 = (n2) => n2 && n2 === Math.floor(n2) && n2 > 0 && isFinite(n2);
|
38007
|
+
var getUintArray2 = (max) => !isPosInt2(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray2 : null;
|
38008
|
+
|
38009
|
+
class ZeroArray2 extends Array {
|
38010
|
+
constructor(size) {
|
38011
|
+
super(size);
|
38012
|
+
this.fill(0);
|
38013
|
+
}
|
38014
|
+
}
|
38015
|
+
|
38016
|
+
class Stack2 {
|
38017
|
+
heap;
|
38018
|
+
length;
|
38019
|
+
static #constructing = false;
|
38020
|
+
static create(max) {
|
38021
|
+
const HeapCls = getUintArray2(max);
|
38022
|
+
if (!HeapCls)
|
38023
|
+
return [];
|
38024
|
+
Stack2.#constructing = true;
|
38025
|
+
const s = new Stack2(max, HeapCls);
|
38026
|
+
Stack2.#constructing = false;
|
38027
|
+
return s;
|
38028
|
+
}
|
38029
|
+
constructor(max, HeapCls) {
|
38030
|
+
if (!Stack2.#constructing) {
|
38031
|
+
throw new TypeError("instantiate Stack using Stack.create(n)");
|
38032
|
+
}
|
38033
|
+
this.heap = new HeapCls(max);
|
38034
|
+
this.length = 0;
|
38035
|
+
}
|
38036
|
+
push(n2) {
|
38037
|
+
this.heap[this.length++] = n2;
|
38038
|
+
}
|
38039
|
+
pop() {
|
38040
|
+
return this.heap[--this.length];
|
38041
|
+
}
|
38042
|
+
}
|
38043
|
+
|
38044
|
+
class LRUCache2 {
|
38045
|
+
#max;
|
38046
|
+
#maxSize;
|
38047
|
+
#dispose;
|
38048
|
+
#disposeAfter;
|
38049
|
+
#fetchMethod;
|
38050
|
+
#memoMethod;
|
38051
|
+
ttl;
|
38052
|
+
ttlResolution;
|
38053
|
+
ttlAutopurge;
|
38054
|
+
updateAgeOnGet;
|
38055
|
+
updateAgeOnHas;
|
38056
|
+
allowStale;
|
38057
|
+
noDisposeOnSet;
|
38058
|
+
noUpdateTTL;
|
38059
|
+
maxEntrySize;
|
38060
|
+
sizeCalculation;
|
38061
|
+
noDeleteOnFetchRejection;
|
38062
|
+
noDeleteOnStaleGet;
|
38063
|
+
allowStaleOnFetchAbort;
|
38064
|
+
allowStaleOnFetchRejection;
|
38065
|
+
ignoreFetchAbort;
|
38066
|
+
#size;
|
38067
|
+
#calculatedSize;
|
38068
|
+
#keyMap;
|
38069
|
+
#keyList;
|
38070
|
+
#valList;
|
38071
|
+
#next;
|
38072
|
+
#prev;
|
38073
|
+
#head;
|
38074
|
+
#tail;
|
38075
|
+
#free;
|
38076
|
+
#disposed;
|
38077
|
+
#sizes;
|
38078
|
+
#starts;
|
38079
|
+
#ttls;
|
38080
|
+
#hasDispose;
|
38081
|
+
#hasFetchMethod;
|
38082
|
+
#hasDisposeAfter;
|
38083
|
+
static unsafeExposeInternals(c) {
|
38084
|
+
return {
|
38085
|
+
starts: c.#starts,
|
38086
|
+
ttls: c.#ttls,
|
38087
|
+
sizes: c.#sizes,
|
38088
|
+
keyMap: c.#keyMap,
|
38089
|
+
keyList: c.#keyList,
|
38090
|
+
valList: c.#valList,
|
38091
|
+
next: c.#next,
|
38092
|
+
prev: c.#prev,
|
38093
|
+
get head() {
|
38094
|
+
return c.#head;
|
38095
|
+
},
|
38096
|
+
get tail() {
|
38097
|
+
return c.#tail;
|
38098
|
+
},
|
38099
|
+
free: c.#free,
|
38100
|
+
isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
|
38101
|
+
backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
|
38102
|
+
moveToTail: (index) => c.#moveToTail(index),
|
38103
|
+
indexes: (options) => c.#indexes(options),
|
38104
|
+
rindexes: (options) => c.#rindexes(options),
|
38105
|
+
isStale: (index) => c.#isStale(index)
|
38106
|
+
};
|
38107
|
+
}
|
38108
|
+
get max() {
|
38109
|
+
return this.#max;
|
38110
|
+
}
|
38111
|
+
get maxSize() {
|
38112
|
+
return this.#maxSize;
|
38113
|
+
}
|
38114
|
+
get calculatedSize() {
|
38115
|
+
return this.#calculatedSize;
|
38116
|
+
}
|
38117
|
+
get size() {
|
38118
|
+
return this.#size;
|
38119
|
+
}
|
38120
|
+
get fetchMethod() {
|
38121
|
+
return this.#fetchMethod;
|
38122
|
+
}
|
38123
|
+
get memoMethod() {
|
38124
|
+
return this.#memoMethod;
|
38125
|
+
}
|
38126
|
+
get dispose() {
|
38127
|
+
return this.#dispose;
|
38128
|
+
}
|
38129
|
+
get disposeAfter() {
|
38130
|
+
return this.#disposeAfter;
|
38131
|
+
}
|
38132
|
+
constructor(options) {
|
38133
|
+
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;
|
38134
|
+
if (max !== 0 && !isPosInt2(max)) {
|
38135
|
+
throw new TypeError("max option must be a nonnegative integer");
|
38136
|
+
}
|
38137
|
+
const UintArray = max ? getUintArray2(max) : Array;
|
38138
|
+
if (!UintArray) {
|
38139
|
+
throw new Error("invalid max value: " + max);
|
38140
|
+
}
|
38141
|
+
this.#max = max;
|
38142
|
+
this.#maxSize = maxSize;
|
38143
|
+
this.maxEntrySize = maxEntrySize || this.#maxSize;
|
38144
|
+
this.sizeCalculation = sizeCalculation;
|
38145
|
+
if (this.sizeCalculation) {
|
38146
|
+
if (!this.#maxSize && !this.maxEntrySize) {
|
38147
|
+
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
38148
|
+
}
|
38149
|
+
if (typeof this.sizeCalculation !== "function") {
|
38150
|
+
throw new TypeError("sizeCalculation set to non-function");
|
38151
|
+
}
|
38152
|
+
}
|
38153
|
+
if (memoMethod !== undefined && typeof memoMethod !== "function") {
|
38154
|
+
throw new TypeError("memoMethod must be a function if defined");
|
38155
|
+
}
|
38156
|
+
this.#memoMethod = memoMethod;
|
38157
|
+
if (fetchMethod !== undefined && typeof fetchMethod !== "function") {
|
38158
|
+
throw new TypeError("fetchMethod must be a function if specified");
|
38159
|
+
}
|
38160
|
+
this.#fetchMethod = fetchMethod;
|
38161
|
+
this.#hasFetchMethod = !!fetchMethod;
|
38162
|
+
this.#keyMap = new Map;
|
38163
|
+
this.#keyList = new Array(max).fill(undefined);
|
38164
|
+
this.#valList = new Array(max).fill(undefined);
|
38165
|
+
this.#next = new UintArray(max);
|
38166
|
+
this.#prev = new UintArray(max);
|
38167
|
+
this.#head = 0;
|
38168
|
+
this.#tail = 0;
|
38169
|
+
this.#free = Stack2.create(max);
|
38170
|
+
this.#size = 0;
|
38171
|
+
this.#calculatedSize = 0;
|
38172
|
+
if (typeof dispose === "function") {
|
38173
|
+
this.#dispose = dispose;
|
38174
|
+
}
|
38175
|
+
if (typeof disposeAfter === "function") {
|
38176
|
+
this.#disposeAfter = disposeAfter;
|
38177
|
+
this.#disposed = [];
|
38178
|
+
} else {
|
38179
|
+
this.#disposeAfter = undefined;
|
38180
|
+
this.#disposed = undefined;
|
38181
|
+
}
|
38182
|
+
this.#hasDispose = !!this.#dispose;
|
38183
|
+
this.#hasDisposeAfter = !!this.#disposeAfter;
|
38184
|
+
this.noDisposeOnSet = !!noDisposeOnSet;
|
38185
|
+
this.noUpdateTTL = !!noUpdateTTL;
|
38186
|
+
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
38187
|
+
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
38188
|
+
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
38189
|
+
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
38190
|
+
if (this.maxEntrySize !== 0) {
|
38191
|
+
if (this.#maxSize !== 0) {
|
38192
|
+
if (!isPosInt2(this.#maxSize)) {
|
38193
|
+
throw new TypeError("maxSize must be a positive integer if specified");
|
38194
|
+
}
|
38195
|
+
}
|
38196
|
+
if (!isPosInt2(this.maxEntrySize)) {
|
38197
|
+
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
38198
|
+
}
|
38199
|
+
this.#initializeSizeTracking();
|
38200
|
+
}
|
38201
|
+
this.allowStale = !!allowStale;
|
38202
|
+
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
38203
|
+
this.updateAgeOnGet = !!updateAgeOnGet;
|
38204
|
+
this.updateAgeOnHas = !!updateAgeOnHas;
|
38205
|
+
this.ttlResolution = isPosInt2(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
38206
|
+
this.ttlAutopurge = !!ttlAutopurge;
|
38207
|
+
this.ttl = ttl || 0;
|
38208
|
+
if (this.ttl) {
|
38209
|
+
if (!isPosInt2(this.ttl)) {
|
38210
|
+
throw new TypeError("ttl must be a positive integer if specified");
|
38211
|
+
}
|
38212
|
+
this.#initializeTTLTracking();
|
38213
|
+
}
|
38214
|
+
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
|
38215
|
+
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
38216
|
+
}
|
38217
|
+
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
38218
|
+
const code = "LRU_CACHE_UNBOUNDED";
|
38219
|
+
if (shouldWarn2(code)) {
|
38220
|
+
warned2.add(code);
|
38221
|
+
const msg = "TTL caching without ttlAutopurge, max, or maxSize can " + "result in unbounded memory consumption.";
|
38222
|
+
emitWarning2(msg, "UnboundedCacheWarning", code, LRUCache2);
|
38223
|
+
}
|
38224
|
+
}
|
38225
|
+
}
|
38226
|
+
getRemainingTTL(key2) {
|
38227
|
+
return this.#keyMap.has(key2) ? Infinity : 0;
|
38228
|
+
}
|
38229
|
+
#initializeTTLTracking() {
|
38230
|
+
const ttls = new ZeroArray2(this.#max);
|
38231
|
+
const starts = new ZeroArray2(this.#max);
|
38232
|
+
this.#ttls = ttls;
|
38233
|
+
this.#starts = starts;
|
38234
|
+
this.#setItemTTL = (index, ttl, start = perf2.now()) => {
|
38235
|
+
starts[index] = ttl !== 0 ? start : 0;
|
38236
|
+
ttls[index] = ttl;
|
38237
|
+
if (ttl !== 0 && this.ttlAutopurge) {
|
38238
|
+
const t3 = setTimeout(() => {
|
38239
|
+
if (this.#isStale(index)) {
|
38240
|
+
this.#delete(this.#keyList[index], "expire");
|
38241
|
+
}
|
38242
|
+
}, ttl + 1);
|
38243
|
+
if (t3.unref) {
|
38244
|
+
t3.unref();
|
38245
|
+
}
|
38246
|
+
}
|
38247
|
+
};
|
38248
|
+
this.#updateItemAge = (index) => {
|
38249
|
+
starts[index] = ttls[index] !== 0 ? perf2.now() : 0;
|
38250
|
+
};
|
38251
|
+
this.#statusTTL = (status, index) => {
|
38252
|
+
if (ttls[index]) {
|
38253
|
+
const ttl = ttls[index];
|
38254
|
+
const start = starts[index];
|
38255
|
+
if (!ttl || !start)
|
38256
|
+
return;
|
38257
|
+
status.ttl = ttl;
|
38258
|
+
status.start = start;
|
38259
|
+
status.now = cachedNow || getNow();
|
38260
|
+
const age = status.now - start;
|
38261
|
+
status.remainingTTL = ttl - age;
|
38262
|
+
}
|
38263
|
+
};
|
38264
|
+
let cachedNow = 0;
|
38265
|
+
const getNow = () => {
|
38266
|
+
const n2 = perf2.now();
|
38267
|
+
if (this.ttlResolution > 0) {
|
38268
|
+
cachedNow = n2;
|
38269
|
+
const t3 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
38270
|
+
if (t3.unref) {
|
38271
|
+
t3.unref();
|
38272
|
+
}
|
38273
|
+
}
|
38274
|
+
return n2;
|
38275
|
+
};
|
38276
|
+
this.getRemainingTTL = (key2) => {
|
38277
|
+
const index = this.#keyMap.get(key2);
|
38278
|
+
if (index === undefined) {
|
38279
|
+
return 0;
|
38280
|
+
}
|
38281
|
+
const ttl = ttls[index];
|
38282
|
+
const start = starts[index];
|
38283
|
+
if (!ttl || !start) {
|
38284
|
+
return Infinity;
|
38285
|
+
}
|
38286
|
+
const age = (cachedNow || getNow()) - start;
|
38287
|
+
return ttl - age;
|
38288
|
+
};
|
38289
|
+
this.#isStale = (index) => {
|
38290
|
+
const s = starts[index];
|
38291
|
+
const t3 = ttls[index];
|
38292
|
+
return !!t3 && !!s && (cachedNow || getNow()) - s > t3;
|
38293
|
+
};
|
38294
|
+
}
|
38295
|
+
#updateItemAge = () => {};
|
38296
|
+
#statusTTL = () => {};
|
38297
|
+
#setItemTTL = () => {};
|
38298
|
+
#isStale = () => false;
|
38299
|
+
#initializeSizeTracking() {
|
38300
|
+
const sizes = new ZeroArray2(this.#max);
|
38301
|
+
this.#calculatedSize = 0;
|
38302
|
+
this.#sizes = sizes;
|
38303
|
+
this.#removeItemSize = (index) => {
|
38304
|
+
this.#calculatedSize -= sizes[index];
|
38305
|
+
sizes[index] = 0;
|
38306
|
+
};
|
38307
|
+
this.#requireSize = (k, v, size, sizeCalculation) => {
|
38308
|
+
if (this.#isBackgroundFetch(v)) {
|
38309
|
+
return 0;
|
38310
|
+
}
|
38311
|
+
if (!isPosInt2(size)) {
|
38312
|
+
if (sizeCalculation) {
|
38313
|
+
if (typeof sizeCalculation !== "function") {
|
38314
|
+
throw new TypeError("sizeCalculation must be a function");
|
38315
|
+
}
|
38316
|
+
size = sizeCalculation(v, k);
|
38317
|
+
if (!isPosInt2(size)) {
|
38318
|
+
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
38319
|
+
}
|
38320
|
+
} else {
|
38321
|
+
throw new TypeError("invalid size value (must be positive integer). " + "When maxSize or maxEntrySize is used, sizeCalculation " + "or size must be set.");
|
38322
|
+
}
|
38323
|
+
}
|
38324
|
+
return size;
|
38325
|
+
};
|
38326
|
+
this.#addItemSize = (index, size, status) => {
|
38327
|
+
sizes[index] = size;
|
38328
|
+
if (this.#maxSize) {
|
38329
|
+
const maxSize = this.#maxSize - sizes[index];
|
38330
|
+
while (this.#calculatedSize > maxSize) {
|
38331
|
+
this.#evict(true);
|
38332
|
+
}
|
38333
|
+
}
|
38334
|
+
this.#calculatedSize += sizes[index];
|
38335
|
+
if (status) {
|
38336
|
+
status.entrySize = size;
|
38337
|
+
status.totalCalculatedSize = this.#calculatedSize;
|
38338
|
+
}
|
38339
|
+
};
|
38340
|
+
}
|
38341
|
+
#removeItemSize = (_i) => {};
|
38342
|
+
#addItemSize = (_i, _s, _st) => {};
|
38343
|
+
#requireSize = (_k, _v, size, sizeCalculation) => {
|
38344
|
+
if (size || sizeCalculation) {
|
38345
|
+
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
38346
|
+
}
|
38347
|
+
return 0;
|
38348
|
+
};
|
38349
|
+
*#indexes({ allowStale = this.allowStale } = {}) {
|
38350
|
+
if (this.#size) {
|
38351
|
+
for (let i2 = this.#tail;; ) {
|
38352
|
+
if (!this.#isValidIndex(i2)) {
|
38353
|
+
break;
|
38354
|
+
}
|
38355
|
+
if (allowStale || !this.#isStale(i2)) {
|
38356
|
+
yield i2;
|
38357
|
+
}
|
38358
|
+
if (i2 === this.#head) {
|
38359
|
+
break;
|
38360
|
+
} else {
|
38361
|
+
i2 = this.#prev[i2];
|
38362
|
+
}
|
38363
|
+
}
|
38364
|
+
}
|
38365
|
+
}
|
38366
|
+
*#rindexes({ allowStale = this.allowStale } = {}) {
|
38367
|
+
if (this.#size) {
|
38368
|
+
for (let i2 = this.#head;; ) {
|
38369
|
+
if (!this.#isValidIndex(i2)) {
|
38370
|
+
break;
|
38371
|
+
}
|
38372
|
+
if (allowStale || !this.#isStale(i2)) {
|
38373
|
+
yield i2;
|
38374
|
+
}
|
38375
|
+
if (i2 === this.#tail) {
|
38376
|
+
break;
|
38377
|
+
} else {
|
38378
|
+
i2 = this.#next[i2];
|
38379
|
+
}
|
38380
|
+
}
|
38381
|
+
}
|
38382
|
+
}
|
38383
|
+
#isValidIndex(index) {
|
38384
|
+
return index !== undefined && this.#keyMap.get(this.#keyList[index]) === index;
|
38385
|
+
}
|
38386
|
+
*entries() {
|
38387
|
+
for (const i2 of this.#indexes()) {
|
38388
|
+
if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
38389
|
+
yield [this.#keyList[i2], this.#valList[i2]];
|
38390
|
+
}
|
38391
|
+
}
|
38392
|
+
}
|
38393
|
+
*rentries() {
|
38394
|
+
for (const i2 of this.#rindexes()) {
|
38395
|
+
if (this.#valList[i2] !== undefined && this.#keyList[i2] !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
38396
|
+
yield [this.#keyList[i2], this.#valList[i2]];
|
38397
|
+
}
|
38398
|
+
}
|
36433
38399
|
}
|
36434
|
-
|
36435
|
-
|
36436
|
-
|
36437
|
-
|
36438
|
-
|
36439
|
-
|
36440
|
-
|
36441
|
-
}
|
36442
|
-
throw errcode(new Error("Retrying"), "EPROMISERETRY", { retried: err });
|
36443
|
-
}, number);
|
36444
|
-
}).then(resolve2, function(err) {
|
36445
|
-
if (isRetryError(err)) {
|
36446
|
-
err = err.retried;
|
36447
|
-
if (operation.retry(err || new Error)) {
|
36448
|
-
return;
|
36449
|
-
}
|
36450
|
-
}
|
36451
|
-
reject(err);
|
36452
|
-
});
|
36453
|
-
});
|
36454
|
-
});
|
36455
|
-
}
|
36456
|
-
module.exports = promiseRetry;
|
36457
|
-
});
|
36458
|
-
|
36459
|
-
// ../../node_modules/@npmcli/git/lib/errors.js
|
36460
|
-
var require_errors2 = __commonJS((exports, module) => {
|
36461
|
-
var maxRetry = 3;
|
36462
|
-
|
36463
|
-
class GitError extends Error {
|
36464
|
-
shouldRetry() {
|
36465
|
-
return false;
|
38400
|
+
*keys() {
|
38401
|
+
for (const i2 of this.#indexes()) {
|
38402
|
+
const k = this.#keyList[i2];
|
38403
|
+
if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
38404
|
+
yield k;
|
38405
|
+
}
|
38406
|
+
}
|
36466
38407
|
}
|
36467
|
-
|
36468
|
-
|
36469
|
-
|
36470
|
-
|
36471
|
-
|
38408
|
+
*rkeys() {
|
38409
|
+
for (const i2 of this.#rindexes()) {
|
38410
|
+
const k = this.#keyList[i2];
|
38411
|
+
if (k !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
38412
|
+
yield k;
|
38413
|
+
}
|
38414
|
+
}
|
36472
38415
|
}
|
36473
|
-
|
36474
|
-
|
38416
|
+
*values() {
|
38417
|
+
for (const i2 of this.#indexes()) {
|
38418
|
+
const v = this.#valList[i2];
|
38419
|
+
if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
38420
|
+
yield this.#valList[i2];
|
38421
|
+
}
|
38422
|
+
}
|
36475
38423
|
}
|
36476
|
-
|
36477
|
-
|
36478
|
-
|
36479
|
-
|
36480
|
-
|
38424
|
+
*rvalues() {
|
38425
|
+
for (const i2 of this.#rindexes()) {
|
38426
|
+
const v = this.#valList[i2];
|
38427
|
+
if (v !== undefined && !this.#isBackgroundFetch(this.#valList[i2])) {
|
38428
|
+
yield this.#valList[i2];
|
38429
|
+
}
|
38430
|
+
}
|
36481
38431
|
}
|
36482
|
-
|
36483
|
-
|
36484
|
-
class GitUnknownError extends GitError {
|
36485
|
-
constructor() {
|
36486
|
-
super("An unknown git error occurred");
|
38432
|
+
[Symbol.iterator]() {
|
38433
|
+
return this.entries();
|
36487
38434
|
}
|
36488
|
-
|
36489
|
-
|
36490
|
-
|
36491
|
-
|
36492
|
-
|
36493
|
-
|
36494
|
-
|
36495
|
-
|
36496
|
-
|
36497
|
-
|
36498
|
-
|
36499
|
-
GitConnectionError,
|
36500
|
-
GitPathspecError,
|
36501
|
-
GitUnknownError
|
36502
|
-
} = require_errors2();
|
36503
|
-
var connectionErrorRe = new RegExp([
|
36504
|
-
"remote error: Internal Server Error",
|
36505
|
-
"The remote end hung up unexpectedly",
|
36506
|
-
"Connection timed out",
|
36507
|
-
"Operation timed out",
|
36508
|
-
"Failed to connect to .* Timed out",
|
36509
|
-
"Connection reset by peer",
|
36510
|
-
"SSL_ERROR_SYSCALL",
|
36511
|
-
"The requested URL returned error: 503"
|
36512
|
-
].join("|"));
|
36513
|
-
var missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/;
|
36514
|
-
function makeError(er) {
|
36515
|
-
const message = er.stderr;
|
36516
|
-
let gitEr;
|
36517
|
-
if (connectionErrorRe.test(message)) {
|
36518
|
-
gitEr = new GitConnectionError(message);
|
36519
|
-
} else if (missingPathspecRe.test(message)) {
|
36520
|
-
gitEr = new GitPathspecError(message);
|
36521
|
-
} else {
|
36522
|
-
gitEr = new GitUnknownError(message);
|
38435
|
+
[Symbol.toStringTag] = "LRUCache";
|
38436
|
+
find(fn, getOptions = {}) {
|
38437
|
+
for (const i2 of this.#indexes()) {
|
38438
|
+
const v = this.#valList[i2];
|
38439
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
38440
|
+
if (value2 === undefined)
|
38441
|
+
continue;
|
38442
|
+
if (fn(value2, this.#keyList[i2], this)) {
|
38443
|
+
return this.get(this.#keyList[i2], getOptions);
|
38444
|
+
}
|
38445
|
+
}
|
36523
38446
|
}
|
36524
|
-
|
36525
|
-
|
36526
|
-
|
36527
|
-
|
36528
|
-
|
36529
|
-
|
36530
|
-
|
36531
|
-
|
36532
|
-
var encode = (obj, opt = {}) => {
|
36533
|
-
if (typeof opt === "string") {
|
36534
|
-
opt = { section: opt };
|
38447
|
+
forEach(fn, thisp = this) {
|
38448
|
+
for (const i2 of this.#indexes()) {
|
38449
|
+
const v = this.#valList[i2];
|
38450
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
38451
|
+
if (value2 === undefined)
|
38452
|
+
continue;
|
38453
|
+
fn.call(thisp, value2, this.#keyList[i2], this);
|
38454
|
+
}
|
36535
38455
|
}
|
36536
|
-
|
36537
|
-
|
36538
|
-
|
36539
|
-
|
36540
|
-
|
36541
|
-
|
36542
|
-
|
36543
|
-
|
36544
|
-
`;
|
36545
|
-
const separator = opt.whitespace ? " = " : "=";
|
36546
|
-
const children = [];
|
36547
|
-
const keys = opt.sort ? Object.keys(obj).sort() : Object.keys(obj);
|
36548
|
-
let padToChars = 0;
|
36549
|
-
if (opt.align) {
|
36550
|
-
padToChars = safe(keys.filter((k) => obj[k] === null || Array.isArray(obj[k]) || typeof obj[k] !== "object").map((k) => Array.isArray(obj[k]) ? `${k}[]` : k).concat([""]).reduce((a3, b) => safe(a3).length >= safe(b).length ? a3 : b)).length;
|
38456
|
+
rforEach(fn, thisp = this) {
|
38457
|
+
for (const i2 of this.#rindexes()) {
|
38458
|
+
const v = this.#valList[i2];
|
38459
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
38460
|
+
if (value2 === undefined)
|
38461
|
+
continue;
|
38462
|
+
fn.call(thisp, value2, this.#keyList[i2], this);
|
38463
|
+
}
|
36551
38464
|
}
|
36552
|
-
|
36553
|
-
|
36554
|
-
|
36555
|
-
|
36556
|
-
|
36557
|
-
|
36558
|
-
out += safe(`${k}${arraySuffix}`).padEnd(padToChars, " ") + separator + safe(item) + eol;
|
38465
|
+
purgeStale() {
|
38466
|
+
let deleted = false;
|
38467
|
+
for (const i2 of this.#rindexes({ allowStale: true })) {
|
38468
|
+
if (this.#isStale(i2)) {
|
38469
|
+
this.#delete(this.#keyList[i2], "expire");
|
38470
|
+
deleted = true;
|
36559
38471
|
}
|
36560
|
-
} else if (val && typeof val === "object") {
|
36561
|
-
children.push(k);
|
36562
|
-
} else {
|
36563
|
-
out += safe(k).padEnd(padToChars, " ") + separator + safe(val) + eol;
|
36564
38472
|
}
|
38473
|
+
return deleted;
|
36565
38474
|
}
|
36566
|
-
|
36567
|
-
|
36568
|
-
|
36569
|
-
|
36570
|
-
const
|
36571
|
-
const
|
36572
|
-
|
36573
|
-
|
36574
|
-
|
36575
|
-
|
36576
|
-
|
36577
|
-
|
38475
|
+
info(key2) {
|
38476
|
+
const i2 = this.#keyMap.get(key2);
|
38477
|
+
if (i2 === undefined)
|
38478
|
+
return;
|
38479
|
+
const v = this.#valList[i2];
|
38480
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
38481
|
+
if (value2 === undefined)
|
38482
|
+
return;
|
38483
|
+
const entry = { value: value2 };
|
38484
|
+
if (this.#ttls && this.#starts) {
|
38485
|
+
const ttl = this.#ttls[i2];
|
38486
|
+
const start = this.#starts[i2];
|
38487
|
+
if (ttl && start) {
|
38488
|
+
const remain = ttl - (perf2.now() - start);
|
38489
|
+
entry.ttl = remain;
|
38490
|
+
entry.start = Date.now();
|
38491
|
+
}
|
36578
38492
|
}
|
36579
|
-
|
38493
|
+
if (this.#sizes) {
|
38494
|
+
entry.size = this.#sizes[i2];
|
38495
|
+
}
|
38496
|
+
return entry;
|
36580
38497
|
}
|
36581
|
-
|
36582
|
-
|
36583
|
-
|
36584
|
-
|
36585
|
-
|
36586
|
-
|
36587
|
-
|
36588
|
-
do {
|
36589
|
-
nextIndex = str.indexOf(separator, lastMatchIndex);
|
36590
|
-
if (nextIndex !== -1) {
|
36591
|
-
lastMatchIndex = nextIndex + separator.length;
|
36592
|
-
if (nextIndex > 0 && str[nextIndex - 1] === "\\") {
|
38498
|
+
dump() {
|
38499
|
+
const arr = [];
|
38500
|
+
for (const i2 of this.#indexes({ allowStale: true })) {
|
38501
|
+
const key2 = this.#keyList[i2];
|
38502
|
+
const v = this.#valList[i2];
|
38503
|
+
const value2 = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
38504
|
+
if (value2 === undefined || key2 === undefined)
|
36593
38505
|
continue;
|
38506
|
+
const entry = { value: value2 };
|
38507
|
+
if (this.#ttls && this.#starts) {
|
38508
|
+
entry.ttl = this.#ttls[i2];
|
38509
|
+
const age = perf2.now() - this.#starts[i2];
|
38510
|
+
entry.start = Math.floor(Date.now() - age);
|
36594
38511
|
}
|
36595
|
-
|
36596
|
-
|
38512
|
+
if (this.#sizes) {
|
38513
|
+
entry.size = this.#sizes[i2];
|
38514
|
+
}
|
38515
|
+
arr.unshift([key2, entry]);
|
36597
38516
|
}
|
36598
|
-
|
36599
|
-
|
36600
|
-
|
36601
|
-
|
36602
|
-
|
36603
|
-
|
36604
|
-
|
36605
|
-
|
36606
|
-
|
36607
|
-
|
36608
|
-
const lines2 = str.split(/[\r\n]+/g);
|
36609
|
-
const duplicates = {};
|
36610
|
-
for (const line of lines2) {
|
36611
|
-
if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
|
36612
|
-
continue;
|
38517
|
+
return arr;
|
38518
|
+
}
|
38519
|
+
load(arr) {
|
38520
|
+
this.clear();
|
38521
|
+
for (const [key2, entry] of arr) {
|
38522
|
+
if (entry.start) {
|
38523
|
+
const age = Date.now() - entry.start;
|
38524
|
+
entry.start = perf2.now() - age;
|
38525
|
+
}
|
38526
|
+
this.set(key2, entry.value, entry);
|
36613
38527
|
}
|
36614
|
-
|
36615
|
-
|
36616
|
-
|
38528
|
+
}
|
38529
|
+
set(k, v, setOptions = {}) {
|
38530
|
+
if (v === undefined) {
|
38531
|
+
this.delete(k);
|
38532
|
+
return this;
|
36617
38533
|
}
|
36618
|
-
|
36619
|
-
|
36620
|
-
|
36621
|
-
|
36622
|
-
|
38534
|
+
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
|
38535
|
+
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
38536
|
+
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
38537
|
+
if (this.maxEntrySize && size > this.maxEntrySize) {
|
38538
|
+
if (status) {
|
38539
|
+
status.set = "miss";
|
38540
|
+
status.maxEntrySizeExceeded = true;
|
36623
38541
|
}
|
36624
|
-
|
36625
|
-
|
38542
|
+
this.#delete(k, "set");
|
38543
|
+
return this;
|
36626
38544
|
}
|
36627
|
-
|
36628
|
-
|
36629
|
-
|
36630
|
-
|
38545
|
+
let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
|
38546
|
+
if (index === undefined) {
|
38547
|
+
index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size;
|
38548
|
+
this.#keyList[index] = k;
|
38549
|
+
this.#valList[index] = v;
|
38550
|
+
this.#keyMap.set(k, index);
|
38551
|
+
this.#next[this.#tail] = index;
|
38552
|
+
this.#prev[index] = this.#tail;
|
38553
|
+
this.#tail = index;
|
38554
|
+
this.#size++;
|
38555
|
+
this.#addItemSize(index, size, status);
|
38556
|
+
if (status)
|
38557
|
+
status.set = "add";
|
38558
|
+
noUpdateTTL = false;
|
36631
38559
|
} else {
|
36632
|
-
|
36633
|
-
|
38560
|
+
this.#moveToTail(index);
|
38561
|
+
const oldVal = this.#valList[index];
|
38562
|
+
if (v !== oldVal) {
|
38563
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
38564
|
+
oldVal.__abortController.abort(new Error("replaced"));
|
38565
|
+
const { __staleWhileFetching: s } = oldVal;
|
38566
|
+
if (s !== undefined && !noDisposeOnSet) {
|
38567
|
+
if (this.#hasDispose) {
|
38568
|
+
this.#dispose?.(s, k, "set");
|
38569
|
+
}
|
38570
|
+
if (this.#hasDisposeAfter) {
|
38571
|
+
this.#disposed?.push([s, k, "set"]);
|
38572
|
+
}
|
38573
|
+
}
|
38574
|
+
} else if (!noDisposeOnSet) {
|
38575
|
+
if (this.#hasDispose) {
|
38576
|
+
this.#dispose?.(oldVal, k, "set");
|
38577
|
+
}
|
38578
|
+
if (this.#hasDisposeAfter) {
|
38579
|
+
this.#disposed?.push([oldVal, k, "set"]);
|
38580
|
+
}
|
38581
|
+
}
|
38582
|
+
this.#removeItemSize(index);
|
38583
|
+
this.#addItemSize(index, size, status);
|
38584
|
+
this.#valList[index] = v;
|
38585
|
+
if (status) {
|
38586
|
+
status.set = "replace";
|
38587
|
+
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
38588
|
+
if (oldValue !== undefined)
|
38589
|
+
status.oldValue = oldValue;
|
38590
|
+
}
|
38591
|
+
} else if (status) {
|
38592
|
+
status.set = "update";
|
38593
|
+
}
|
36634
38594
|
}
|
36635
|
-
|
36636
|
-
|
36637
|
-
continue;
|
38595
|
+
if (ttl !== 0 && !this.#ttls) {
|
38596
|
+
this.#initializeTTLTracking();
|
36638
38597
|
}
|
36639
|
-
|
36640
|
-
|
36641
|
-
|
36642
|
-
if (!hasOwnProperty.call(p, key2)) {
|
36643
|
-
p[key2] = [];
|
36644
|
-
} else if (!Array.isArray(p[key2])) {
|
36645
|
-
p[key2] = [p[key2]];
|
38598
|
+
if (this.#ttls) {
|
38599
|
+
if (!noUpdateTTL) {
|
38600
|
+
this.#setItemTTL(index, ttl, start);
|
36646
38601
|
}
|
38602
|
+
if (status)
|
38603
|
+
this.#statusTTL(status, index);
|
36647
38604
|
}
|
36648
|
-
if (
|
36649
|
-
|
36650
|
-
|
36651
|
-
|
38605
|
+
if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
38606
|
+
const dt2 = this.#disposed;
|
38607
|
+
let task;
|
38608
|
+
while (task = dt2?.shift()) {
|
38609
|
+
this.#disposeAfter?.(...task);
|
38610
|
+
}
|
36652
38611
|
}
|
38612
|
+
return this;
|
36653
38613
|
}
|
36654
|
-
|
36655
|
-
|
36656
|
-
|
36657
|
-
|
38614
|
+
pop() {
|
38615
|
+
try {
|
38616
|
+
while (this.#size) {
|
38617
|
+
const val = this.#valList[this.#head];
|
38618
|
+
this.#evict(true);
|
38619
|
+
if (this.#isBackgroundFetch(val)) {
|
38620
|
+
if (val.__staleWhileFetching) {
|
38621
|
+
return val.__staleWhileFetching;
|
38622
|
+
}
|
38623
|
+
} else if (val !== undefined) {
|
38624
|
+
return val;
|
38625
|
+
}
|
38626
|
+
}
|
38627
|
+
} finally {
|
38628
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
38629
|
+
const dt2 = this.#disposed;
|
38630
|
+
let task;
|
38631
|
+
while (task = dt2?.shift()) {
|
38632
|
+
this.#disposeAfter?.(...task);
|
38633
|
+
}
|
38634
|
+
}
|
36658
38635
|
}
|
36659
|
-
|
36660
|
-
|
36661
|
-
const
|
36662
|
-
const
|
36663
|
-
|
36664
|
-
|
36665
|
-
|
38636
|
+
}
|
38637
|
+
#evict(free) {
|
38638
|
+
const head = this.#head;
|
38639
|
+
const k = this.#keyList[head];
|
38640
|
+
const v = this.#valList[head];
|
38641
|
+
if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
|
38642
|
+
v.__abortController.abort(new Error("evicted"));
|
38643
|
+
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
38644
|
+
if (this.#hasDispose) {
|
38645
|
+
this.#dispose?.(v, k, "evict");
|
36666
38646
|
}
|
36667
|
-
if (
|
36668
|
-
|
38647
|
+
if (this.#hasDisposeAfter) {
|
38648
|
+
this.#disposed?.push([v, k, "evict"]);
|
36669
38649
|
}
|
36670
|
-
p = p[part];
|
36671
38650
|
}
|
36672
|
-
|
36673
|
-
|
38651
|
+
this.#removeItemSize(head);
|
38652
|
+
if (free) {
|
38653
|
+
this.#keyList[head] = undefined;
|
38654
|
+
this.#valList[head] = undefined;
|
38655
|
+
this.#free.push(head);
|
36674
38656
|
}
|
36675
|
-
|
36676
|
-
|
38657
|
+
if (this.#size === 1) {
|
38658
|
+
this.#head = this.#tail = 0;
|
38659
|
+
this.#free.length = 0;
|
38660
|
+
} else {
|
38661
|
+
this.#head = this.#next[head];
|
38662
|
+
}
|
38663
|
+
this.#keyMap.delete(k);
|
38664
|
+
this.#size--;
|
38665
|
+
return head;
|
36677
38666
|
}
|
36678
|
-
|
36679
|
-
|
38667
|
+
has(k, hasOptions = {}) {
|
38668
|
+
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
38669
|
+
const index = this.#keyMap.get(k);
|
38670
|
+
if (index !== undefined) {
|
38671
|
+
const v = this.#valList[index];
|
38672
|
+
if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === undefined) {
|
38673
|
+
return false;
|
38674
|
+
}
|
38675
|
+
if (!this.#isStale(index)) {
|
38676
|
+
if (updateAgeOnHas) {
|
38677
|
+
this.#updateItemAge(index);
|
38678
|
+
}
|
38679
|
+
if (status) {
|
38680
|
+
status.has = "hit";
|
38681
|
+
this.#statusTTL(status, index);
|
38682
|
+
}
|
38683
|
+
return true;
|
38684
|
+
} else if (status) {
|
38685
|
+
status.has = "stale";
|
38686
|
+
this.#statusTTL(status, index);
|
38687
|
+
}
|
38688
|
+
} else if (status) {
|
38689
|
+
status.has = "miss";
|
38690
|
+
}
|
38691
|
+
return false;
|
36680
38692
|
}
|
36681
|
-
|
36682
|
-
|
36683
|
-
|
36684
|
-
|
36685
|
-
|
36686
|
-
|
36687
|
-
|
36688
|
-
return
|
38693
|
+
peek(k, peekOptions = {}) {
|
38694
|
+
const { allowStale = this.allowStale } = peekOptions;
|
38695
|
+
const index = this.#keyMap.get(k);
|
38696
|
+
if (index === undefined || !allowStale && this.#isStale(index)) {
|
38697
|
+
return;
|
38698
|
+
}
|
38699
|
+
const v = this.#valList[index];
|
38700
|
+
return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
36689
38701
|
}
|
36690
|
-
|
36691
|
-
|
36692
|
-
|
36693
|
-
|
36694
|
-
if (isQuoted(val)) {
|
36695
|
-
if (val.charAt(0) === "'") {
|
36696
|
-
val = val.slice(1, -1);
|
38702
|
+
#backgroundFetch(k, index, options, context) {
|
38703
|
+
const v = index === undefined ? undefined : this.#valList[index];
|
38704
|
+
if (this.#isBackgroundFetch(v)) {
|
38705
|
+
return v;
|
36697
38706
|
}
|
36698
|
-
|
36699
|
-
|
36700
|
-
|
36701
|
-
|
36702
|
-
|
36703
|
-
|
36704
|
-
|
36705
|
-
|
36706
|
-
|
36707
|
-
|
36708
|
-
|
38707
|
+
const ac = new AC2;
|
38708
|
+
const { signal } = options;
|
38709
|
+
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
38710
|
+
signal: ac.signal
|
38711
|
+
});
|
38712
|
+
const fetchOpts = {
|
38713
|
+
signal: ac.signal,
|
38714
|
+
options,
|
38715
|
+
context
|
38716
|
+
};
|
38717
|
+
const cb = (v2, updateCache = false) => {
|
38718
|
+
const { aborted } = ac.signal;
|
38719
|
+
const ignoreAbort = options.ignoreFetchAbort && v2 !== undefined;
|
38720
|
+
if (options.status) {
|
38721
|
+
if (aborted && !updateCache) {
|
38722
|
+
options.status.fetchAborted = true;
|
38723
|
+
options.status.fetchError = ac.signal.reason;
|
38724
|
+
if (ignoreAbort)
|
38725
|
+
options.status.fetchAbortIgnored = true;
|
36709
38726
|
} else {
|
36710
|
-
|
38727
|
+
options.status.fetchResolved = true;
|
36711
38728
|
}
|
36712
|
-
esc = false;
|
36713
|
-
} else if (";#".indexOf(c) !== -1) {
|
36714
|
-
break;
|
36715
|
-
} else if (c === "\\") {
|
36716
|
-
esc = true;
|
36717
|
-
} else {
|
36718
|
-
unesc += c;
|
36719
38729
|
}
|
38730
|
+
if (aborted && !ignoreAbort && !updateCache) {
|
38731
|
+
return fetchFail(ac.signal.reason);
|
38732
|
+
}
|
38733
|
+
const bf2 = p;
|
38734
|
+
if (this.#valList[index] === p) {
|
38735
|
+
if (v2 === undefined) {
|
38736
|
+
if (bf2.__staleWhileFetching) {
|
38737
|
+
this.#valList[index] = bf2.__staleWhileFetching;
|
38738
|
+
} else {
|
38739
|
+
this.#delete(k, "fetch");
|
38740
|
+
}
|
38741
|
+
} else {
|
38742
|
+
if (options.status)
|
38743
|
+
options.status.fetchUpdated = true;
|
38744
|
+
this.set(k, v2, fetchOpts.options);
|
38745
|
+
}
|
38746
|
+
}
|
38747
|
+
return v2;
|
38748
|
+
};
|
38749
|
+
const eb = (er) => {
|
38750
|
+
if (options.status) {
|
38751
|
+
options.status.fetchRejected = true;
|
38752
|
+
options.status.fetchError = er;
|
38753
|
+
}
|
38754
|
+
return fetchFail(er);
|
38755
|
+
};
|
38756
|
+
const fetchFail = (er) => {
|
38757
|
+
const { aborted } = ac.signal;
|
38758
|
+
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
|
38759
|
+
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
38760
|
+
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
38761
|
+
const bf2 = p;
|
38762
|
+
if (this.#valList[index] === p) {
|
38763
|
+
const del = !noDelete || bf2.__staleWhileFetching === undefined;
|
38764
|
+
if (del) {
|
38765
|
+
this.#delete(k, "fetch");
|
38766
|
+
} else if (!allowStaleAborted) {
|
38767
|
+
this.#valList[index] = bf2.__staleWhileFetching;
|
38768
|
+
}
|
38769
|
+
}
|
38770
|
+
if (allowStale) {
|
38771
|
+
if (options.status && bf2.__staleWhileFetching !== undefined) {
|
38772
|
+
options.status.returnedStale = true;
|
38773
|
+
}
|
38774
|
+
return bf2.__staleWhileFetching;
|
38775
|
+
} else if (bf2.__returned === bf2) {
|
38776
|
+
throw er;
|
38777
|
+
}
|
38778
|
+
};
|
38779
|
+
const pcall = (res, rej) => {
|
38780
|
+
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
38781
|
+
if (fmp && fmp instanceof Promise) {
|
38782
|
+
fmp.then((v2) => res(v2 === undefined ? undefined : v2), rej);
|
38783
|
+
}
|
38784
|
+
ac.signal.addEventListener("abort", () => {
|
38785
|
+
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
38786
|
+
res(undefined);
|
38787
|
+
if (options.allowStaleOnFetchAbort) {
|
38788
|
+
res = (v2) => cb(v2, true);
|
38789
|
+
}
|
38790
|
+
}
|
38791
|
+
});
|
38792
|
+
};
|
38793
|
+
if (options.status)
|
38794
|
+
options.status.fetchDispatched = true;
|
38795
|
+
const p = new Promise(pcall).then(cb, eb);
|
38796
|
+
const bf = Object.assign(p, {
|
38797
|
+
__abortController: ac,
|
38798
|
+
__staleWhileFetching: v,
|
38799
|
+
__returned: undefined
|
38800
|
+
});
|
38801
|
+
if (index === undefined) {
|
38802
|
+
this.set(k, bf, { ...fetchOpts.options, status: undefined });
|
38803
|
+
index = this.#keyMap.get(k);
|
38804
|
+
} else {
|
38805
|
+
this.#valList[index] = bf;
|
36720
38806
|
}
|
36721
|
-
|
36722
|
-
|
38807
|
+
return bf;
|
38808
|
+
}
|
38809
|
+
#isBackgroundFetch(p) {
|
38810
|
+
if (!this.#hasFetchMethod)
|
38811
|
+
return false;
|
38812
|
+
const b = p;
|
38813
|
+
return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC2;
|
38814
|
+
}
|
38815
|
+
async fetch(k, fetchOptions = {}) {
|
38816
|
+
const {
|
38817
|
+
allowStale = this.allowStale,
|
38818
|
+
updateAgeOnGet = this.updateAgeOnGet,
|
38819
|
+
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
38820
|
+
ttl = this.ttl,
|
38821
|
+
noDisposeOnSet = this.noDisposeOnSet,
|
38822
|
+
size = 0,
|
38823
|
+
sizeCalculation = this.sizeCalculation,
|
38824
|
+
noUpdateTTL = this.noUpdateTTL,
|
38825
|
+
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
38826
|
+
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
38827
|
+
ignoreFetchAbort = this.ignoreFetchAbort,
|
38828
|
+
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
38829
|
+
context,
|
38830
|
+
forceRefresh = false,
|
38831
|
+
status,
|
38832
|
+
signal
|
38833
|
+
} = fetchOptions;
|
38834
|
+
if (!this.#hasFetchMethod) {
|
38835
|
+
if (status)
|
38836
|
+
status.fetch = "get";
|
38837
|
+
return this.get(k, {
|
38838
|
+
allowStale,
|
38839
|
+
updateAgeOnGet,
|
38840
|
+
noDeleteOnStaleGet,
|
38841
|
+
status
|
38842
|
+
});
|
38843
|
+
}
|
38844
|
+
const options = {
|
38845
|
+
allowStale,
|
38846
|
+
updateAgeOnGet,
|
38847
|
+
noDeleteOnStaleGet,
|
38848
|
+
ttl,
|
38849
|
+
noDisposeOnSet,
|
38850
|
+
size,
|
38851
|
+
sizeCalculation,
|
38852
|
+
noUpdateTTL,
|
38853
|
+
noDeleteOnFetchRejection,
|
38854
|
+
allowStaleOnFetchRejection,
|
38855
|
+
allowStaleOnFetchAbort,
|
38856
|
+
ignoreFetchAbort,
|
38857
|
+
status,
|
38858
|
+
signal
|
38859
|
+
};
|
38860
|
+
let index = this.#keyMap.get(k);
|
38861
|
+
if (index === undefined) {
|
38862
|
+
if (status)
|
38863
|
+
status.fetch = "miss";
|
38864
|
+
const p = this.#backgroundFetch(k, index, options, context);
|
38865
|
+
return p.__returned = p;
|
38866
|
+
} else {
|
38867
|
+
const v = this.#valList[index];
|
38868
|
+
if (this.#isBackgroundFetch(v)) {
|
38869
|
+
const stale = allowStale && v.__staleWhileFetching !== undefined;
|
38870
|
+
if (status) {
|
38871
|
+
status.fetch = "inflight";
|
38872
|
+
if (stale)
|
38873
|
+
status.returnedStale = true;
|
38874
|
+
}
|
38875
|
+
return stale ? v.__staleWhileFetching : v.__returned = v;
|
38876
|
+
}
|
38877
|
+
const isStale = this.#isStale(index);
|
38878
|
+
if (!forceRefresh && !isStale) {
|
38879
|
+
if (status)
|
38880
|
+
status.fetch = "hit";
|
38881
|
+
this.#moveToTail(index);
|
38882
|
+
if (updateAgeOnGet) {
|
38883
|
+
this.#updateItemAge(index);
|
38884
|
+
}
|
38885
|
+
if (status)
|
38886
|
+
this.#statusTTL(status, index);
|
38887
|
+
return v;
|
38888
|
+
}
|
38889
|
+
const p = this.#backgroundFetch(k, index, options, context);
|
38890
|
+
const hasStale = p.__staleWhileFetching !== undefined;
|
38891
|
+
const staleVal = hasStale && allowStale;
|
38892
|
+
if (status) {
|
38893
|
+
status.fetch = isStale ? "stale" : "refresh";
|
38894
|
+
if (staleVal && isStale)
|
38895
|
+
status.returnedStale = true;
|
38896
|
+
}
|
38897
|
+
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
36723
38898
|
}
|
36724
|
-
return unesc.trim();
|
36725
38899
|
}
|
36726
|
-
|
36727
|
-
|
36728
|
-
|
36729
|
-
|
36730
|
-
|
36731
|
-
|
36732
|
-
|
36733
|
-
|
36734
|
-
|
36735
|
-
|
36736
|
-
}
|
36737
|
-
|
36738
|
-
|
36739
|
-
|
36740
|
-
|
36741
|
-
|
36742
|
-
|
36743
|
-
|
36744
|
-
|
36745
|
-
|
36746
|
-
|
36747
|
-
|
36748
|
-
|
36749
|
-
|
36750
|
-
|
36751
|
-
|
36752
|
-
|
38900
|
+
async forceFetch(k, fetchOptions = {}) {
|
38901
|
+
const v = await this.fetch(k, fetchOptions);
|
38902
|
+
if (v === undefined)
|
38903
|
+
throw new Error("fetch() returned undefined");
|
38904
|
+
return v;
|
38905
|
+
}
|
38906
|
+
memo(k, memoOptions = {}) {
|
38907
|
+
const memoMethod = this.#memoMethod;
|
38908
|
+
if (!memoMethod) {
|
38909
|
+
throw new Error("no memoMethod provided to constructor");
|
38910
|
+
}
|
38911
|
+
const { context, forceRefresh, ...options } = memoOptions;
|
38912
|
+
const v = this.get(k, options);
|
38913
|
+
if (!forceRefresh && v !== undefined)
|
38914
|
+
return v;
|
38915
|
+
const vv = memoMethod(k, v, {
|
38916
|
+
options,
|
38917
|
+
context
|
38918
|
+
});
|
38919
|
+
this.set(k, vv, options);
|
38920
|
+
return vv;
|
38921
|
+
}
|
38922
|
+
get(k, getOptions = {}) {
|
38923
|
+
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
|
38924
|
+
const index = this.#keyMap.get(k);
|
38925
|
+
if (index !== undefined) {
|
38926
|
+
const value2 = this.#valList[index];
|
38927
|
+
const fetching = this.#isBackgroundFetch(value2);
|
38928
|
+
if (status)
|
38929
|
+
this.#statusTTL(status, index);
|
38930
|
+
if (this.#isStale(index)) {
|
38931
|
+
if (status)
|
38932
|
+
status.get = "stale";
|
38933
|
+
if (!fetching) {
|
38934
|
+
if (!noDeleteOnStaleGet) {
|
38935
|
+
this.#delete(k, "expire");
|
38936
|
+
}
|
38937
|
+
if (status && allowStale)
|
38938
|
+
status.returnedStale = true;
|
38939
|
+
return allowStale ? value2 : undefined;
|
38940
|
+
} else {
|
38941
|
+
if (status && allowStale && value2.__staleWhileFetching !== undefined) {
|
38942
|
+
status.returnedStale = true;
|
38943
|
+
}
|
38944
|
+
return allowStale ? value2.__staleWhileFetching : undefined;
|
38945
|
+
}
|
38946
|
+
} else {
|
38947
|
+
if (status)
|
38948
|
+
status.get = "hit";
|
38949
|
+
if (fetching) {
|
38950
|
+
return value2.__staleWhileFetching;
|
38951
|
+
}
|
38952
|
+
this.#moveToTail(index);
|
38953
|
+
if (updateAgeOnGet) {
|
38954
|
+
this.#updateItemAge(index);
|
38955
|
+
}
|
38956
|
+
return value2;
|
36753
38957
|
}
|
36754
|
-
}
|
36755
|
-
|
38958
|
+
} else if (status) {
|
38959
|
+
status.get = "miss";
|
36756
38960
|
}
|
36757
38961
|
}
|
36758
|
-
|
36759
|
-
|
36760
|
-
|
36761
|
-
const config3 = loadGitConfig();
|
36762
|
-
return {
|
36763
|
-
sshCommandSetInConfig: config3?.core?.sshCommand !== undefined,
|
36764
|
-
askPassSetInConfig: config3?.core?.askpass !== undefined
|
36765
|
-
};
|
36766
|
-
};
|
36767
|
-
var sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined;
|
36768
|
-
var askPassSetInEnv = process.env.GIT_ASKPASS !== undefined;
|
36769
|
-
var { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs();
|
36770
|
-
var finalGitEnv = {
|
36771
|
-
...askPassSetInEnv || askPassSetInConfig ? {} : {
|
36772
|
-
GIT_ASKPASS: "echo"
|
36773
|
-
},
|
36774
|
-
...sshCommandSetInEnv || sshCommandSetInConfig ? {} : {
|
36775
|
-
GIT_SSH_COMMAND: "ssh -oStrictHostKeyChecking=accept-new"
|
38962
|
+
#connect(p, n2) {
|
38963
|
+
this.#prev[n2] = p;
|
38964
|
+
this.#next[p] = n2;
|
36776
38965
|
}
|
36777
|
-
|
36778
|
-
|
36779
|
-
|
36780
|
-
|
36781
|
-
|
36782
|
-
|
36783
|
-
|
36784
|
-
|
36785
|
-
|
36786
|
-
|
36787
|
-
// ../../node_modules/@npmcli/git/lib/which.js
|
36788
|
-
var require_which = __commonJS((exports, module) => {
|
36789
|
-
var which = require_lib5();
|
36790
|
-
var gitPath;
|
36791
|
-
try {
|
36792
|
-
gitPath = which.sync("git");
|
36793
|
-
} catch {}
|
36794
|
-
module.exports = (opts = {}) => {
|
36795
|
-
if (opts.git) {
|
36796
|
-
return opts.git;
|
38966
|
+
#moveToTail(index) {
|
38967
|
+
if (index !== this.#tail) {
|
38968
|
+
if (index === this.#head) {
|
38969
|
+
this.#head = this.#next[index];
|
38970
|
+
} else {
|
38971
|
+
this.#connect(this.#prev[index], this.#next[index]);
|
38972
|
+
}
|
38973
|
+
this.#connect(this.#tail, index);
|
38974
|
+
this.#tail = index;
|
38975
|
+
}
|
36797
38976
|
}
|
36798
|
-
|
36799
|
-
return
|
38977
|
+
delete(k) {
|
38978
|
+
return this.#delete(k, "delete");
|
36800
38979
|
}
|
36801
|
-
|
36802
|
-
|
36803
|
-
|
36804
|
-
|
36805
|
-
|
36806
|
-
|
36807
|
-
|
36808
|
-
|
36809
|
-
|
36810
|
-
|
36811
|
-
|
36812
|
-
|
36813
|
-
|
36814
|
-
|
36815
|
-
|
36816
|
-
|
38980
|
+
#delete(k, reason) {
|
38981
|
+
let deleted = false;
|
38982
|
+
if (this.#size !== 0) {
|
38983
|
+
const index = this.#keyMap.get(k);
|
38984
|
+
if (index !== undefined) {
|
38985
|
+
deleted = true;
|
38986
|
+
if (this.#size === 1) {
|
38987
|
+
this.#clear(reason);
|
38988
|
+
} else {
|
38989
|
+
this.#removeItemSize(index);
|
38990
|
+
const v = this.#valList[index];
|
38991
|
+
if (this.#isBackgroundFetch(v)) {
|
38992
|
+
v.__abortController.abort(new Error("deleted"));
|
38993
|
+
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
38994
|
+
if (this.#hasDispose) {
|
38995
|
+
this.#dispose?.(v, k, reason);
|
38996
|
+
}
|
38997
|
+
if (this.#hasDisposeAfter) {
|
38998
|
+
this.#disposed?.push([v, k, reason]);
|
38999
|
+
}
|
39000
|
+
}
|
39001
|
+
this.#keyMap.delete(k);
|
39002
|
+
this.#keyList[index] = undefined;
|
39003
|
+
this.#valList[index] = undefined;
|
39004
|
+
if (index === this.#tail) {
|
39005
|
+
this.#tail = this.#prev[index];
|
39006
|
+
} else if (index === this.#head) {
|
39007
|
+
this.#head = this.#next[index];
|
39008
|
+
} else {
|
39009
|
+
const pi = this.#prev[index];
|
39010
|
+
this.#next[pi] = this.#next[index];
|
39011
|
+
const ni = this.#next[index];
|
39012
|
+
this.#prev[ni] = this.#prev[index];
|
39013
|
+
}
|
39014
|
+
this.#size--;
|
39015
|
+
this.#free.push(index);
|
39016
|
+
}
|
39017
|
+
}
|
39018
|
+
}
|
39019
|
+
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
39020
|
+
const dt2 = this.#disposed;
|
39021
|
+
let task;
|
39022
|
+
while (task = dt2?.shift()) {
|
39023
|
+
this.#disposeAfter?.(...task);
|
39024
|
+
}
|
39025
|
+
}
|
39026
|
+
return deleted;
|
36817
39027
|
}
|
36818
|
-
|
36819
|
-
|
36820
|
-
if (retryOpts === null || retryOpts === undefined) {
|
36821
|
-
retryOpts = {
|
36822
|
-
retries: opts.fetchRetries || 2,
|
36823
|
-
factor: opts.fetchRetryFactor || 10,
|
36824
|
-
maxTimeout: opts.fetchRetryMaxtimeout || 60000,
|
36825
|
-
minTimeout: opts.fetchRetryMintimeout || 1000
|
36826
|
-
};
|
39028
|
+
clear() {
|
39029
|
+
return this.#clear("delete");
|
36827
39030
|
}
|
36828
|
-
|
36829
|
-
|
36830
|
-
|
39031
|
+
#clear(reason) {
|
39032
|
+
for (const index of this.#rindexes({ allowStale: true })) {
|
39033
|
+
const v = this.#valList[index];
|
39034
|
+
if (this.#isBackgroundFetch(v)) {
|
39035
|
+
v.__abortController.abort(new Error("deleted"));
|
39036
|
+
} else {
|
39037
|
+
const k = this.#keyList[index];
|
39038
|
+
if (this.#hasDispose) {
|
39039
|
+
this.#dispose?.(v, k, reason);
|
39040
|
+
}
|
39041
|
+
if (this.#hasDisposeAfter) {
|
39042
|
+
this.#disposed?.push([v, k, reason]);
|
39043
|
+
}
|
39044
|
+
}
|
36831
39045
|
}
|
36832
|
-
|
36833
|
-
|
36834
|
-
|
36835
|
-
|
39046
|
+
this.#keyMap.clear();
|
39047
|
+
this.#valList.fill(undefined);
|
39048
|
+
this.#keyList.fill(undefined);
|
39049
|
+
if (this.#ttls && this.#starts) {
|
39050
|
+
this.#ttls.fill(0);
|
39051
|
+
this.#starts.fill(0);
|
39052
|
+
}
|
39053
|
+
if (this.#sizes) {
|
39054
|
+
this.#sizes.fill(0);
|
39055
|
+
}
|
39056
|
+
this.#head = 0;
|
39057
|
+
this.#tail = 0;
|
39058
|
+
this.#free.length = 0;
|
39059
|
+
this.#calculatedSize = 0;
|
39060
|
+
this.#size = 0;
|
39061
|
+
if (this.#hasDisposeAfter && this.#disposed) {
|
39062
|
+
const dt2 = this.#disposed;
|
39063
|
+
let task;
|
39064
|
+
while (task = dt2?.shift()) {
|
39065
|
+
this.#disposeAfter?.(...task);
|
36836
39066
|
}
|
36837
|
-
|
36838
|
-
|
36839
|
-
|
36840
|
-
|
39067
|
+
}
|
39068
|
+
}
|
39069
|
+
}
|
39070
|
+
exports.LRUCache = LRUCache2;
|
36841
39071
|
});
|
36842
39072
|
|
36843
39073
|
// ../../node_modules/semver/functions/inc.js
|
@@ -38266,7 +40496,7 @@ var require_lines_to_revs = __commonJS((exports, module) => {
|
|
38266
40496
|
// ../../node_modules/@npmcli/git/lib/revs.js
|
38267
40497
|
var require_revs = __commonJS((exports, module) => {
|
38268
40498
|
var spawn2 = require_spawn();
|
38269
|
-
var { LRUCache: LRUCache2 } =
|
40499
|
+
var { LRUCache: LRUCache2 } = require_commonjs7();
|
38270
40500
|
var linesToRevs = require_lines_to_revs();
|
38271
40501
|
var revsCache = new LRUCache2({
|
38272
40502
|
max: 100,
|
@@ -41007,7 +43237,7 @@ var require_normalize = __commonJS((exports, module) => {
|
|
41007
43237
|
var _glob;
|
41008
43238
|
function lazyLoadGlob() {
|
41009
43239
|
if (!_glob) {
|
41010
|
-
_glob =
|
43240
|
+
_glob = require_commonjs6().glob;
|
41011
43241
|
}
|
41012
43242
|
return _glob;
|
41013
43243
|
}
|
@@ -228184,11 +230414,11 @@ var require_visit = __commonJS((exports) => {
|
|
228184
230414
|
visit2.BREAK = BREAK;
|
228185
230415
|
visit2.SKIP = SKIP;
|
228186
230416
|
visit2.REMOVE = REMOVE;
|
228187
|
-
function visit_(
|
228188
|
-
const ctrl = callVisitor(
|
230417
|
+
function visit_(key3, node, visitor, path6) {
|
230418
|
+
const ctrl = callVisitor(key3, node, visitor, path6);
|
228189
230419
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
228190
|
-
replaceNode(
|
228191
|
-
return visit_(
|
230420
|
+
replaceNode(key3, path6, ctrl);
|
230421
|
+
return visit_(key3, ctrl, visitor, path6);
|
228192
230422
|
}
|
228193
230423
|
if (typeof ctrl !== "symbol") {
|
228194
230424
|
if (identity2.isCollection(node)) {
|
@@ -228232,11 +230462,11 @@ var require_visit = __commonJS((exports) => {
|
|
228232
230462
|
visitAsync.BREAK = BREAK;
|
228233
230463
|
visitAsync.SKIP = SKIP;
|
228234
230464
|
visitAsync.REMOVE = REMOVE;
|
228235
|
-
async function visitAsync_(
|
228236
|
-
const ctrl = await callVisitor(
|
230465
|
+
async function visitAsync_(key3, node, visitor, path6) {
|
230466
|
+
const ctrl = await callVisitor(key3, node, visitor, path6);
|
228237
230467
|
if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
|
228238
|
-
replaceNode(
|
228239
|
-
return visitAsync_(
|
230468
|
+
replaceNode(key3, path6, ctrl);
|
230469
|
+
return visitAsync_(key3, ctrl, visitor, path6);
|
228240
230470
|
}
|
228241
230471
|
if (typeof ctrl !== "symbol") {
|
228242
230472
|
if (identity2.isCollection(node)) {
|
@@ -228286,27 +230516,27 @@ var require_visit = __commonJS((exports) => {
|
|
228286
230516
|
}
|
228287
230517
|
return visitor;
|
228288
230518
|
}
|
228289
|
-
function callVisitor(
|
230519
|
+
function callVisitor(key3, node, visitor, path6) {
|
228290
230520
|
if (typeof visitor === "function")
|
228291
|
-
return visitor(
|
230521
|
+
return visitor(key3, node, path6);
|
228292
230522
|
if (identity2.isMap(node))
|
228293
|
-
return visitor.Map?.(
|
230523
|
+
return visitor.Map?.(key3, node, path6);
|
228294
230524
|
if (identity2.isSeq(node))
|
228295
|
-
return visitor.Seq?.(
|
230525
|
+
return visitor.Seq?.(key3, node, path6);
|
228296
230526
|
if (identity2.isPair(node))
|
228297
|
-
return visitor.Pair?.(
|
230527
|
+
return visitor.Pair?.(key3, node, path6);
|
228298
230528
|
if (identity2.isScalar(node))
|
228299
|
-
return visitor.Scalar?.(
|
230529
|
+
return visitor.Scalar?.(key3, node, path6);
|
228300
230530
|
if (identity2.isAlias(node))
|
228301
|
-
return visitor.Alias?.(
|
230531
|
+
return visitor.Alias?.(key3, node, path6);
|
228302
230532
|
return;
|
228303
230533
|
}
|
228304
|
-
function replaceNode(
|
230534
|
+
function replaceNode(key3, path6, node) {
|
228305
230535
|
const parent = path6[path6.length - 1];
|
228306
230536
|
if (identity2.isCollection(parent)) {
|
228307
|
-
parent.items[
|
230537
|
+
parent.items[key3] = node;
|
228308
230538
|
} else if (identity2.isPair(parent)) {
|
228309
|
-
if (
|
230539
|
+
if (key3 === "key")
|
228310
230540
|
parent.key = node;
|
228311
230541
|
else
|
228312
230542
|
parent.value = node;
|
@@ -228538,7 +230768,7 @@ var require_anchors = __commonJS((exports) => {
|
|
228538
230768
|
|
228539
230769
|
// ../../node_modules/yaml/dist/doc/applyReviver.js
|
228540
230770
|
var require_applyReviver = __commonJS((exports) => {
|
228541
|
-
function applyReviver(reviver, obj,
|
230771
|
+
function applyReviver(reviver, obj, key3, val) {
|
228542
230772
|
if (val && typeof val === "object") {
|
228543
230773
|
if (Array.isArray(val)) {
|
228544
230774
|
for (let i7 = 0, len = val.length;i7 < len; ++i7) {
|
@@ -228578,7 +230808,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
228578
230808
|
}
|
228579
230809
|
}
|
228580
230810
|
}
|
228581
|
-
return reviver.call(obj,
|
230811
|
+
return reviver.call(obj, key3, val);
|
228582
230812
|
}
|
228583
230813
|
exports.applyReviver = applyReviver;
|
228584
230814
|
});
|
@@ -228896,29 +231126,29 @@ var require_Collection = __commonJS((exports) => {
|
|
228896
231126
|
if (isEmptyPath(path6))
|
228897
231127
|
this.add(value4);
|
228898
231128
|
else {
|
228899
|
-
const [
|
228900
|
-
const node = this.get(
|
231129
|
+
const [key3, ...rest] = path6;
|
231130
|
+
const node = this.get(key3, true);
|
228901
231131
|
if (identity2.isCollection(node))
|
228902
231132
|
node.addIn(rest, value4);
|
228903
231133
|
else if (node === undefined && this.schema)
|
228904
|
-
this.set(
|
231134
|
+
this.set(key3, collectionFromPath(this.schema, rest, value4));
|
228905
231135
|
else
|
228906
|
-
throw new Error(`Expected YAML collection at ${
|
231136
|
+
throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
|
228907
231137
|
}
|
228908
231138
|
}
|
228909
231139
|
deleteIn(path6) {
|
228910
|
-
const [
|
231140
|
+
const [key3, ...rest] = path6;
|
228911
231141
|
if (rest.length === 0)
|
228912
|
-
return this.delete(
|
228913
|
-
const node = this.get(
|
231142
|
+
return this.delete(key3);
|
231143
|
+
const node = this.get(key3, true);
|
228914
231144
|
if (identity2.isCollection(node))
|
228915
231145
|
return node.deleteIn(rest);
|
228916
231146
|
else
|
228917
|
-
throw new Error(`Expected YAML collection at ${
|
231147
|
+
throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
|
228918
231148
|
}
|
228919
231149
|
getIn(path6, keepScalar) {
|
228920
|
-
const [
|
228921
|
-
const node = this.get(
|
231150
|
+
const [key3, ...rest] = path6;
|
231151
|
+
const node = this.get(key3, true);
|
228922
231152
|
if (rest.length === 0)
|
228923
231153
|
return !keepScalar && identity2.isScalar(node) ? node.value : node;
|
228924
231154
|
else
|
@@ -228933,24 +231163,24 @@ var require_Collection = __commonJS((exports) => {
|
|
228933
231163
|
});
|
228934
231164
|
}
|
228935
231165
|
hasIn(path6) {
|
228936
|
-
const [
|
231166
|
+
const [key3, ...rest] = path6;
|
228937
231167
|
if (rest.length === 0)
|
228938
|
-
return this.has(
|
228939
|
-
const node = this.get(
|
231168
|
+
return this.has(key3);
|
231169
|
+
const node = this.get(key3, true);
|
228940
231170
|
return identity2.isCollection(node) ? node.hasIn(rest) : false;
|
228941
231171
|
}
|
228942
231172
|
setIn(path6, value4) {
|
228943
|
-
const [
|
231173
|
+
const [key3, ...rest] = path6;
|
228944
231174
|
if (rest.length === 0) {
|
228945
|
-
this.set(
|
231175
|
+
this.set(key3, value4);
|
228946
231176
|
} else {
|
228947
|
-
const node = this.get(
|
231177
|
+
const node = this.get(key3, true);
|
228948
231178
|
if (identity2.isCollection(node))
|
228949
231179
|
node.setIn(rest, value4);
|
228950
231180
|
else if (node === undefined && this.schema)
|
228951
|
-
this.set(
|
231181
|
+
this.set(key3, collectionFromPath(this.schema, rest, value4));
|
228952
231182
|
else
|
228953
|
-
throw new Error(`Expected YAML collection at ${
|
231183
|
+
throw new Error(`Expected YAML collection at ${key3}. Remaining path: ${rest}`);
|
228954
231184
|
}
|
228955
231185
|
}
|
228956
231186
|
}
|
@@ -229538,19 +231768,19 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
229538
231768
|
var Scalar = require_Scalar();
|
229539
231769
|
var stringify3 = require_stringify();
|
229540
231770
|
var stringifyComment = require_stringifyComment();
|
229541
|
-
function stringifyPair2({ key:
|
231771
|
+
function stringifyPair2({ key: key3, value: value4 }, ctx, onComment, onChompKeep) {
|
229542
231772
|
const { allNullValues, doc, indent: indent2, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
229543
|
-
let keyComment = identity2.isNode(
|
231773
|
+
let keyComment = identity2.isNode(key3) && key3.comment || null;
|
229544
231774
|
if (simpleKeys) {
|
229545
231775
|
if (keyComment) {
|
229546
231776
|
throw new Error("With simple keys, key nodes cannot have comments");
|
229547
231777
|
}
|
229548
|
-
if (identity2.isCollection(
|
231778
|
+
if (identity2.isCollection(key3) || !identity2.isNode(key3) && typeof key3 === "object") {
|
229549
231779
|
const msg = "With simple keys, collection cannot be used as a key value";
|
229550
231780
|
throw new Error(msg);
|
229551
231781
|
}
|
229552
231782
|
}
|
229553
|
-
let explicitKey = !simpleKeys && (!
|
231783
|
+
let explicitKey = !simpleKeys && (!key3 || keyComment && value4 == null && !ctx.inFlow || identity2.isCollection(key3) || (identity2.isScalar(key3) ? key3.type === Scalar.Scalar.BLOCK_FOLDED || key3.type === Scalar.Scalar.BLOCK_LITERAL : typeof key3 === "object"));
|
229554
231784
|
ctx = Object.assign({}, ctx, {
|
229555
231785
|
allNullValues: false,
|
229556
231786
|
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
|
@@ -229558,7 +231788,7 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
229558
231788
|
});
|
229559
231789
|
let keyCommentDone = false;
|
229560
231790
|
let chompKeep = false;
|
229561
|
-
let str = stringify3.stringify(
|
231791
|
+
let str = stringify3.stringify(key3, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
229562
231792
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
229563
231793
|
if (simpleKeys)
|
229564
231794
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
@@ -229702,7 +231932,7 @@ var require_merge = __commonJS((exports) => {
|
|
229702
231932
|
}),
|
229703
231933
|
stringify: () => MERGE_KEY
|
229704
231934
|
};
|
229705
|
-
var isMergeKey = (ctx,
|
231935
|
+
var isMergeKey = (ctx, key3) => (merge3.identify(key3) || identity2.isScalar(key3) && (!key3.type || key3.type === Scalar.Scalar.PLAIN) && merge3.identify(key3.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default);
|
229706
231936
|
function addMergeToJSMap(ctx, map3, value4) {
|
229707
231937
|
value4 = ctx && identity2.isAlias(value4) ? value4.resolve(ctx.doc) : value4;
|
229708
231938
|
if (identity2.isSeq(value4))
|
@@ -229719,14 +231949,14 @@ var require_merge = __commonJS((exports) => {
|
|
229719
231949
|
if (!identity2.isMap(source))
|
229720
231950
|
throw new Error("Merge sources must be maps or map aliases");
|
229721
231951
|
const srcMap = source.toJSON(null, ctx, Map);
|
229722
|
-
for (const [
|
231952
|
+
for (const [key3, value5] of srcMap) {
|
229723
231953
|
if (map3 instanceof Map) {
|
229724
|
-
if (!map3.has(
|
229725
|
-
map3.set(
|
231954
|
+
if (!map3.has(key3))
|
231955
|
+
map3.set(key3, value5);
|
229726
231956
|
} else if (map3 instanceof Set) {
|
229727
|
-
map3.add(
|
229728
|
-
} else if (!Object.prototype.hasOwnProperty.call(map3,
|
229729
|
-
Object.defineProperty(map3,
|
231957
|
+
map3.add(key3);
|
231958
|
+
} else if (!Object.prototype.hasOwnProperty.call(map3, key3)) {
|
231959
|
+
Object.defineProperty(map3, key3, {
|
229730
231960
|
value: value5,
|
229731
231961
|
writable: true,
|
229732
231962
|
enumerable: true,
|
@@ -229748,19 +231978,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
229748
231978
|
var stringify3 = require_stringify();
|
229749
231979
|
var identity2 = require_identity();
|
229750
231980
|
var toJS = require_toJS();
|
229751
|
-
function addPairToJSMap(ctx, map3, { key:
|
229752
|
-
if (identity2.isNode(
|
229753
|
-
|
229754
|
-
else if (merge3.isMergeKey(ctx,
|
231981
|
+
function addPairToJSMap(ctx, map3, { key: key3, value: value4 }) {
|
231982
|
+
if (identity2.isNode(key3) && key3.addToJSMap)
|
231983
|
+
key3.addToJSMap(ctx, map3, value4);
|
231984
|
+
else if (merge3.isMergeKey(ctx, key3))
|
229755
231985
|
merge3.addMergeToJSMap(ctx, map3, value4);
|
229756
231986
|
else {
|
229757
|
-
const jsKey = toJS.toJS(
|
231987
|
+
const jsKey = toJS.toJS(key3, "", ctx);
|
229758
231988
|
if (map3 instanceof Map) {
|
229759
231989
|
map3.set(jsKey, toJS.toJS(value4, jsKey, ctx));
|
229760
231990
|
} else if (map3 instanceof Set) {
|
229761
231991
|
map3.add(jsKey);
|
229762
231992
|
} else {
|
229763
|
-
const stringKey = stringifyKey(
|
231993
|
+
const stringKey = stringifyKey(key3, jsKey, ctx);
|
229764
231994
|
const jsValue = toJS.toJS(value4, stringKey, ctx);
|
229765
231995
|
if (stringKey in map3)
|
229766
231996
|
Object.defineProperty(map3, stringKey, {
|
@@ -229775,19 +232005,19 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
229775
232005
|
}
|
229776
232006
|
return map3;
|
229777
232007
|
}
|
229778
|
-
function stringifyKey(
|
232008
|
+
function stringifyKey(key3, jsKey, ctx) {
|
229779
232009
|
if (jsKey === null)
|
229780
232010
|
return "";
|
229781
232011
|
if (typeof jsKey !== "object")
|
229782
232012
|
return String(jsKey);
|
229783
|
-
if (identity2.isNode(
|
232013
|
+
if (identity2.isNode(key3) && ctx?.doc) {
|
229784
232014
|
const strCtx = stringify3.createStringifyContext(ctx.doc, {});
|
229785
232015
|
strCtx.anchors = new Set;
|
229786
232016
|
for (const node of ctx.anchors.keys())
|
229787
232017
|
strCtx.anchors.add(node.anchor);
|
229788
232018
|
strCtx.inFlow = true;
|
229789
232019
|
strCtx.inStringifyKey = true;
|
229790
|
-
const strKey =
|
232020
|
+
const strKey = key3.toString(strCtx);
|
229791
232021
|
if (!ctx.mapKeyWarned) {
|
229792
232022
|
let jsonStr = JSON.stringify(strKey);
|
229793
232023
|
if (jsonStr.length > 40)
|
@@ -229808,25 +232038,25 @@ var require_Pair = __commonJS((exports) => {
|
|
229808
232038
|
var stringifyPair2 = require_stringifyPair();
|
229809
232039
|
var addPairToJSMap = require_addPairToJSMap();
|
229810
232040
|
var identity2 = require_identity();
|
229811
|
-
function createPair(
|
229812
|
-
const k6 = createNode.createNode(
|
232041
|
+
function createPair(key3, value4, ctx) {
|
232042
|
+
const k6 = createNode.createNode(key3, undefined, ctx);
|
229813
232043
|
const v7 = createNode.createNode(value4, undefined, ctx);
|
229814
232044
|
return new Pair(k6, v7);
|
229815
232045
|
}
|
229816
232046
|
|
229817
232047
|
class Pair {
|
229818
|
-
constructor(
|
232048
|
+
constructor(key3, value4 = null) {
|
229819
232049
|
Object.defineProperty(this, identity2.NODE_TYPE, { value: identity2.PAIR });
|
229820
|
-
this.key =
|
232050
|
+
this.key = key3;
|
229821
232051
|
this.value = value4;
|
229822
232052
|
}
|
229823
232053
|
clone(schema) {
|
229824
|
-
let { key:
|
229825
|
-
if (identity2.isNode(
|
229826
|
-
|
232054
|
+
let { key: key3, value: value4 } = this;
|
232055
|
+
if (identity2.isNode(key3))
|
232056
|
+
key3 = key3.clone(schema);
|
229827
232057
|
if (identity2.isNode(value4))
|
229828
232058
|
value4 = value4.clone(schema);
|
229829
|
-
return new Pair(
|
232059
|
+
return new Pair(key3, value4);
|
229830
232060
|
}
|
229831
232061
|
toJSON(_6, ctx) {
|
229832
232062
|
const pair = ctx?.mapAsMap ? new Map : {};
|
@@ -229993,11 +232223,11 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
229993
232223
|
var identity2 = require_identity();
|
229994
232224
|
var Pair = require_Pair();
|
229995
232225
|
var Scalar = require_Scalar();
|
229996
|
-
function findPair(items,
|
229997
|
-
const k6 = identity2.isScalar(
|
232226
|
+
function findPair(items, key3) {
|
232227
|
+
const k6 = identity2.isScalar(key3) ? key3.value : key3;
|
229998
232228
|
for (const it2 of items) {
|
229999
232229
|
if (identity2.isPair(it2)) {
|
230000
|
-
if (it2.key ===
|
232230
|
+
if (it2.key === key3 || it2.key === k6)
|
230001
232231
|
return it2;
|
230002
232232
|
if (identity2.isScalar(it2.key) && it2.key.value === k6)
|
230003
232233
|
return it2;
|
@@ -230017,20 +232247,20 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
230017
232247
|
static from(schema, obj, ctx) {
|
230018
232248
|
const { keepUndefined, replacer } = ctx;
|
230019
232249
|
const map3 = new this(schema);
|
230020
|
-
const add = (
|
232250
|
+
const add = (key3, value4) => {
|
230021
232251
|
if (typeof replacer === "function")
|
230022
|
-
value4 = replacer.call(obj,
|
230023
|
-
else if (Array.isArray(replacer) && !replacer.includes(
|
232252
|
+
value4 = replacer.call(obj, key3, value4);
|
232253
|
+
else if (Array.isArray(replacer) && !replacer.includes(key3))
|
230024
232254
|
return;
|
230025
232255
|
if (value4 !== undefined || keepUndefined)
|
230026
|
-
map3.items.push(Pair.createPair(
|
232256
|
+
map3.items.push(Pair.createPair(key3, value4, ctx));
|
230027
232257
|
};
|
230028
232258
|
if (obj instanceof Map) {
|
230029
|
-
for (const [
|
230030
|
-
add(
|
232259
|
+
for (const [key3, value4] of obj)
|
232260
|
+
add(key3, value4);
|
230031
232261
|
} else if (obj && typeof obj === "object") {
|
230032
|
-
for (const
|
230033
|
-
add(
|
232262
|
+
for (const key3 of Object.keys(obj))
|
232263
|
+
add(key3, obj[key3]);
|
230034
232264
|
}
|
230035
232265
|
if (typeof schema.sortMapEntries === "function") {
|
230036
232266
|
map3.items.sort(schema.sortMapEntries);
|
@@ -230064,23 +232294,23 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
230064
232294
|
this.items.push(_pair);
|
230065
232295
|
}
|
230066
232296
|
}
|
230067
|
-
delete(
|
230068
|
-
const it2 = findPair(this.items,
|
232297
|
+
delete(key3) {
|
232298
|
+
const it2 = findPair(this.items, key3);
|
230069
232299
|
if (!it2)
|
230070
232300
|
return false;
|
230071
232301
|
const del = this.items.splice(this.items.indexOf(it2), 1);
|
230072
232302
|
return del.length > 0;
|
230073
232303
|
}
|
230074
|
-
get(
|
230075
|
-
const it2 = findPair(this.items,
|
232304
|
+
get(key3, keepScalar) {
|
232305
|
+
const it2 = findPair(this.items, key3);
|
230076
232306
|
const node = it2?.value;
|
230077
232307
|
return (!keepScalar && identity2.isScalar(node) ? node.value : node) ?? undefined;
|
230078
232308
|
}
|
230079
|
-
has(
|
230080
|
-
return !!findPair(this.items,
|
232309
|
+
has(key3) {
|
232310
|
+
return !!findPair(this.items, key3);
|
230081
232311
|
}
|
230082
|
-
set(
|
230083
|
-
this.add(new Pair.Pair(
|
232312
|
+
set(key3, value4) {
|
232313
|
+
this.add(new Pair.Pair(key3, value4), true);
|
230084
232314
|
}
|
230085
232315
|
toJSON(_6, ctx, Type) {
|
230086
232316
|
const map3 = Type ? new Type : ctx?.mapAsMap ? new Map : {};
|
@@ -230151,28 +232381,28 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
230151
232381
|
add(value4) {
|
230152
232382
|
this.items.push(value4);
|
230153
232383
|
}
|
230154
|
-
delete(
|
230155
|
-
const idx = asItemIndex(
|
232384
|
+
delete(key3) {
|
232385
|
+
const idx = asItemIndex(key3);
|
230156
232386
|
if (typeof idx !== "number")
|
230157
232387
|
return false;
|
230158
232388
|
const del = this.items.splice(idx, 1);
|
230159
232389
|
return del.length > 0;
|
230160
232390
|
}
|
230161
|
-
get(
|
230162
|
-
const idx = asItemIndex(
|
232391
|
+
get(key3, keepScalar) {
|
232392
|
+
const idx = asItemIndex(key3);
|
230163
232393
|
if (typeof idx !== "number")
|
230164
232394
|
return;
|
230165
232395
|
const it2 = this.items[idx];
|
230166
232396
|
return !keepScalar && identity2.isScalar(it2) ? it2.value : it2;
|
230167
232397
|
}
|
230168
|
-
has(
|
230169
|
-
const idx = asItemIndex(
|
232398
|
+
has(key3) {
|
232399
|
+
const idx = asItemIndex(key3);
|
230170
232400
|
return typeof idx === "number" && idx < this.items.length;
|
230171
232401
|
}
|
230172
|
-
set(
|
230173
|
-
const idx = asItemIndex(
|
232402
|
+
set(key3, value4) {
|
232403
|
+
const idx = asItemIndex(key3);
|
230174
232404
|
if (typeof idx !== "number")
|
230175
|
-
throw new Error(`Expected a valid index, not ${
|
232405
|
+
throw new Error(`Expected a valid index, not ${key3}.`);
|
230176
232406
|
const prev = this.items[idx];
|
230177
232407
|
if (identity2.isScalar(prev) && Scalar.isScalarValue(value4))
|
230178
232408
|
prev.value = value4;
|
@@ -230206,8 +232436,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
230206
232436
|
let i7 = 0;
|
230207
232437
|
for (let it2 of obj) {
|
230208
232438
|
if (typeof replacer === "function") {
|
230209
|
-
const
|
230210
|
-
it2 = replacer.call(obj,
|
232439
|
+
const key3 = obj instanceof Set ? it2 : String(i7++);
|
232440
|
+
it2 = replacer.call(obj, key3, it2);
|
230211
232441
|
}
|
230212
232442
|
seq.items.push(createNode.createNode(it2, undefined, ctx));
|
230213
232443
|
}
|
@@ -230215,8 +232445,8 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
230215
232445
|
return seq;
|
230216
232446
|
}
|
230217
232447
|
}
|
230218
|
-
function asItemIndex(
|
230219
|
-
let idx = identity2.isScalar(
|
232448
|
+
function asItemIndex(key3) {
|
232449
|
+
let idx = identity2.isScalar(key3) ? key3.value : key3;
|
230220
232450
|
if (idx && typeof idx === "string")
|
230221
232451
|
idx = Number(idx);
|
230222
232452
|
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
|
@@ -230590,25 +232820,25 @@ ${cn.comment}` : item.comment;
|
|
230590
232820
|
for (let it2 of iterable) {
|
230591
232821
|
if (typeof replacer === "function")
|
230592
232822
|
it2 = replacer.call(iterable, String(i7++), it2);
|
230593
|
-
let
|
232823
|
+
let key3, value4;
|
230594
232824
|
if (Array.isArray(it2)) {
|
230595
232825
|
if (it2.length === 2) {
|
230596
|
-
|
232826
|
+
key3 = it2[0];
|
230597
232827
|
value4 = it2[1];
|
230598
232828
|
} else
|
230599
232829
|
throw new TypeError(`Expected [key, value] tuple: ${it2}`);
|
230600
232830
|
} else if (it2 && it2 instanceof Object) {
|
230601
232831
|
const keys = Object.keys(it2);
|
230602
232832
|
if (keys.length === 1) {
|
230603
|
-
|
230604
|
-
value4 = it2[
|
232833
|
+
key3 = keys[0];
|
232834
|
+
value4 = it2[key3];
|
230605
232835
|
} else {
|
230606
232836
|
throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
|
230607
232837
|
}
|
230608
232838
|
} else {
|
230609
|
-
|
232839
|
+
key3 = it2;
|
230610
232840
|
}
|
230611
|
-
pairs2.items.push(Pair.createPair(
|
232841
|
+
pairs2.items.push(Pair.createPair(key3, value4, ctx));
|
230612
232842
|
}
|
230613
232843
|
return pairs2;
|
230614
232844
|
}
|
@@ -230649,16 +232879,16 @@ var require_omap = __commonJS((exports) => {
|
|
230649
232879
|
if (ctx?.onCreate)
|
230650
232880
|
ctx.onCreate(map3);
|
230651
232881
|
for (const pair of this.items) {
|
230652
|
-
let
|
232882
|
+
let key3, value4;
|
230653
232883
|
if (identity2.isPair(pair)) {
|
230654
|
-
|
230655
|
-
value4 = toJS.toJS(pair.value,
|
232884
|
+
key3 = toJS.toJS(pair.key, "", ctx);
|
232885
|
+
value4 = toJS.toJS(pair.value, key3, ctx);
|
230656
232886
|
} else {
|
230657
|
-
|
232887
|
+
key3 = toJS.toJS(pair, "", ctx);
|
230658
232888
|
}
|
230659
|
-
if (map3.has(
|
232889
|
+
if (map3.has(key3))
|
230660
232890
|
throw new Error("Ordered maps must not include duplicate keys");
|
230661
|
-
map3.set(
|
232891
|
+
map3.set(key3, value4);
|
230662
232892
|
}
|
230663
232893
|
return map3;
|
230664
232894
|
}
|
@@ -230679,12 +232909,12 @@ var require_omap = __commonJS((exports) => {
|
|
230679
232909
|
resolve(seq, onError) {
|
230680
232910
|
const pairs$1 = pairs.resolvePairs(seq, onError);
|
230681
232911
|
const seenKeys = [];
|
230682
|
-
for (const { key:
|
230683
|
-
if (identity2.isScalar(
|
230684
|
-
if (seenKeys.includes(
|
230685
|
-
onError(`Ordered maps must not include duplicate keys: ${
|
232912
|
+
for (const { key: key3 } of pairs$1.items) {
|
232913
|
+
if (identity2.isScalar(key3)) {
|
232914
|
+
if (seenKeys.includes(key3.value)) {
|
232915
|
+
onError(`Ordered maps must not include duplicate keys: ${key3.value}`);
|
230686
232916
|
} else {
|
230687
|
-
seenKeys.push(
|
232917
|
+
seenKeys.push(key3.value);
|
230688
232918
|
}
|
230689
232919
|
}
|
230690
232920
|
}
|
@@ -230858,30 +233088,30 @@ var require_set = __commonJS((exports) => {
|
|
230858
233088
|
super(schema);
|
230859
233089
|
this.tag = YAMLSet.tag;
|
230860
233090
|
}
|
230861
|
-
add(
|
233091
|
+
add(key3) {
|
230862
233092
|
let pair;
|
230863
|
-
if (identity2.isPair(
|
230864
|
-
pair =
|
230865
|
-
else if (
|
230866
|
-
pair = new Pair.Pair(
|
233093
|
+
if (identity2.isPair(key3))
|
233094
|
+
pair = key3;
|
233095
|
+
else if (key3 && typeof key3 === "object" && "key" in key3 && "value" in key3 && key3.value === null)
|
233096
|
+
pair = new Pair.Pair(key3.key, null);
|
230867
233097
|
else
|
230868
|
-
pair = new Pair.Pair(
|
233098
|
+
pair = new Pair.Pair(key3, null);
|
230869
233099
|
const prev = YAMLMap.findPair(this.items, pair.key);
|
230870
233100
|
if (!prev)
|
230871
233101
|
this.items.push(pair);
|
230872
233102
|
}
|
230873
|
-
get(
|
230874
|
-
const pair = YAMLMap.findPair(this.items,
|
233103
|
+
get(key3, keepPair) {
|
233104
|
+
const pair = YAMLMap.findPair(this.items, key3);
|
230875
233105
|
return !keepPair && identity2.isPair(pair) ? identity2.isScalar(pair.key) ? pair.key.value : pair.key : pair;
|
230876
233106
|
}
|
230877
|
-
set(
|
233107
|
+
set(key3, value4) {
|
230878
233108
|
if (typeof value4 !== "boolean")
|
230879
233109
|
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value4}`);
|
230880
|
-
const prev = YAMLMap.findPair(this.items,
|
233110
|
+
const prev = YAMLMap.findPair(this.items, key3);
|
230881
233111
|
if (prev && !value4) {
|
230882
233112
|
this.items.splice(this.items.indexOf(prev), 1);
|
230883
233113
|
} else if (!prev && value4) {
|
230884
|
-
this.items.push(new Pair.Pair(
|
233114
|
+
this.items.push(new Pair.Pair(key3));
|
230885
233115
|
}
|
230886
233116
|
}
|
230887
233117
|
toJSON(_6, ctx) {
|
@@ -231116,7 +233346,7 @@ var require_tags = __commonJS((exports) => {
|
|
231116
233346
|
if (Array.isArray(customTags))
|
231117
233347
|
tags = [];
|
231118
233348
|
else {
|
231119
|
-
const keys = Array.from(schemas.keys()).filter((
|
233349
|
+
const keys = Array.from(schemas.keys()).filter((key3) => key3 !== "yaml11").map((key3) => JSON.stringify(key3)).join(", ");
|
231120
233350
|
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
|
231121
233351
|
}
|
231122
233352
|
}
|
@@ -231132,7 +233362,7 @@ var require_tags = __commonJS((exports) => {
|
|
231132
233362
|
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
|
231133
233363
|
if (!tagObj) {
|
231134
233364
|
const tagName = JSON.stringify(tag);
|
231135
|
-
const keys = Object.keys(tagsByName).map((
|
233365
|
+
const keys = Object.keys(tagsByName).map((key3) => JSON.stringify(key3)).join(", ");
|
231136
233366
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
231137
233367
|
}
|
231138
233368
|
if (!tags2.includes(tagObj))
|
@@ -231367,13 +233597,13 @@ var require_Document = __commonJS((exports) => {
|
|
231367
233597
|
setAnchors();
|
231368
233598
|
return node;
|
231369
233599
|
}
|
231370
|
-
createPair(
|
231371
|
-
const k6 = this.createNode(
|
233600
|
+
createPair(key3, value4, options = {}) {
|
233601
|
+
const k6 = this.createNode(key3, null, options);
|
231372
233602
|
const v7 = this.createNode(value4, null, options);
|
231373
233603
|
return new Pair.Pair(k6, v7);
|
231374
233604
|
}
|
231375
|
-
delete(
|
231376
|
-
return assertCollection(this.contents) ? this.contents.delete(
|
233605
|
+
delete(key3) {
|
233606
|
+
return assertCollection(this.contents) ? this.contents.delete(key3) : false;
|
231377
233607
|
}
|
231378
233608
|
deleteIn(path6) {
|
231379
233609
|
if (Collection.isEmptyPath(path6)) {
|
@@ -231384,27 +233614,27 @@ var require_Document = __commonJS((exports) => {
|
|
231384
233614
|
}
|
231385
233615
|
return assertCollection(this.contents) ? this.contents.deleteIn(path6) : false;
|
231386
233616
|
}
|
231387
|
-
get(
|
231388
|
-
return identity2.isCollection(this.contents) ? this.contents.get(
|
233617
|
+
get(key3, keepScalar) {
|
233618
|
+
return identity2.isCollection(this.contents) ? this.contents.get(key3, keepScalar) : undefined;
|
231389
233619
|
}
|
231390
233620
|
getIn(path6, keepScalar) {
|
231391
233621
|
if (Collection.isEmptyPath(path6))
|
231392
233622
|
return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
|
231393
233623
|
return identity2.isCollection(this.contents) ? this.contents.getIn(path6, keepScalar) : undefined;
|
231394
233624
|
}
|
231395
|
-
has(
|
231396
|
-
return identity2.isCollection(this.contents) ? this.contents.has(
|
233625
|
+
has(key3) {
|
233626
|
+
return identity2.isCollection(this.contents) ? this.contents.has(key3) : false;
|
231397
233627
|
}
|
231398
233628
|
hasIn(path6) {
|
231399
233629
|
if (Collection.isEmptyPath(path6))
|
231400
233630
|
return this.contents !== undefined;
|
231401
233631
|
return identity2.isCollection(this.contents) ? this.contents.hasIn(path6) : false;
|
231402
233632
|
}
|
231403
|
-
set(
|
233633
|
+
set(key3, value4) {
|
231404
233634
|
if (this.contents == null) {
|
231405
|
-
this.contents = Collection.collectionFromPath(this.schema, [
|
233635
|
+
this.contents = Collection.collectionFromPath(this.schema, [key3], value4);
|
231406
233636
|
} else if (assertCollection(this.contents)) {
|
231407
|
-
this.contents.set(
|
233637
|
+
this.contents.set(key3, value4);
|
231408
233638
|
}
|
231409
233639
|
}
|
231410
233640
|
setIn(path6, value4) {
|
@@ -231688,25 +233918,25 @@ var require_resolve_props = __commonJS((exports) => {
|
|
231688
233918
|
|
231689
233919
|
// ../../node_modules/yaml/dist/compose/util-contains-newline.js
|
231690
233920
|
var require_util_contains_newline = __commonJS((exports) => {
|
231691
|
-
function containsNewline(
|
231692
|
-
if (!
|
233921
|
+
function containsNewline(key3) {
|
233922
|
+
if (!key3)
|
231693
233923
|
return null;
|
231694
|
-
switch (
|
233924
|
+
switch (key3.type) {
|
231695
233925
|
case "alias":
|
231696
233926
|
case "scalar":
|
231697
233927
|
case "double-quoted-scalar":
|
231698
233928
|
case "single-quoted-scalar":
|
231699
|
-
if (
|
233929
|
+
if (key3.source.includes(`
|
231700
233930
|
`))
|
231701
233931
|
return true;
|
231702
|
-
if (
|
231703
|
-
for (const st2 of
|
233932
|
+
if (key3.end) {
|
233933
|
+
for (const st2 of key3.end)
|
231704
233934
|
if (st2.type === "newline")
|
231705
233935
|
return true;
|
231706
233936
|
}
|
231707
233937
|
return false;
|
231708
233938
|
case "flow-collection":
|
231709
|
-
for (const it2 of
|
233939
|
+
for (const it2 of key3.items) {
|
231710
233940
|
for (const st2 of it2.start)
|
231711
233941
|
if (st2.type === "newline")
|
231712
233942
|
return true;
|
@@ -231771,10 +234001,10 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
231771
234001
|
let offset = bm.offset;
|
231772
234002
|
let commentEnd = null;
|
231773
234003
|
for (const collItem of bm.items) {
|
231774
|
-
const { start: start3, key:
|
234004
|
+
const { start: start3, key: key3, sep: sep3, value: value4 } = collItem;
|
231775
234005
|
const keyProps = resolveProps.resolveProps(start3, {
|
231776
234006
|
indicator: "explicit-key-ind",
|
231777
|
-
next:
|
234007
|
+
next: key3 ?? sep3?.[0],
|
231778
234008
|
offset,
|
231779
234009
|
onError,
|
231780
234010
|
parentIndent: bm.indent,
|
@@ -231782,10 +234012,10 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
231782
234012
|
});
|
231783
234013
|
const implicitKey = !keyProps.found;
|
231784
234014
|
if (implicitKey) {
|
231785
|
-
if (
|
231786
|
-
if (
|
234015
|
+
if (key3) {
|
234016
|
+
if (key3.type === "block-seq")
|
231787
234017
|
onError(offset, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
|
231788
|
-
else if ("indent" in
|
234018
|
+
else if ("indent" in key3 && key3.indent !== bm.indent)
|
231789
234019
|
onError(offset, "BAD_INDENT", startColMsg);
|
231790
234020
|
}
|
231791
234021
|
if (!keyProps.anchor && !keyProps.tag && !sep3) {
|
@@ -231799,17 +234029,17 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
231799
234029
|
}
|
231800
234030
|
continue;
|
231801
234031
|
}
|
231802
|
-
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(
|
231803
|
-
onError(
|
234032
|
+
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key3)) {
|
234033
|
+
onError(key3 ?? start3[start3.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
231804
234034
|
}
|
231805
234035
|
} else if (keyProps.found?.indent !== bm.indent) {
|
231806
234036
|
onError(offset, "BAD_INDENT", startColMsg);
|
231807
234037
|
}
|
231808
234038
|
ctx.atKey = true;
|
231809
234039
|
const keyStart = keyProps.end;
|
231810
|
-
const keyNode =
|
234040
|
+
const keyNode = key3 ? composeNode(ctx, key3, keyProps, onError) : composeEmptyNode(ctx, keyStart, start3, null, keyProps, onError);
|
231811
234041
|
if (ctx.schema.compat)
|
231812
|
-
utilFlowIndentCheck.flowIndentCheck(bm.indent,
|
234042
|
+
utilFlowIndentCheck.flowIndentCheck(bm.indent, key3, onError);
|
231813
234043
|
ctx.atKey = false;
|
231814
234044
|
if (utilMapIncludes.mapIncludes(ctx, map3.items, keyNode))
|
231815
234045
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
@@ -231819,7 +234049,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
231819
234049
|
offset: keyNode.range[2],
|
231820
234050
|
onError,
|
231821
234051
|
parentIndent: bm.indent,
|
231822
|
-
startOnNewline: !
|
234052
|
+
startOnNewline: !key3 || key3.type === "block-scalar"
|
231823
234053
|
});
|
231824
234054
|
offset = valueProps.end;
|
231825
234055
|
if (valueProps.found) {
|
@@ -231975,11 +234205,11 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
231975
234205
|
let offset = fc.offset + fc.start.source.length;
|
231976
234206
|
for (let i7 = 0;i7 < fc.items.length; ++i7) {
|
231977
234207
|
const collItem = fc.items[i7];
|
231978
|
-
const { start: start3, key:
|
234208
|
+
const { start: start3, key: key3, sep: sep3, value: value4 } = collItem;
|
231979
234209
|
const props = resolveProps.resolveProps(start3, {
|
231980
234210
|
flow: fcName,
|
231981
234211
|
indicator: "explicit-key-ind",
|
231982
|
-
next:
|
234212
|
+
next: key3 ?? sep3?.[0],
|
231983
234213
|
offset,
|
231984
234214
|
onError,
|
231985
234215
|
parentIndent: fc.indent,
|
@@ -232001,8 +234231,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
232001
234231
|
offset = props.end;
|
232002
234232
|
continue;
|
232003
234233
|
}
|
232004
|
-
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(
|
232005
|
-
onError(
|
234234
|
+
if (!isMap && ctx.options.strict && utilContainsNewline.containsNewline(key3))
|
234235
|
+
onError(key3, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
|
232006
234236
|
}
|
232007
234237
|
if (i7 === 0) {
|
232008
234238
|
if (props.comma)
|
@@ -232047,8 +234277,8 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
232047
234277
|
} else {
|
232048
234278
|
ctx.atKey = true;
|
232049
234279
|
const keyStart = props.end;
|
232050
|
-
const keyNode =
|
232051
|
-
if (isBlock(
|
234280
|
+
const keyNode = key3 ? composeNode(ctx, key3, props, onError) : composeEmptyNode(ctx, keyStart, start3, null, props, onError);
|
234281
|
+
if (isBlock(key3))
|
232052
234282
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
232053
234283
|
ctx.atKey = false;
|
232054
234284
|
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
@@ -232860,7 +235090,7 @@ var require_composer = __commonJS((exports) => {
|
|
232860
235090
|
var node_process = __require("node:process");
|
232861
235091
|
var directives4 = require_directives2();
|
232862
235092
|
var Document = require_Document();
|
232863
|
-
var
|
235093
|
+
var errors3 = require_errors3();
|
232864
235094
|
var identity2 = require_identity();
|
232865
235095
|
var composeDoc = require_compose_doc();
|
232866
235096
|
var resolveEnd = require_resolve_end();
|
@@ -232911,9 +235141,9 @@ var require_composer = __commonJS((exports) => {
|
|
232911
235141
|
this.onError = (source, code2, message, warning) => {
|
232912
235142
|
const pos = getErrorPos(source);
|
232913
235143
|
if (warning)
|
232914
|
-
this.warnings.push(new
|
235144
|
+
this.warnings.push(new errors3.YAMLWarning(pos, code2, message));
|
232915
235145
|
else
|
232916
|
-
this.errors.push(new
|
235146
|
+
this.errors.push(new errors3.YAMLParseError(pos, code2, message));
|
232917
235147
|
};
|
232918
235148
|
this.directives = new directives4.Directives({ version: options.version || "1.2" });
|
232919
235149
|
this.options = options;
|
@@ -232997,7 +235227,7 @@ ${cb}` : comment;
|
|
232997
235227
|
break;
|
232998
235228
|
case "error": {
|
232999
235229
|
const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
|
233000
|
-
const error5 = new
|
235230
|
+
const error5 = new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
|
233001
235231
|
if (this.atDirectives || !this.doc)
|
233002
235232
|
this.errors.push(error5);
|
233003
235233
|
else
|
@@ -233007,7 +235237,7 @@ ${cb}` : comment;
|
|
233007
235237
|
case "doc-end": {
|
233008
235238
|
if (!this.doc) {
|
233009
235239
|
const msg = "Unexpected doc-end without preceding document";
|
233010
|
-
this.errors.push(new
|
235240
|
+
this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
|
233011
235241
|
break;
|
233012
235242
|
}
|
233013
235243
|
this.doc.directives.docEnd = true;
|
@@ -233022,7 +235252,7 @@ ${end.comment}` : end.comment;
|
|
233022
235252
|
break;
|
233023
235253
|
}
|
233024
235254
|
default:
|
233025
|
-
this.errors.push(new
|
235255
|
+
this.errors.push(new errors3.YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
|
233026
235256
|
}
|
233027
235257
|
}
|
233028
235258
|
*end(forceDoc = false, endOffset = -1) {
|
@@ -233048,7 +235278,7 @@ ${end.comment}` : end.comment;
|
|
233048
235278
|
var require_cst_scalar = __commonJS((exports) => {
|
233049
235279
|
var resolveBlockScalar = require_resolve_block_scalar();
|
233050
235280
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
233051
|
-
var
|
235281
|
+
var errors3 = require_errors3();
|
233052
235282
|
var stringifyString = require_stringifyString();
|
233053
235283
|
function resolveAsScalar(token, strict = true, onError) {
|
233054
235284
|
if (token) {
|
@@ -233057,7 +235287,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
233057
235287
|
if (onError)
|
233058
235288
|
onError(offset, code2, message);
|
233059
235289
|
else
|
233060
|
-
throw new
|
235290
|
+
throw new errors3.YAMLParseError([offset, offset + 1], code2, message);
|
233061
235291
|
};
|
233062
235292
|
switch (token.type) {
|
233063
235293
|
case "scalar":
|
@@ -233171,9 +235401,9 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
233171
235401
|
if (!addEndtoBlockProps(props, "end" in token ? token.end : undefined))
|
233172
235402
|
props.push({ type: "newline", offset: -1, indent: indent2, source: `
|
233173
235403
|
` });
|
233174
|
-
for (const
|
233175
|
-
if (
|
233176
|
-
delete token[
|
235404
|
+
for (const key3 of Object.keys(token))
|
235405
|
+
if (key3 !== "type" && key3 !== "offset")
|
235406
|
+
delete token[key3];
|
233177
235407
|
Object.assign(token, { type: "block-scalar", indent: indent2, props, source: body });
|
233178
235408
|
}
|
233179
235409
|
}
|
@@ -233222,9 +235452,9 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
233222
235452
|
default: {
|
233223
235453
|
const indent2 = "indent" in token ? token.indent : -1;
|
233224
235454
|
const end = "end" in token && Array.isArray(token.end) ? token.end.filter((st2) => st2.type === "space" || st2.type === "comment" || st2.type === "newline") : [];
|
233225
|
-
for (const
|
233226
|
-
if (
|
233227
|
-
delete token[
|
235455
|
+
for (const key3 of Object.keys(token))
|
235456
|
+
if (key3 !== "type" && key3 !== "offset")
|
235457
|
+
delete token[key3];
|
233228
235458
|
Object.assign(token, { type: type4, indent: indent2, source, end });
|
233229
235459
|
}
|
233230
235460
|
}
|
@@ -233276,12 +235506,12 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
233276
235506
|
}
|
233277
235507
|
}
|
233278
235508
|
}
|
233279
|
-
function stringifyItem({ start: start3, key:
|
235509
|
+
function stringifyItem({ start: start3, key: key3, sep: sep3, value: value4 }) {
|
233280
235510
|
let res = "";
|
233281
235511
|
for (const st2 of start3)
|
233282
235512
|
res += st2.source;
|
233283
|
-
if (
|
233284
|
-
res += stringifyToken(
|
235513
|
+
if (key3)
|
235514
|
+
res += stringifyToken(key3);
|
233285
235515
|
if (sep3)
|
233286
235516
|
for (const st2 of sep3)
|
233287
235517
|
res += st2.source;
|
@@ -234577,7 +236807,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
234577
236807
|
});
|
234578
236808
|
} else if (isFlowToken(it2.key) && !includesToken(it2.sep, "newline")) {
|
234579
236809
|
const start4 = getFirstKeyStartProps(it2.start);
|
234580
|
-
const
|
236810
|
+
const key3 = it2.key;
|
234581
236811
|
const sep3 = it2.sep;
|
234582
236812
|
sep3.push(this.sourceToken);
|
234583
236813
|
delete it2.key;
|
@@ -234586,7 +236816,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
234586
236816
|
type: "block-map",
|
234587
236817
|
offset: this.offset,
|
234588
236818
|
indent: this.indent,
|
234589
|
-
items: [{ start: start4, key:
|
236819
|
+
items: [{ start: start4, key: key3, sep: sep3 }]
|
234590
236820
|
});
|
234591
236821
|
} else if (start3.length > 0) {
|
234592
236822
|
it2.sep = it2.sep.concat(start3, this.sourceToken);
|
@@ -234919,7 +237149,7 @@ var require_parser2 = __commonJS((exports) => {
|
|
234919
237149
|
var require_public_api = __commonJS((exports) => {
|
234920
237150
|
var composer = require_composer();
|
234921
237151
|
var Document = require_Document();
|
234922
|
-
var
|
237152
|
+
var errors3 = require_errors3();
|
234923
237153
|
var log = require_log();
|
234924
237154
|
var identity2 = require_identity();
|
234925
237155
|
var lineCounter = require_line_counter();
|
@@ -234936,8 +237166,8 @@ var require_public_api = __commonJS((exports) => {
|
|
234936
237166
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
234937
237167
|
if (prettyErrors && lineCounter2)
|
234938
237168
|
for (const doc of docs) {
|
234939
|
-
doc.errors.forEach(
|
234940
|
-
doc.warnings.forEach(
|
237169
|
+
doc.errors.forEach(errors3.prettifyError(source, lineCounter2));
|
237170
|
+
doc.warnings.forEach(errors3.prettifyError(source, lineCounter2));
|
234941
237171
|
}
|
234942
237172
|
if (docs.length > 0)
|
234943
237173
|
return docs;
|
@@ -234952,13 +237182,13 @@ var require_public_api = __commonJS((exports) => {
|
|
234952
237182
|
if (!doc)
|
234953
237183
|
doc = _doc;
|
234954
237184
|
else if (doc.options.logLevel !== "silent") {
|
234955
|
-
doc.errors.push(new
|
237185
|
+
doc.errors.push(new errors3.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
234956
237186
|
break;
|
234957
237187
|
}
|
234958
237188
|
}
|
234959
237189
|
if (prettyErrors && lineCounter2) {
|
234960
|
-
doc.errors.forEach(
|
234961
|
-
doc.warnings.forEach(
|
237190
|
+
doc.errors.forEach(errors3.prettifyError(source, lineCounter2));
|
237191
|
+
doc.warnings.forEach(errors3.prettifyError(source, lineCounter2));
|
234962
237192
|
}
|
234963
237193
|
return doc;
|
234964
237194
|
}
|
@@ -240787,7 +243017,7 @@ minimatch.unescape = unescape2;
|
|
240787
243017
|
// ../../node_modules/glob/dist/esm/glob.js
|
240788
243018
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
240789
243019
|
|
240790
|
-
// ../../node_modules/lru-cache/dist/esm/index.js
|
243020
|
+
// ../../node_modules/path-scurry/node_modules/lru-cache/dist/esm/index.js
|
240791
243021
|
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
240792
243022
|
var warned = new Set;
|
240793
243023
|
var PROCESS = typeof process === "object" && !!process ? process : {};
|
@@ -245345,7 +247575,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
245345
247575
|
var package_default = {
|
245346
247576
|
name: "@settlemint/sdk-cli",
|
245347
247577
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
245348
|
-
version: "2.2.3-
|
247578
|
+
version: "2.2.3-pr19ac75c7",
|
245349
247579
|
type: "module",
|
245350
247580
|
private: false,
|
245351
247581
|
license: "FSL-1.1-MIT",
|
@@ -245392,11 +247622,11 @@ var package_default = {
|
|
245392
247622
|
commander: "11.1.0",
|
245393
247623
|
"@inquirer/confirm": "5.1.9",
|
245394
247624
|
"@inquirer/input": "4.1.9",
|
245395
|
-
"@inquirer/password": "4.0.
|
247625
|
+
"@inquirer/password": "4.0.13",
|
245396
247626
|
"@inquirer/select": "4.2.0",
|
245397
|
-
"@settlemint/sdk-js": "2.2.3-
|
245398
|
-
"@settlemint/sdk-utils": "2.2.3-
|
245399
|
-
"@types/node": "22.15.
|
247627
|
+
"@settlemint/sdk-js": "2.2.3-pr19ac75c7",
|
247628
|
+
"@settlemint/sdk-utils": "2.2.3-pr19ac75c7",
|
247629
|
+
"@types/node": "22.15.17",
|
245400
247630
|
"@types/semver": "7.7.0",
|
245401
247631
|
"@types/which": "3.0.4",
|
245402
247632
|
"get-tsconfig": "4.10.0",
|
@@ -245409,7 +247639,7 @@ var package_default = {
|
|
245409
247639
|
yoctocolors: "2.1.1"
|
245410
247640
|
},
|
245411
247641
|
peerDependencies: {
|
245412
|
-
hardhat: "2.
|
247642
|
+
hardhat: "2.24.0"
|
245413
247643
|
},
|
245414
247644
|
peerDependenciesMeta: {
|
245415
247645
|
hardhat: {
|
@@ -248824,7 +251054,7 @@ var getPlatformConfigQuery = graphql(`
|
|
248824
251054
|
disabled
|
248825
251055
|
}
|
248826
251056
|
}
|
248827
|
-
|
251057
|
+
preDeployedContracts
|
248828
251058
|
sdkVersion
|
248829
251059
|
kits {
|
248830
251060
|
id
|
@@ -252413,20 +254643,476 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
252413
254643
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
252414
254644
|
});
|
252415
254645
|
|
252416
|
-
// ../../node_modules/@inquirer/password/dist/esm/
|
254646
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/key.js
|
254647
|
+
var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
|
254648
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
254649
|
+
class AbortPromptError2 extends Error {
|
254650
|
+
name = "AbortPromptError";
|
254651
|
+
message = "Prompt was aborted";
|
254652
|
+
constructor(options) {
|
254653
|
+
super();
|
254654
|
+
this.cause = options?.cause;
|
254655
|
+
}
|
254656
|
+
}
|
254657
|
+
|
254658
|
+
class CancelPromptError2 extends Error {
|
254659
|
+
name = "CancelPromptError";
|
254660
|
+
message = "Prompt was canceled";
|
254661
|
+
}
|
254662
|
+
|
254663
|
+
class ExitPromptError2 extends Error {
|
254664
|
+
name = "ExitPromptError";
|
254665
|
+
}
|
254666
|
+
|
254667
|
+
class HookError2 extends Error {
|
254668
|
+
name = "HookError";
|
254669
|
+
}
|
254670
|
+
|
254671
|
+
class ValidationError2 extends Error {
|
254672
|
+
name = "ValidationError";
|
254673
|
+
}
|
254674
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
254675
|
+
import { AsyncResource as AsyncResource5 } from "node:async_hooks";
|
254676
|
+
|
254677
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
254678
|
+
import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
|
254679
|
+
var hookStorage2 = new AsyncLocalStorage2;
|
254680
|
+
function createStore2(rl) {
|
254681
|
+
const store = {
|
254682
|
+
rl,
|
254683
|
+
hooks: [],
|
254684
|
+
hooksCleanup: [],
|
254685
|
+
hooksEffect: [],
|
254686
|
+
index: 0,
|
254687
|
+
handleChange() {}
|
254688
|
+
};
|
254689
|
+
return store;
|
254690
|
+
}
|
254691
|
+
function withHooks2(rl, cb) {
|
254692
|
+
const store = createStore2(rl);
|
254693
|
+
return hookStorage2.run(store, () => {
|
254694
|
+
function cycle(render) {
|
254695
|
+
store.handleChange = () => {
|
254696
|
+
store.index = 0;
|
254697
|
+
render();
|
254698
|
+
};
|
254699
|
+
store.handleChange();
|
254700
|
+
}
|
254701
|
+
return cb(cycle);
|
254702
|
+
});
|
254703
|
+
}
|
254704
|
+
function getStore2() {
|
254705
|
+
const store = hookStorage2.getStore();
|
254706
|
+
if (!store) {
|
254707
|
+
throw new HookError2("[Inquirer] Hook functions can only be called from within a prompt");
|
254708
|
+
}
|
254709
|
+
return store;
|
254710
|
+
}
|
254711
|
+
function readline3() {
|
254712
|
+
return getStore2().rl;
|
254713
|
+
}
|
254714
|
+
function withUpdates2(fn) {
|
254715
|
+
const wrapped = (...args) => {
|
254716
|
+
const store = getStore2();
|
254717
|
+
let shouldUpdate = false;
|
254718
|
+
const oldHandleChange = store.handleChange;
|
254719
|
+
store.handleChange = () => {
|
254720
|
+
shouldUpdate = true;
|
254721
|
+
};
|
254722
|
+
const returnValue = fn(...args);
|
254723
|
+
if (shouldUpdate) {
|
254724
|
+
oldHandleChange();
|
254725
|
+
}
|
254726
|
+
store.handleChange = oldHandleChange;
|
254727
|
+
return returnValue;
|
254728
|
+
};
|
254729
|
+
return AsyncResource4.bind(wrapped);
|
254730
|
+
}
|
254731
|
+
function withPointer2(cb) {
|
254732
|
+
const store = getStore2();
|
254733
|
+
const { index } = store;
|
254734
|
+
const pointer = {
|
254735
|
+
get() {
|
254736
|
+
return store.hooks[index];
|
254737
|
+
},
|
254738
|
+
set(value4) {
|
254739
|
+
store.hooks[index] = value4;
|
254740
|
+
},
|
254741
|
+
initialized: index in store.hooks
|
254742
|
+
};
|
254743
|
+
const returnValue = cb(pointer);
|
254744
|
+
store.index++;
|
254745
|
+
return returnValue;
|
254746
|
+
}
|
254747
|
+
function handleChange2() {
|
254748
|
+
getStore2().handleChange();
|
254749
|
+
}
|
254750
|
+
var effectScheduler2 = {
|
254751
|
+
queue(cb) {
|
254752
|
+
const store = getStore2();
|
254753
|
+
const { index } = store;
|
254754
|
+
store.hooksEffect.push(() => {
|
254755
|
+
store.hooksCleanup[index]?.();
|
254756
|
+
const cleanFn = cb(readline3());
|
254757
|
+
if (cleanFn != null && typeof cleanFn !== "function") {
|
254758
|
+
throw new ValidationError2("useEffect return value must be a cleanup function or nothing.");
|
254759
|
+
}
|
254760
|
+
store.hooksCleanup[index] = cleanFn;
|
254761
|
+
});
|
254762
|
+
},
|
254763
|
+
run() {
|
254764
|
+
const store = getStore2();
|
254765
|
+
withUpdates2(() => {
|
254766
|
+
store.hooksEffect.forEach((effect) => {
|
254767
|
+
effect();
|
254768
|
+
});
|
254769
|
+
store.hooksEffect.length = 0;
|
254770
|
+
})();
|
254771
|
+
},
|
254772
|
+
clearAll() {
|
254773
|
+
const store = getStore2();
|
254774
|
+
store.hooksCleanup.forEach((cleanFn) => {
|
254775
|
+
cleanFn?.();
|
254776
|
+
});
|
254777
|
+
store.hooksEffect.length = 0;
|
254778
|
+
store.hooksCleanup.length = 0;
|
254779
|
+
}
|
254780
|
+
};
|
254781
|
+
|
254782
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
254783
|
+
function useState2(defaultValue) {
|
254784
|
+
return withPointer2((pointer) => {
|
254785
|
+
const setFn = (newValue) => {
|
254786
|
+
if (pointer.get() !== newValue) {
|
254787
|
+
pointer.set(newValue);
|
254788
|
+
handleChange2();
|
254789
|
+
}
|
254790
|
+
};
|
254791
|
+
if (pointer.initialized) {
|
254792
|
+
return [pointer.get(), setFn];
|
254793
|
+
}
|
254794
|
+
const value4 = typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
254795
|
+
pointer.set(value4);
|
254796
|
+
return [value4, setFn];
|
254797
|
+
});
|
254798
|
+
}
|
254799
|
+
|
254800
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
254801
|
+
function useEffect2(cb, depArray) {
|
254802
|
+
withPointer2((pointer) => {
|
254803
|
+
const oldDeps = pointer.get();
|
254804
|
+
const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i6) => !Object.is(dep, oldDeps[i6]));
|
254805
|
+
if (hasChanged) {
|
254806
|
+
effectScheduler2.queue(cb);
|
254807
|
+
}
|
254808
|
+
pointer.set(depArray);
|
254809
|
+
});
|
254810
|
+
}
|
254811
|
+
|
254812
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
254813
|
+
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
254814
|
+
var defaultTheme2 = {
|
254815
|
+
prefix: {
|
254816
|
+
idle: import_yoctocolors_cjs4.default.blue("?"),
|
254817
|
+
done: import_yoctocolors_cjs4.default.green(esm_default.tick)
|
254818
|
+
},
|
254819
|
+
spinner: {
|
254820
|
+
interval: 80,
|
254821
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs4.default.yellow(frame))
|
254822
|
+
},
|
254823
|
+
style: {
|
254824
|
+
answer: import_yoctocolors_cjs4.default.cyan,
|
254825
|
+
message: import_yoctocolors_cjs4.default.bold,
|
254826
|
+
error: (text2) => import_yoctocolors_cjs4.default.red(`> ${text2}`),
|
254827
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs4.default.dim(`(${text2})`),
|
254828
|
+
help: import_yoctocolors_cjs4.default.dim,
|
254829
|
+
highlight: import_yoctocolors_cjs4.default.cyan,
|
254830
|
+
key: (text2) => import_yoctocolors_cjs4.default.cyan(import_yoctocolors_cjs4.default.bold(`<${text2}>`))
|
254831
|
+
}
|
254832
|
+
};
|
254833
|
+
|
254834
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
254835
|
+
function isPlainObject3(value4) {
|
254836
|
+
if (typeof value4 !== "object" || value4 === null)
|
254837
|
+
return false;
|
254838
|
+
let proto = value4;
|
254839
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
254840
|
+
proto = Object.getPrototypeOf(proto);
|
254841
|
+
}
|
254842
|
+
return Object.getPrototypeOf(value4) === proto;
|
254843
|
+
}
|
254844
|
+
function deepMerge3(...objects) {
|
254845
|
+
const output = {};
|
254846
|
+
for (const obj of objects) {
|
254847
|
+
for (const [key2, value4] of Object.entries(obj)) {
|
254848
|
+
const prevValue = output[key2];
|
254849
|
+
output[key2] = isPlainObject3(prevValue) && isPlainObject3(value4) ? deepMerge3(prevValue, value4) : value4;
|
254850
|
+
}
|
254851
|
+
}
|
254852
|
+
return output;
|
254853
|
+
}
|
254854
|
+
function makeTheme2(...themes) {
|
254855
|
+
const themesToMerge = [
|
254856
|
+
defaultTheme2,
|
254857
|
+
...themes.filter((theme) => theme != null)
|
254858
|
+
];
|
254859
|
+
return deepMerge3(...themesToMerge);
|
254860
|
+
}
|
254861
|
+
|
254862
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
254863
|
+
function usePrefix2({ status = "idle", theme }) {
|
254864
|
+
const [showLoader, setShowLoader] = useState2(false);
|
254865
|
+
const [tick, setTick] = useState2(0);
|
254866
|
+
const { prefix, spinner: spinner2 } = makeTheme2(theme);
|
254867
|
+
useEffect2(() => {
|
254868
|
+
if (status === "loading") {
|
254869
|
+
let tickInterval;
|
254870
|
+
let inc = -1;
|
254871
|
+
const delayTimeout = setTimeout(AsyncResource5.bind(() => {
|
254872
|
+
setShowLoader(true);
|
254873
|
+
tickInterval = setInterval(AsyncResource5.bind(() => {
|
254874
|
+
inc = inc + 1;
|
254875
|
+
setTick(inc % spinner2.frames.length);
|
254876
|
+
}), spinner2.interval);
|
254877
|
+
}), 300);
|
254878
|
+
return () => {
|
254879
|
+
clearTimeout(delayTimeout);
|
254880
|
+
clearInterval(tickInterval);
|
254881
|
+
};
|
254882
|
+
} else {
|
254883
|
+
setShowLoader(false);
|
254884
|
+
}
|
254885
|
+
}, [status]);
|
254886
|
+
if (showLoader) {
|
254887
|
+
return spinner2.frames[tick];
|
254888
|
+
}
|
254889
|
+
const iconName = status === "loading" ? "idle" : status;
|
254890
|
+
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
254891
|
+
}
|
254892
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
254893
|
+
function useRef2(val) {
|
254894
|
+
return useState2({ current: val })[0];
|
254895
|
+
}
|
254896
|
+
|
254897
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
254898
|
+
function useKeypress2(userHandler) {
|
254899
|
+
const signal = useRef2(userHandler);
|
254900
|
+
signal.current = userHandler;
|
254901
|
+
useEffect2((rl) => {
|
254902
|
+
let ignore = false;
|
254903
|
+
const handler = withUpdates2((_input, event) => {
|
254904
|
+
if (ignore)
|
254905
|
+
return;
|
254906
|
+
signal.current(event, rl);
|
254907
|
+
});
|
254908
|
+
rl.input.on("keypress", handler);
|
254909
|
+
return () => {
|
254910
|
+
ignore = true;
|
254911
|
+
rl.input.removeListener("keypress", handler);
|
254912
|
+
};
|
254913
|
+
}, []);
|
254914
|
+
}
|
254915
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
254916
|
+
var import_cli_width2 = __toESM(require_cli_width(), 1);
|
254917
|
+
var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
|
254918
|
+
function breakLines2(content, width) {
|
254919
|
+
return content.split(`
|
254920
|
+
`).flatMap((line) => import_wrap_ansi2.default(line, width, { trim: false, hard: true }).split(`
|
254921
|
+
`).map((str) => str.trimEnd())).join(`
|
254922
|
+
`);
|
254923
|
+
}
|
254924
|
+
function readlineWidth2() {
|
254925
|
+
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
254926
|
+
}
|
254927
|
+
|
254928
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
254929
|
+
var import_mute_stream2 = __toESM(require_lib(), 1);
|
254930
|
+
import * as readline4 from "node:readline";
|
254931
|
+
import { AsyncResource as AsyncResource6 } from "node:async_hooks";
|
254932
|
+
|
254933
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
252417
254934
|
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
252418
|
-
|
254935
|
+
import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
|
254936
|
+
var height2 = (content) => content.split(`
|
254937
|
+
`).length;
|
254938
|
+
var lastLine2 = (content) => content.split(`
|
254939
|
+
`).pop() ?? "";
|
254940
|
+
function cursorDown2(n6) {
|
254941
|
+
return n6 > 0 ? import_ansi_escapes3.default.cursorDown(n6) : "";
|
254942
|
+
}
|
254943
|
+
|
254944
|
+
class ScreenManager2 {
|
254945
|
+
height = 0;
|
254946
|
+
extraLinesUnderPrompt = 0;
|
254947
|
+
cursorPos;
|
254948
|
+
rl;
|
254949
|
+
constructor(rl) {
|
254950
|
+
this.rl = rl;
|
254951
|
+
this.cursorPos = rl.getCursorPos();
|
254952
|
+
}
|
254953
|
+
write(content) {
|
254954
|
+
this.rl.output.unmute();
|
254955
|
+
this.rl.output.write(content);
|
254956
|
+
this.rl.output.mute();
|
254957
|
+
}
|
254958
|
+
render(content, bottomContent = "") {
|
254959
|
+
const promptLine = lastLine2(content);
|
254960
|
+
const rawPromptLine = stripVTControlCharacters3(promptLine);
|
254961
|
+
let prompt = rawPromptLine;
|
254962
|
+
if (this.rl.line.length > 0) {
|
254963
|
+
prompt = prompt.slice(0, -this.rl.line.length);
|
254964
|
+
}
|
254965
|
+
this.rl.setPrompt(prompt);
|
254966
|
+
this.cursorPos = this.rl.getCursorPos();
|
254967
|
+
const width = readlineWidth2();
|
254968
|
+
content = breakLines2(content, width);
|
254969
|
+
bottomContent = breakLines2(bottomContent, width);
|
254970
|
+
if (rawPromptLine.length % width === 0) {
|
254971
|
+
content += `
|
254972
|
+
`;
|
254973
|
+
}
|
254974
|
+
let output = content + (bottomContent ? `
|
254975
|
+
` + bottomContent : "");
|
254976
|
+
const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
|
254977
|
+
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height2(bottomContent) : 0);
|
254978
|
+
if (bottomContentHeight > 0)
|
254979
|
+
output += import_ansi_escapes3.default.cursorUp(bottomContentHeight);
|
254980
|
+
output += import_ansi_escapes3.default.cursorTo(this.cursorPos.cols);
|
254981
|
+
this.write(cursorDown2(this.extraLinesUnderPrompt) + import_ansi_escapes3.default.eraseLines(this.height) + output);
|
254982
|
+
this.extraLinesUnderPrompt = bottomContentHeight;
|
254983
|
+
this.height = height2(output);
|
254984
|
+
}
|
254985
|
+
checkCursorPos() {
|
254986
|
+
const cursorPos = this.rl.getCursorPos();
|
254987
|
+
if (cursorPos.cols !== this.cursorPos.cols) {
|
254988
|
+
this.write(import_ansi_escapes3.default.cursorTo(cursorPos.cols));
|
254989
|
+
this.cursorPos = cursorPos;
|
254990
|
+
}
|
254991
|
+
}
|
254992
|
+
done({ clearContent }) {
|
254993
|
+
this.rl.setPrompt("");
|
254994
|
+
let output = cursorDown2(this.extraLinesUnderPrompt);
|
254995
|
+
output += clearContent ? import_ansi_escapes3.default.eraseLines(this.height) : `
|
254996
|
+
`;
|
254997
|
+
output += import_ansi_escapes3.default.cursorShow;
|
254998
|
+
this.write(output);
|
254999
|
+
this.rl.close();
|
255000
|
+
}
|
255001
|
+
}
|
255002
|
+
|
255003
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
255004
|
+
class PromisePolyfill2 extends Promise {
|
255005
|
+
static withResolver() {
|
255006
|
+
let resolve6;
|
255007
|
+
let reject;
|
255008
|
+
const promise = new Promise((res, rej) => {
|
255009
|
+
resolve6 = res;
|
255010
|
+
reject = rej;
|
255011
|
+
});
|
255012
|
+
return { promise, resolve: resolve6, reject };
|
255013
|
+
}
|
255014
|
+
}
|
255015
|
+
|
255016
|
+
// ../../node_modules/@inquirer/password/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
255017
|
+
function getCallSites2() {
|
255018
|
+
const _prepareStackTrace = Error.prepareStackTrace;
|
255019
|
+
let result = [];
|
255020
|
+
try {
|
255021
|
+
Error.prepareStackTrace = (_5, callSites) => {
|
255022
|
+
const callSitesWithoutCurrent = callSites.slice(1);
|
255023
|
+
result = callSitesWithoutCurrent;
|
255024
|
+
return callSitesWithoutCurrent;
|
255025
|
+
};
|
255026
|
+
new Error().stack;
|
255027
|
+
} catch {
|
255028
|
+
return result;
|
255029
|
+
}
|
255030
|
+
Error.prepareStackTrace = _prepareStackTrace;
|
255031
|
+
return result;
|
255032
|
+
}
|
255033
|
+
function createPrompt2(view) {
|
255034
|
+
const callSites = getCallSites2();
|
255035
|
+
const prompt = (config3, context = {}) => {
|
255036
|
+
const { input = process.stdin, signal } = context;
|
255037
|
+
const cleanups = new Set;
|
255038
|
+
const output = new import_mute_stream2.default;
|
255039
|
+
output.pipe(context.output ?? process.stdout);
|
255040
|
+
const rl = readline4.createInterface({
|
255041
|
+
terminal: true,
|
255042
|
+
input,
|
255043
|
+
output
|
255044
|
+
});
|
255045
|
+
const screen = new ScreenManager2(rl);
|
255046
|
+
const { promise, resolve: resolve6, reject } = PromisePolyfill2.withResolver();
|
255047
|
+
const cancel3 = () => reject(new CancelPromptError2);
|
255048
|
+
if (signal) {
|
255049
|
+
const abort = () => reject(new AbortPromptError2({ cause: signal.reason }));
|
255050
|
+
if (signal.aborted) {
|
255051
|
+
abort();
|
255052
|
+
return Object.assign(promise, { cancel: cancel3 });
|
255053
|
+
}
|
255054
|
+
signal.addEventListener("abort", abort);
|
255055
|
+
cleanups.add(() => signal.removeEventListener("abort", abort));
|
255056
|
+
}
|
255057
|
+
cleanups.add(onExit((code2, signal2) => {
|
255058
|
+
reject(new ExitPromptError2(`User force closed the prompt with ${code2} ${signal2}`));
|
255059
|
+
}));
|
255060
|
+
const sigint = () => reject(new ExitPromptError2(`User force closed the prompt with SIGINT`));
|
255061
|
+
rl.on("SIGINT", sigint);
|
255062
|
+
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
255063
|
+
const checkCursorPos = () => screen.checkCursorPos();
|
255064
|
+
rl.input.on("keypress", checkCursorPos);
|
255065
|
+
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
255066
|
+
return withHooks2(rl, (cycle) => {
|
255067
|
+
const hooksCleanup = AsyncResource6.bind(() => effectScheduler2.clearAll());
|
255068
|
+
rl.on("close", hooksCleanup);
|
255069
|
+
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
255070
|
+
cycle(() => {
|
255071
|
+
try {
|
255072
|
+
const nextView = view(config3, (value4) => {
|
255073
|
+
setImmediate(() => resolve6(value4));
|
255074
|
+
});
|
255075
|
+
if (nextView === undefined) {
|
255076
|
+
const callerFilename = callSites[1]?.getFileName();
|
255077
|
+
throw new Error(`Prompt functions must return a string.
|
255078
|
+
at ${callerFilename}`);
|
255079
|
+
}
|
255080
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
255081
|
+
screen.render(content, bottomContent);
|
255082
|
+
effectScheduler2.run();
|
255083
|
+
} catch (error5) {
|
255084
|
+
reject(error5);
|
255085
|
+
}
|
255086
|
+
});
|
255087
|
+
return Object.assign(promise.then((answer) => {
|
255088
|
+
effectScheduler2.clearAll();
|
255089
|
+
return answer;
|
255090
|
+
}, (error5) => {
|
255091
|
+
effectScheduler2.clearAll();
|
255092
|
+
throw error5;
|
255093
|
+
}).finally(() => {
|
255094
|
+
cleanups.forEach((cleanup) => cleanup());
|
255095
|
+
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
255096
|
+
output.end();
|
255097
|
+
}).then(() => promise), { cancel: cancel3 });
|
255098
|
+
});
|
255099
|
+
};
|
255100
|
+
return prompt;
|
255101
|
+
}
|
255102
|
+
// ../../node_modules/@inquirer/password/dist/esm/index.js
|
255103
|
+
var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
255104
|
+
var esm_default5 = createPrompt2((config3, done) => {
|
252419
255105
|
const { validate: validate3 = () => true } = config3;
|
252420
|
-
const theme =
|
252421
|
-
const [status, setStatus] =
|
252422
|
-
const [errorMsg, setError] =
|
252423
|
-
const [value4, setValue] =
|
252424
|
-
const prefix =
|
252425
|
-
|
255106
|
+
const theme = makeTheme2(config3.theme);
|
255107
|
+
const [status, setStatus] = useState2("idle");
|
255108
|
+
const [errorMsg, setError] = useState2();
|
255109
|
+
const [value4, setValue] = useState2("");
|
255110
|
+
const prefix = usePrefix2({ status, theme });
|
255111
|
+
useKeypress2(async (key3, rl) => {
|
252426
255112
|
if (status !== "idle") {
|
252427
255113
|
return;
|
252428
255114
|
}
|
252429
|
-
if (
|
255115
|
+
if (isEnterKey2(key3)) {
|
252430
255116
|
const answer = value4;
|
252431
255117
|
setStatus("loading");
|
252432
255118
|
const isValid2 = await validate3(answer);
|
@@ -252451,7 +255137,7 @@ var esm_default5 = createPrompt((config3, done) => {
|
|
252451
255137
|
const maskChar = typeof config3.mask === "string" ? config3.mask : "*";
|
252452
255138
|
formattedValue = maskChar.repeat(value4.length);
|
252453
255139
|
} else if (status !== "done") {
|
252454
|
-
helpTip = `${theme.style.help("[input is masked]")}${
|
255140
|
+
helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes4.default.cursorHide}`;
|
252455
255141
|
}
|
252456
255142
|
if (status === "done") {
|
252457
255143
|
formattedValue = theme.style.answer(formattedValue);
|
@@ -253675,7 +256361,7 @@ var basename2 = function(p6, extension) {
|
|
253675
256361
|
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
253676
256362
|
};
|
253677
256363
|
// ../../node_modules/defu/dist/defu.mjs
|
253678
|
-
function
|
256364
|
+
function isPlainObject4(value4) {
|
253679
256365
|
if (value4 === null || typeof value4 !== "object") {
|
253680
256366
|
return false;
|
253681
256367
|
}
|
@@ -253692,27 +256378,27 @@ function isPlainObject3(value4) {
|
|
253692
256378
|
return true;
|
253693
256379
|
}
|
253694
256380
|
function _defu(baseObject, defaults2, namespace = ".", merger) {
|
253695
|
-
if (!
|
256381
|
+
if (!isPlainObject4(defaults2)) {
|
253696
256382
|
return _defu(baseObject, {}, namespace, merger);
|
253697
256383
|
}
|
253698
256384
|
const object = Object.assign({}, defaults2);
|
253699
|
-
for (const
|
253700
|
-
if (
|
256385
|
+
for (const key3 in baseObject) {
|
256386
|
+
if (key3 === "__proto__" || key3 === "constructor") {
|
253701
256387
|
continue;
|
253702
256388
|
}
|
253703
|
-
const value4 = baseObject[
|
256389
|
+
const value4 = baseObject[key3];
|
253704
256390
|
if (value4 === null || value4 === undefined) {
|
253705
256391
|
continue;
|
253706
256392
|
}
|
253707
|
-
if (merger && merger(object,
|
256393
|
+
if (merger && merger(object, key3, value4, namespace)) {
|
253708
256394
|
continue;
|
253709
256395
|
}
|
253710
|
-
if (Array.isArray(value4) && Array.isArray(object[
|
253711
|
-
object[
|
253712
|
-
} else if (
|
253713
|
-
object[
|
256396
|
+
if (Array.isArray(value4) && Array.isArray(object[key3])) {
|
256397
|
+
object[key3] = [...value4, ...object[key3]];
|
256398
|
+
} else if (isPlainObject4(value4) && isPlainObject4(object[key3])) {
|
256399
|
+
object[key3] = _defu(value4, object[key3], (namespace ? `${namespace}.` : "") + key3.toString(), merger);
|
253714
256400
|
} else {
|
253715
|
-
object[
|
256401
|
+
object[key3] = value4;
|
253716
256402
|
}
|
253717
256403
|
}
|
253718
256404
|
return object;
|
@@ -253721,15 +256407,15 @@ function createDefu(merger) {
|
|
253721
256407
|
return (...arguments_4) => arguments_4.reduce((p6, c3) => _defu(p6, c3, "", merger), {});
|
253722
256408
|
}
|
253723
256409
|
var defu = createDefu();
|
253724
|
-
var defuFn = createDefu((object,
|
253725
|
-
if (object[
|
253726
|
-
object[
|
256410
|
+
var defuFn = createDefu((object, key3, currentValue) => {
|
256411
|
+
if (object[key3] !== undefined && typeof currentValue === "function") {
|
256412
|
+
object[key3] = currentValue(object[key3]);
|
253727
256413
|
return true;
|
253728
256414
|
}
|
253729
256415
|
});
|
253730
|
-
var defuArrayFn = createDefu((object,
|
253731
|
-
if (Array.isArray(object[
|
253732
|
-
object[
|
256416
|
+
var defuArrayFn = createDefu((object, key3, currentValue) => {
|
256417
|
+
if (Array.isArray(object[key3]) && typeof currentValue === "function") {
|
256418
|
+
object[key3] = currentValue(object[key3]);
|
253733
256419
|
return true;
|
253734
256420
|
}
|
253735
256421
|
});
|
@@ -256426,11 +259112,11 @@ function cacheDirectory() {
|
|
256426
259112
|
}
|
256427
259113
|
function normalizeHeaders(headers = {}) {
|
256428
259114
|
const normalized = {};
|
256429
|
-
for (const [
|
259115
|
+
for (const [key3, value4] of Object.entries(headers)) {
|
256430
259116
|
if (!value4) {
|
256431
259117
|
continue;
|
256432
259118
|
}
|
256433
|
-
normalized[
|
259119
|
+
normalized[key3.toLowerCase()] = value4;
|
256434
259120
|
}
|
256435
259121
|
return normalized;
|
256436
259122
|
}
|
@@ -258298,9 +260984,9 @@ function smartContractPortalMiddlewareCreateCommand() {
|
|
258298
260984
|
}
|
258299
260985
|
if (includePredeployedAbis && includePredeployedAbis.length > 0) {
|
258300
260986
|
const platformConfig = await settlemint.platform.config();
|
258301
|
-
const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.
|
260987
|
+
const invalidPredeployedAbis = includePredeployedAbis.filter((abi) => !platformConfig.preDeployedContracts.some((contract) => contract === abi));
|
258302
260988
|
if (invalidPredeployedAbis.length > 0) {
|
258303
|
-
cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.
|
260989
|
+
cancel2(`Invalid pre-deployed abis: '${invalidPredeployedAbis.join(", ")}'. Possible values: '${platformConfig.preDeployedContracts.sort().join(", ")}'`);
|
258304
260990
|
}
|
258305
260991
|
}
|
258306
260992
|
const result = await showSpinner(() => settlemint.middleware.create({
|
@@ -259064,7 +261750,7 @@ function jsonOutput(data) {
|
|
259064
261750
|
var composer = require_composer();
|
259065
261751
|
var Document = require_Document();
|
259066
261752
|
var Schema = require_Schema();
|
259067
|
-
var
|
261753
|
+
var errors3 = require_errors3();
|
259068
261754
|
var Alias = require_Alias();
|
259069
261755
|
var identity2 = require_identity();
|
259070
261756
|
var Pair = require_Pair();
|
@@ -259080,9 +261766,9 @@ var visit2 = require_visit();
|
|
259080
261766
|
var $Composer = composer.Composer;
|
259081
261767
|
var $Document = Document.Document;
|
259082
261768
|
var $Schema = Schema.Schema;
|
259083
|
-
var $YAMLError =
|
259084
|
-
var $YAMLParseError =
|
259085
|
-
var $YAMLWarning =
|
261769
|
+
var $YAMLError = errors3.YAMLError;
|
261770
|
+
var $YAMLParseError = errors3.YAMLParseError;
|
261771
|
+
var $YAMLWarning = errors3.YAMLWarning;
|
259086
261772
|
var $Alias = Alias.Alias;
|
259087
261773
|
var $isAlias = identity2.isAlias;
|
259088
261774
|
var $isCollection = identity2.isCollection;
|
@@ -259155,7 +261841,7 @@ function configCommand() {
|
|
259155
261841
|
providerName: provider.name,
|
259156
261842
|
regionName: region.name
|
259157
261843
|
}))).sort((a8, b4) => a8.providerId.localeCompare(b4.providerId) || a8.regionId.localeCompare(b4.regionId)),
|
259158
|
-
|
261844
|
+
preDeployedContracts: platformConfig.preDeployedContracts.sort()
|
259159
261845
|
};
|
259160
261846
|
if (output === "json") {
|
259161
261847
|
jsonOutput(platformConfigData);
|
@@ -259165,7 +261851,7 @@ function configCommand() {
|
|
259165
261851
|
table("Templates (Kits)", platformConfigData.kits);
|
259166
261852
|
table("Use cases (Smart Contract Sets)", platformConfigData.useCases);
|
259167
261853
|
table("Providers and regions", platformConfigData.deploymentEngineTargets);
|
259168
|
-
list("Pre-deployed abis (Smart Contract Portal)", platformConfigData.
|
261854
|
+
list("Pre-deployed abis (Smart Contract Portal)", platformConfigData.preDeployedContracts);
|
259169
261855
|
}
|
259170
261856
|
outro("Platform configuration retrieved");
|
259171
261857
|
});
|
@@ -259432,7 +262118,7 @@ async function getServicesAndMapResults({
|
|
259432
262118
|
const application = await settlemint.application.read(applicationUniqueName);
|
259433
262119
|
const services = await servicesSpinner(settlemint, applicationUniqueName, types2);
|
259434
262120
|
const results = (types2 ?? SERVICE_TYPES).filter((serviceType) => !types2 || types2.includes(serviceType)).map((serviceType) => {
|
259435
|
-
const [_6, labels] = Object.entries(LABELS_MAP).find(([
|
262121
|
+
const [_6, labels] = Object.entries(LABELS_MAP).find(([key3, value4]) => value4.command === serviceType) ?? [
|
259436
262122
|
null,
|
259437
262123
|
{ plural: serviceType }
|
259438
262124
|
];
|
@@ -259667,11 +262353,11 @@ function createCommand4() {
|
|
259667
262353
|
|
259668
262354
|
// src/utils/commands/passthrough-options.ts
|
259669
262355
|
function mapPassthroughOptions(options, command) {
|
259670
|
-
const optionArgs = Object.entries(options).map(([
|
262356
|
+
const optionArgs = Object.entries(options).map(([key3, value4]) => {
|
259671
262357
|
if (value4 === true) {
|
259672
|
-
return `--${
|
262358
|
+
return `--${key3}`;
|
259673
262359
|
}
|
259674
|
-
return `--${
|
262360
|
+
return `--${key3}=${value4}`;
|
259675
262361
|
});
|
259676
262362
|
return [...optionArgs, ...command.args];
|
259677
262363
|
}
|
@@ -260710,4 +263396,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
260710
263396
|
// src/cli.ts
|
260711
263397
|
sdkCliCommand();
|
260712
263398
|
|
260713
|
-
//# debugId=
|
263399
|
+
//# debugId=1AA3ACD61A1C91EC64756E2164756E21
|