semantic-release-lerna 3.0.1 → 3.1.0
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/index.js +1254 -164
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2508,9 +2508,9 @@ var require_semver2 = __commonJS({
|
|
|
2508
2508
|
}
|
|
2509
2509
|
});
|
|
2510
2510
|
|
|
2511
|
-
// node_modules/
|
|
2511
|
+
// node_modules/npm-package-arg/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
2512
2512
|
var require_index_min = __commonJS({
|
|
2513
|
-
"node_modules/
|
|
2513
|
+
"node_modules/npm-package-arg/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
2514
2514
|
"use strict";
|
|
2515
2515
|
var M = (c3, t) => () => (t || c3((t = { exports: {} }).exports, t), t.exports);
|
|
2516
2516
|
var U = M((O) => {
|
|
@@ -3108,9 +3108,9 @@ var require_index_min = __commonJS({
|
|
|
3108
3108
|
}
|
|
3109
3109
|
});
|
|
3110
3110
|
|
|
3111
|
-
// node_modules/hosted-git-info/lib/hosts.js
|
|
3111
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/hosts.js
|
|
3112
3112
|
var require_hosts = __commonJS({
|
|
3113
|
-
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3113
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
3114
3114
|
"use strict";
|
|
3115
3115
|
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
3116
3116
|
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
@@ -3274,17 +3274,16 @@ var require_hosts = __commonJS({
|
|
|
3274
3274
|
}
|
|
3275
3275
|
});
|
|
3276
3276
|
|
|
3277
|
-
// node_modules/hosted-git-info/lib/parse-url.js
|
|
3277
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/parse-url.js
|
|
3278
3278
|
var require_parse_url = __commonJS({
|
|
3279
|
-
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
3280
|
-
var url = __require("url");
|
|
3279
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
3281
3280
|
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
3282
3281
|
const startPosition = str2.indexOf(beforeChar);
|
|
3283
3282
|
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
3284
3283
|
};
|
|
3285
3284
|
var safeUrl = (u2) => {
|
|
3286
3285
|
try {
|
|
3287
|
-
return new
|
|
3286
|
+
return new URL(u2);
|
|
3288
3287
|
} catch {
|
|
3289
3288
|
}
|
|
3290
3289
|
};
|
|
@@ -3325,9 +3324,9 @@ var require_parse_url = __commonJS({
|
|
|
3325
3324
|
}
|
|
3326
3325
|
});
|
|
3327
3326
|
|
|
3328
|
-
// node_modules/hosted-git-info/lib/from-url.js
|
|
3327
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/from-url.js
|
|
3329
3328
|
var require_from_url = __commonJS({
|
|
3330
|
-
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
3329
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
3331
3330
|
"use strict";
|
|
3332
3331
|
var parseUrl = require_parse_url();
|
|
3333
3332
|
var isGitHubShorthand = (arg) => {
|
|
@@ -3419,9 +3418,9 @@ var require_from_url = __commonJS({
|
|
|
3419
3418
|
}
|
|
3420
3419
|
});
|
|
3421
3420
|
|
|
3422
|
-
// node_modules/hosted-git-info/lib/index.js
|
|
3421
|
+
// node_modules/npm-package-arg/node_modules/hosted-git-info/lib/index.js
|
|
3423
3422
|
var require_lib = __commonJS({
|
|
3424
|
-
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
3423
|
+
"node_modules/npm-package-arg/node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
3425
3424
|
"use strict";
|
|
3426
3425
|
var { LRUCache } = require_index_min();
|
|
3427
3426
|
var hosts = require_hosts();
|
|
@@ -13852,175 +13851,1263 @@ var require_spdx_correct = __commonJS({
|
|
|
13852
13851
|
return transformed;
|
|
13853
13852
|
}
|
|
13854
13853
|
}
|
|
13855
|
-
return null;
|
|
13856
|
-
};
|
|
13857
|
-
var validLastResort = function(identifier) {
|
|
13858
|
-
var upperCased = identifier.toUpperCase();
|
|
13859
|
-
for (var i2 = 0; i2 < lastResorts.length; i2++) {
|
|
13860
|
-
var lastResort = lastResorts[i2];
|
|
13861
|
-
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
13862
|
-
return lastResort[IDENTIFIER];
|
|
13854
|
+
return null;
|
|
13855
|
+
};
|
|
13856
|
+
var validLastResort = function(identifier) {
|
|
13857
|
+
var upperCased = identifier.toUpperCase();
|
|
13858
|
+
for (var i2 = 0; i2 < lastResorts.length; i2++) {
|
|
13859
|
+
var lastResort = lastResorts[i2];
|
|
13860
|
+
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
13861
|
+
return lastResort[IDENTIFIER];
|
|
13862
|
+
}
|
|
13863
|
+
}
|
|
13864
|
+
return null;
|
|
13865
|
+
};
|
|
13866
|
+
var anyCorrection = function(identifier, check) {
|
|
13867
|
+
for (var i2 = 0; i2 < transpositions.length; i2++) {
|
|
13868
|
+
var transposition = transpositions[i2];
|
|
13869
|
+
var transposed = transposition[TRANSPOSED];
|
|
13870
|
+
if (identifier.indexOf(transposed) > -1) {
|
|
13871
|
+
var corrected = identifier.replace(
|
|
13872
|
+
transposed,
|
|
13873
|
+
transposition[CORRECT]
|
|
13874
|
+
);
|
|
13875
|
+
var checked = check(corrected);
|
|
13876
|
+
if (checked !== null) {
|
|
13877
|
+
return checked;
|
|
13878
|
+
}
|
|
13879
|
+
}
|
|
13880
|
+
}
|
|
13881
|
+
return null;
|
|
13882
|
+
};
|
|
13883
|
+
module.exports = function(identifier, options) {
|
|
13884
|
+
options = options || {};
|
|
13885
|
+
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
13886
|
+
function postprocess(value) {
|
|
13887
|
+
return upgrade ? upgradeGPLs(value) : value;
|
|
13888
|
+
}
|
|
13889
|
+
var validArugment = typeof identifier === "string" && identifier.trim().length !== 0;
|
|
13890
|
+
if (!validArugment) {
|
|
13891
|
+
throw Error("Invalid argument. Expected non-empty string.");
|
|
13892
|
+
}
|
|
13893
|
+
identifier = identifier.trim();
|
|
13894
|
+
if (valid(identifier)) {
|
|
13895
|
+
return postprocess(identifier);
|
|
13896
|
+
}
|
|
13897
|
+
var noPlus = identifier.replace(/\+$/, "").trim();
|
|
13898
|
+
if (valid(noPlus)) {
|
|
13899
|
+
return postprocess(noPlus);
|
|
13900
|
+
}
|
|
13901
|
+
var transformed = validTransformation(identifier);
|
|
13902
|
+
if (transformed !== null) {
|
|
13903
|
+
return postprocess(transformed);
|
|
13904
|
+
}
|
|
13905
|
+
transformed = anyCorrection(identifier, function(argument) {
|
|
13906
|
+
if (valid(argument)) {
|
|
13907
|
+
return argument;
|
|
13908
|
+
}
|
|
13909
|
+
return validTransformation(argument);
|
|
13910
|
+
});
|
|
13911
|
+
if (transformed !== null) {
|
|
13912
|
+
return postprocess(transformed);
|
|
13913
|
+
}
|
|
13914
|
+
transformed = validLastResort(identifier);
|
|
13915
|
+
if (transformed !== null) {
|
|
13916
|
+
return postprocess(transformed);
|
|
13917
|
+
}
|
|
13918
|
+
transformed = anyCorrection(identifier, validLastResort);
|
|
13919
|
+
if (transformed !== null) {
|
|
13920
|
+
return postprocess(transformed);
|
|
13921
|
+
}
|
|
13922
|
+
return null;
|
|
13923
|
+
};
|
|
13924
|
+
function upgradeGPLs(value) {
|
|
13925
|
+
if ([
|
|
13926
|
+
"GPL-1.0",
|
|
13927
|
+
"LGPL-1.0",
|
|
13928
|
+
"AGPL-1.0",
|
|
13929
|
+
"GPL-2.0",
|
|
13930
|
+
"LGPL-2.0",
|
|
13931
|
+
"AGPL-2.0",
|
|
13932
|
+
"LGPL-2.1"
|
|
13933
|
+
].indexOf(value) !== -1) {
|
|
13934
|
+
return value + "-only";
|
|
13935
|
+
} else if ([
|
|
13936
|
+
"GPL-1.0+",
|
|
13937
|
+
"GPL-2.0+",
|
|
13938
|
+
"GPL-3.0+",
|
|
13939
|
+
"LGPL-2.0+",
|
|
13940
|
+
"LGPL-2.1+",
|
|
13941
|
+
"LGPL-3.0+",
|
|
13942
|
+
"AGPL-1.0+",
|
|
13943
|
+
"AGPL-3.0+"
|
|
13944
|
+
].indexOf(value) !== -1) {
|
|
13945
|
+
return value.replace(/\+$/, "-or-later");
|
|
13946
|
+
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
13947
|
+
return value + "-or-later";
|
|
13948
|
+
} else {
|
|
13949
|
+
return value;
|
|
13950
|
+
}
|
|
13951
|
+
}
|
|
13952
|
+
}
|
|
13953
|
+
});
|
|
13954
|
+
|
|
13955
|
+
// node_modules/validate-npm-package-license/index.js
|
|
13956
|
+
var require_validate_npm_package_license = __commonJS({
|
|
13957
|
+
"node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
13958
|
+
var parse2 = require_spdx_expression_parse();
|
|
13959
|
+
var correct = require_spdx_correct();
|
|
13960
|
+
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
13961
|
+
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
13962
|
+
function startsWith(prefix, string) {
|
|
13963
|
+
return string.slice(0, prefix.length) === prefix;
|
|
13964
|
+
}
|
|
13965
|
+
function usesLicenseRef(ast) {
|
|
13966
|
+
if (ast.hasOwnProperty("license")) {
|
|
13967
|
+
var license = ast.license;
|
|
13968
|
+
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
13969
|
+
} else {
|
|
13970
|
+
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
13971
|
+
}
|
|
13972
|
+
}
|
|
13973
|
+
module.exports = function(argument) {
|
|
13974
|
+
var ast;
|
|
13975
|
+
try {
|
|
13976
|
+
ast = parse2(argument);
|
|
13977
|
+
} catch (e) {
|
|
13978
|
+
var match2;
|
|
13979
|
+
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
13980
|
+
return {
|
|
13981
|
+
validForOldPackages: true,
|
|
13982
|
+
validForNewPackages: true,
|
|
13983
|
+
unlicensed: true
|
|
13984
|
+
};
|
|
13985
|
+
} else if (match2 = fileReferenceRE.exec(argument)) {
|
|
13986
|
+
return {
|
|
13987
|
+
validForOldPackages: true,
|
|
13988
|
+
validForNewPackages: true,
|
|
13989
|
+
inFile: match2[1]
|
|
13990
|
+
};
|
|
13991
|
+
} else {
|
|
13992
|
+
var result = {
|
|
13993
|
+
validForOldPackages: false,
|
|
13994
|
+
validForNewPackages: false,
|
|
13995
|
+
warnings: [genericWarning]
|
|
13996
|
+
};
|
|
13997
|
+
if (argument.trim().length !== 0) {
|
|
13998
|
+
var corrected = correct(argument);
|
|
13999
|
+
if (corrected) {
|
|
14000
|
+
result.warnings.push(
|
|
14001
|
+
'license is similar to the valid expression "' + corrected + '"'
|
|
14002
|
+
);
|
|
14003
|
+
}
|
|
14004
|
+
}
|
|
14005
|
+
return result;
|
|
14006
|
+
}
|
|
14007
|
+
}
|
|
14008
|
+
if (usesLicenseRef(ast)) {
|
|
14009
|
+
return {
|
|
14010
|
+
validForNewPackages: false,
|
|
14011
|
+
validForOldPackages: false,
|
|
14012
|
+
spdx: true,
|
|
14013
|
+
warnings: [genericWarning]
|
|
14014
|
+
};
|
|
14015
|
+
} else {
|
|
14016
|
+
return {
|
|
14017
|
+
validForNewPackages: true,
|
|
14018
|
+
validForOldPackages: true,
|
|
14019
|
+
spdx: true
|
|
14020
|
+
};
|
|
14021
|
+
}
|
|
14022
|
+
};
|
|
14023
|
+
}
|
|
14024
|
+
});
|
|
14025
|
+
|
|
14026
|
+
// node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/node/index.min.js
|
|
14027
|
+
var require_index_min2 = __commonJS({
|
|
14028
|
+
"node_modules/hosted-git-info/node_modules/lru-cache/dist/commonjs/node/index.min.js"(exports) {
|
|
14029
|
+
"use strict";
|
|
14030
|
+
var M = (c3, t) => () => (t || c3((t = { exports: {} }).exports, t), t.exports);
|
|
14031
|
+
var U = M((O) => {
|
|
14032
|
+
"use strict";
|
|
14033
|
+
Object.defineProperty(O, "__esModule", { value: true });
|
|
14034
|
+
O.tracing = O.metrics = void 0;
|
|
14035
|
+
var j = __require("node:diagnostics_channel");
|
|
14036
|
+
O.metrics = (0, j.channel)("lru-cache:metrics");
|
|
14037
|
+
O.tracing = (0, j.tracingChannel)("lru-cache");
|
|
14038
|
+
});
|
|
14039
|
+
var I = M((R) => {
|
|
14040
|
+
"use strict";
|
|
14041
|
+
Object.defineProperty(R, "__esModule", { value: true });
|
|
14042
|
+
R.defaultPerf = void 0;
|
|
14043
|
+
R.defaultPerf = typeof performance == "object" && performance && typeof performance.now == "function" ? performance : Date;
|
|
14044
|
+
});
|
|
14045
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14046
|
+
exports.LRUCache = void 0;
|
|
14047
|
+
var u2 = U();
|
|
14048
|
+
var N = I();
|
|
14049
|
+
var C = () => u2.metrics.hasSubscribers || u2.tracing.hasSubscribers;
|
|
14050
|
+
var G = /* @__PURE__ */ new Set();
|
|
14051
|
+
var P = typeof process == "object" && process ? process : {};
|
|
14052
|
+
var k = (c3, t, e, i2) => {
|
|
14053
|
+
typeof P.emitWarning == "function" ? P.emitWarning(c3, t, e, i2) : console.error(`[${e}] ${t}: ${c3}`);
|
|
14054
|
+
};
|
|
14055
|
+
var q = (c3) => !G.has(c3);
|
|
14056
|
+
var F = (c3) => !!c3 && c3 === Math.floor(c3) && c3 > 0 && isFinite(c3);
|
|
14057
|
+
var H = (c3) => F(c3) ? c3 <= Math.pow(2, 8) ? Uint8Array : c3 <= Math.pow(2, 16) ? Uint16Array : c3 <= Math.pow(2, 32) ? Uint32Array : c3 <= Number.MAX_SAFE_INTEGER ? W : null : null;
|
|
14058
|
+
var W = class extends Array {
|
|
14059
|
+
constructor(t) {
|
|
14060
|
+
super(t), this.fill(0);
|
|
14061
|
+
}
|
|
14062
|
+
};
|
|
14063
|
+
var x = class c3 {
|
|
14064
|
+
heap;
|
|
14065
|
+
length;
|
|
14066
|
+
static #o = false;
|
|
14067
|
+
static create(t) {
|
|
14068
|
+
let e = H(t);
|
|
14069
|
+
if (!e) return [];
|
|
14070
|
+
c3.#o = true;
|
|
14071
|
+
let i2 = new c3(t, e);
|
|
14072
|
+
return c3.#o = false, i2;
|
|
14073
|
+
}
|
|
14074
|
+
constructor(t, e) {
|
|
14075
|
+
if (!c3.#o) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
14076
|
+
this.heap = new e(t), this.length = 0;
|
|
14077
|
+
}
|
|
14078
|
+
push(t) {
|
|
14079
|
+
this.heap[this.length++] = t;
|
|
14080
|
+
}
|
|
14081
|
+
pop() {
|
|
14082
|
+
return this.heap[--this.length];
|
|
14083
|
+
}
|
|
14084
|
+
};
|
|
14085
|
+
var L = class c3 {
|
|
14086
|
+
#o;
|
|
14087
|
+
#c;
|
|
14088
|
+
#m;
|
|
14089
|
+
#D;
|
|
14090
|
+
#w;
|
|
14091
|
+
#M;
|
|
14092
|
+
#j;
|
|
14093
|
+
#S;
|
|
14094
|
+
get perf() {
|
|
14095
|
+
return this.#S;
|
|
14096
|
+
}
|
|
14097
|
+
ttl;
|
|
14098
|
+
ttlResolution;
|
|
14099
|
+
ttlAutopurge;
|
|
14100
|
+
updateAgeOnGet;
|
|
14101
|
+
updateAgeOnHas;
|
|
14102
|
+
allowStale;
|
|
14103
|
+
noDisposeOnSet;
|
|
14104
|
+
noUpdateTTL;
|
|
14105
|
+
maxEntrySize;
|
|
14106
|
+
sizeCalculation;
|
|
14107
|
+
noDeleteOnFetchRejection;
|
|
14108
|
+
noDeleteOnStaleGet;
|
|
14109
|
+
allowStaleOnFetchAbort;
|
|
14110
|
+
allowStaleOnFetchRejection;
|
|
14111
|
+
ignoreFetchAbort;
|
|
14112
|
+
#n;
|
|
14113
|
+
#b;
|
|
14114
|
+
#s;
|
|
14115
|
+
#i;
|
|
14116
|
+
#t;
|
|
14117
|
+
#l;
|
|
14118
|
+
#u;
|
|
14119
|
+
#a;
|
|
14120
|
+
#h;
|
|
14121
|
+
#_;
|
|
14122
|
+
#r;
|
|
14123
|
+
#y;
|
|
14124
|
+
#F;
|
|
14125
|
+
#d;
|
|
14126
|
+
#g;
|
|
14127
|
+
#T;
|
|
14128
|
+
#O;
|
|
14129
|
+
#f;
|
|
14130
|
+
#U;
|
|
14131
|
+
static unsafeExposeInternals(t) {
|
|
14132
|
+
return { starts: t.#F, ttls: t.#d, autopurgeTimers: t.#g, sizes: t.#y, keyMap: t.#s, keyList: t.#i, valList: t.#t, next: t.#l, prev: t.#u, get head() {
|
|
14133
|
+
return t.#a;
|
|
14134
|
+
}, get tail() {
|
|
14135
|
+
return t.#h;
|
|
14136
|
+
}, free: t.#_, isBackgroundFetch: (e) => t.#e(e), backgroundFetch: (e, i2, s, n2) => t.#G(e, i2, s, n2), moveToTail: (e) => t.#L(e), indexes: (e) => t.#A(e), rindexes: (e) => t.#v(e), isStale: (e) => t.#p(e) };
|
|
14137
|
+
}
|
|
14138
|
+
get max() {
|
|
14139
|
+
return this.#o;
|
|
14140
|
+
}
|
|
14141
|
+
get maxSize() {
|
|
14142
|
+
return this.#c;
|
|
14143
|
+
}
|
|
14144
|
+
get calculatedSize() {
|
|
14145
|
+
return this.#b;
|
|
14146
|
+
}
|
|
14147
|
+
get size() {
|
|
14148
|
+
return this.#n;
|
|
14149
|
+
}
|
|
14150
|
+
get fetchMethod() {
|
|
14151
|
+
return this.#M;
|
|
14152
|
+
}
|
|
14153
|
+
get memoMethod() {
|
|
14154
|
+
return this.#j;
|
|
14155
|
+
}
|
|
14156
|
+
get dispose() {
|
|
14157
|
+
return this.#m;
|
|
14158
|
+
}
|
|
14159
|
+
get onInsert() {
|
|
14160
|
+
return this.#D;
|
|
14161
|
+
}
|
|
14162
|
+
get disposeAfter() {
|
|
14163
|
+
return this.#w;
|
|
14164
|
+
}
|
|
14165
|
+
constructor(t) {
|
|
14166
|
+
let { max: e = 0, ttl: i2, ttlResolution: s = 1, ttlAutopurge: n2, updateAgeOnGet: o2, updateAgeOnHas: r, allowStale: h2, dispose: a2, onInsert: d, disposeAfter: f, noDisposeOnSet: p, noUpdateTTL: m, maxSize: T = 0, maxEntrySize: w = 0, sizeCalculation: _, fetchMethod: l, memoMethod: S, noDeleteOnFetchRejection: y, noDeleteOnStaleGet: b, allowStaleOnFetchRejection: g, allowStaleOnFetchAbort: A, ignoreFetchAbort: v, perf: D } = t;
|
|
14167
|
+
if (D !== void 0 && typeof D?.now != "function") throw new TypeError("perf option must have a now() method if specified");
|
|
14168
|
+
if (this.#S = D ?? N.defaultPerf, e !== 0 && !F(e)) throw new TypeError("max option must be a nonnegative integer");
|
|
14169
|
+
let z = e ? H(e) : Array;
|
|
14170
|
+
if (!z) throw new Error("invalid max value: " + e);
|
|
14171
|
+
if (this.#o = e, this.#c = T, this.maxEntrySize = w || this.#c, this.sizeCalculation = _, this.sizeCalculation) {
|
|
14172
|
+
if (!this.#c && !this.maxEntrySize) throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
14173
|
+
if (typeof this.sizeCalculation != "function") throw new TypeError("sizeCalculation set to non-function");
|
|
14174
|
+
}
|
|
14175
|
+
if (S !== void 0 && typeof S != "function") throw new TypeError("memoMethod must be a function if defined");
|
|
14176
|
+
if (this.#j = S, l !== void 0 && typeof l != "function") throw new TypeError("fetchMethod must be a function if specified");
|
|
14177
|
+
if (this.#M = l, this.#O = !!l, this.#s = /* @__PURE__ */ new Map(), this.#i = Array.from({ length: e }).fill(void 0), this.#t = Array.from({ length: e }).fill(void 0), this.#l = new z(e), this.#u = new z(e), this.#a = 0, this.#h = 0, this.#_ = x.create(e), this.#n = 0, this.#b = 0, typeof a2 == "function" && (this.#m = a2), typeof d == "function" && (this.#D = d), typeof f == "function" ? (this.#w = f, this.#r = []) : (this.#w = void 0, this.#r = void 0), this.#T = !!this.#m, this.#U = !!this.#D, this.#f = !!this.#w, this.noDisposeOnSet = !!p, this.noUpdateTTL = !!m, this.noDeleteOnFetchRejection = !!y, this.allowStaleOnFetchRejection = !!g, this.allowStaleOnFetchAbort = !!A, this.ignoreFetchAbort = !!v, this.maxEntrySize !== 0) {
|
|
14178
|
+
if (this.#c !== 0 && !F(this.#c)) throw new TypeError("maxSize must be a positive integer if specified");
|
|
14179
|
+
if (!F(this.maxEntrySize)) throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
14180
|
+
this.#X();
|
|
14181
|
+
}
|
|
14182
|
+
if (this.allowStale = !!h2, this.noDeleteOnStaleGet = !!b, this.updateAgeOnGet = !!o2, this.updateAgeOnHas = !!r, this.ttlResolution = F(s) || s === 0 ? s : 1, this.ttlAutopurge = !!n2, this.ttl = i2 || 0, this.ttl) {
|
|
14183
|
+
if (!F(this.ttl)) throw new TypeError("ttl must be a positive integer if specified");
|
|
14184
|
+
this.#H();
|
|
14185
|
+
}
|
|
14186
|
+
if (this.#o === 0 && this.ttl === 0 && this.#c === 0) throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
14187
|
+
if (!this.ttlAutopurge && !this.#o && !this.#c) {
|
|
14188
|
+
let E = "LRU_CACHE_UNBOUNDED";
|
|
14189
|
+
q(E) && (G.add(E), k("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", E, c3));
|
|
14190
|
+
}
|
|
14191
|
+
}
|
|
14192
|
+
getRemainingTTL(t) {
|
|
14193
|
+
return this.#s.has(t) ? 1 / 0 : 0;
|
|
14194
|
+
}
|
|
14195
|
+
#H() {
|
|
14196
|
+
let t = new W(this.#o), e = new W(this.#o);
|
|
14197
|
+
this.#d = t, this.#F = e;
|
|
14198
|
+
let i2 = this.ttlAutopurge ? Array.from({ length: this.#o }) : void 0;
|
|
14199
|
+
this.#g = i2, this.#N = (r, h2, a2 = this.#S.now()) => {
|
|
14200
|
+
e[r] = h2 !== 0 ? a2 : 0, t[r] = h2, s(r, h2);
|
|
14201
|
+
}, this.#R = (r) => {
|
|
14202
|
+
e[r] = t[r] !== 0 ? this.#S.now() : 0, s(r, t[r]);
|
|
14203
|
+
};
|
|
14204
|
+
let s = this.ttlAutopurge ? (r, h2) => {
|
|
14205
|
+
if (i2?.[r] && (clearTimeout(i2[r]), i2[r] = void 0), h2 && h2 !== 0 && i2) {
|
|
14206
|
+
let a2 = setTimeout(() => {
|
|
14207
|
+
this.#p(r) && this.#z(this.#i[r], "expire");
|
|
14208
|
+
}, h2 + 1);
|
|
14209
|
+
a2.unref && a2.unref(), i2[r] = a2;
|
|
14210
|
+
}
|
|
14211
|
+
} : () => {
|
|
14212
|
+
};
|
|
14213
|
+
this.#E = (r, h2) => {
|
|
14214
|
+
if (t[h2]) {
|
|
14215
|
+
let a2 = t[h2], d = e[h2];
|
|
14216
|
+
if (!a2 || !d) return;
|
|
14217
|
+
r.ttl = a2, r.start = d, r.now = n2 || o2();
|
|
14218
|
+
let f = r.now - d;
|
|
14219
|
+
r.remainingTTL = a2 - f;
|
|
14220
|
+
}
|
|
14221
|
+
};
|
|
14222
|
+
let n2 = 0, o2 = () => {
|
|
14223
|
+
let r = this.#S.now();
|
|
14224
|
+
if (this.ttlResolution > 0) {
|
|
14225
|
+
n2 = r;
|
|
14226
|
+
let h2 = setTimeout(() => n2 = 0, this.ttlResolution);
|
|
14227
|
+
h2.unref && h2.unref();
|
|
14228
|
+
}
|
|
14229
|
+
return r;
|
|
14230
|
+
};
|
|
14231
|
+
this.getRemainingTTL = (r) => {
|
|
14232
|
+
let h2 = this.#s.get(r);
|
|
14233
|
+
if (h2 === void 0) return 0;
|
|
14234
|
+
let a2 = t[h2], d = e[h2];
|
|
14235
|
+
if (!a2 || !d) return 1 / 0;
|
|
14236
|
+
let f = (n2 || o2()) - d;
|
|
14237
|
+
return a2 - f;
|
|
14238
|
+
}, this.#p = (r) => {
|
|
14239
|
+
let h2 = e[r], a2 = t[r];
|
|
14240
|
+
return !!a2 && !!h2 && (n2 || o2()) - h2 > a2;
|
|
14241
|
+
};
|
|
14242
|
+
}
|
|
14243
|
+
#R = () => {
|
|
14244
|
+
};
|
|
14245
|
+
#E = () => {
|
|
14246
|
+
};
|
|
14247
|
+
#N = () => {
|
|
14248
|
+
};
|
|
14249
|
+
#p = () => false;
|
|
14250
|
+
#X() {
|
|
14251
|
+
let t = new W(this.#o);
|
|
14252
|
+
this.#b = 0, this.#y = t, this.#C = (e) => {
|
|
14253
|
+
this.#b -= t[e], t[e] = 0;
|
|
14254
|
+
}, this.#k = (e, i2, s, n2) => {
|
|
14255
|
+
if (this.#e(i2)) return 0;
|
|
14256
|
+
if (!F(s)) if (n2) {
|
|
14257
|
+
if (typeof n2 != "function") throw new TypeError("sizeCalculation must be a function");
|
|
14258
|
+
if (s = n2(i2, e), !F(s)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
14259
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
14260
|
+
return s;
|
|
14261
|
+
}, this.#I = (e, i2, s) => {
|
|
14262
|
+
if (t[e] = i2, this.#c) {
|
|
14263
|
+
let n2 = this.#c - t[e];
|
|
14264
|
+
for (; this.#b > n2; ) this.#P(true);
|
|
14265
|
+
}
|
|
14266
|
+
this.#b += t[e], s && (s.entrySize = i2, s.totalCalculatedSize = this.#b);
|
|
14267
|
+
};
|
|
14268
|
+
}
|
|
14269
|
+
#C = (t) => {
|
|
14270
|
+
};
|
|
14271
|
+
#I = (t, e, i2) => {
|
|
14272
|
+
};
|
|
14273
|
+
#k = (t, e, i2, s) => {
|
|
14274
|
+
if (i2 || s) throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
14275
|
+
return 0;
|
|
14276
|
+
};
|
|
14277
|
+
*#A({ allowStale: t = this.allowStale } = {}) {
|
|
14278
|
+
if (this.#n) for (let e = this.#h; this.#q(e) && ((t || !this.#p(e)) && (yield e), e !== this.#a); ) e = this.#u[e];
|
|
14279
|
+
}
|
|
14280
|
+
*#v({ allowStale: t = this.allowStale } = {}) {
|
|
14281
|
+
if (this.#n) for (let e = this.#a; this.#q(e) && ((t || !this.#p(e)) && (yield e), e !== this.#h); ) e = this.#l[e];
|
|
14282
|
+
}
|
|
14283
|
+
#q(t) {
|
|
14284
|
+
return t !== void 0 && this.#s.get(this.#i[t]) === t;
|
|
14285
|
+
}
|
|
14286
|
+
*entries() {
|
|
14287
|
+
for (let t of this.#A()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
14288
|
+
}
|
|
14289
|
+
*rentries() {
|
|
14290
|
+
for (let t of this.#v()) this.#t[t] !== void 0 && this.#i[t] !== void 0 && !this.#e(this.#t[t]) && (yield [this.#i[t], this.#t[t]]);
|
|
14291
|
+
}
|
|
14292
|
+
*keys() {
|
|
14293
|
+
for (let t of this.#A()) {
|
|
14294
|
+
let e = this.#i[t];
|
|
14295
|
+
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
14296
|
+
}
|
|
14297
|
+
}
|
|
14298
|
+
*rkeys() {
|
|
14299
|
+
for (let t of this.#v()) {
|
|
14300
|
+
let e = this.#i[t];
|
|
14301
|
+
e !== void 0 && !this.#e(this.#t[t]) && (yield e);
|
|
14302
|
+
}
|
|
14303
|
+
}
|
|
14304
|
+
*values() {
|
|
14305
|
+
for (let t of this.#A()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
14306
|
+
}
|
|
14307
|
+
*rvalues() {
|
|
14308
|
+
for (let t of this.#v()) this.#t[t] !== void 0 && !this.#e(this.#t[t]) && (yield this.#t[t]);
|
|
14309
|
+
}
|
|
14310
|
+
[Symbol.iterator]() {
|
|
14311
|
+
return this.entries();
|
|
14312
|
+
}
|
|
14313
|
+
[Symbol.toStringTag] = "LRUCache";
|
|
14314
|
+
find(t, e = {}) {
|
|
14315
|
+
for (let i2 of this.#A()) {
|
|
14316
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14317
|
+
if (n2 !== void 0 && t(n2, this.#i[i2], this)) return this.#x(this.#i[i2], e);
|
|
14318
|
+
}
|
|
14319
|
+
}
|
|
14320
|
+
forEach(t, e = this) {
|
|
14321
|
+
for (let i2 of this.#A()) {
|
|
14322
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14323
|
+
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
14324
|
+
}
|
|
14325
|
+
}
|
|
14326
|
+
rforEach(t, e = this) {
|
|
14327
|
+
for (let i2 of this.#v()) {
|
|
14328
|
+
let s = this.#t[i2], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14329
|
+
n2 !== void 0 && t.call(e, n2, this.#i[i2], this);
|
|
14330
|
+
}
|
|
14331
|
+
}
|
|
14332
|
+
purgeStale() {
|
|
14333
|
+
let t = false;
|
|
14334
|
+
for (let e of this.#v({ allowStale: true })) this.#p(e) && (this.#z(this.#i[e], "expire"), t = true);
|
|
14335
|
+
return t;
|
|
14336
|
+
}
|
|
14337
|
+
info(t) {
|
|
14338
|
+
let e = this.#s.get(t);
|
|
14339
|
+
if (e === void 0) return;
|
|
14340
|
+
let i2 = this.#t[e], s = this.#e(i2) ? i2.__staleWhileFetching : i2;
|
|
14341
|
+
if (s === void 0) return;
|
|
14342
|
+
let n2 = { value: s };
|
|
14343
|
+
if (this.#d && this.#F) {
|
|
14344
|
+
let o2 = this.#d[e], r = this.#F[e];
|
|
14345
|
+
if (o2 && r) {
|
|
14346
|
+
let h2 = o2 - (this.#S.now() - r);
|
|
14347
|
+
n2.ttl = h2, n2.start = Date.now();
|
|
14348
|
+
}
|
|
14349
|
+
}
|
|
14350
|
+
return this.#y && (n2.size = this.#y[e]), n2;
|
|
14351
|
+
}
|
|
14352
|
+
dump() {
|
|
14353
|
+
let t = [];
|
|
14354
|
+
for (let e of this.#A({ allowStale: true })) {
|
|
14355
|
+
let i2 = this.#i[e], s = this.#t[e], n2 = this.#e(s) ? s.__staleWhileFetching : s;
|
|
14356
|
+
if (n2 === void 0 || i2 === void 0) continue;
|
|
14357
|
+
let o2 = { value: n2 };
|
|
14358
|
+
if (this.#d && this.#F) {
|
|
14359
|
+
o2.ttl = this.#d[e];
|
|
14360
|
+
let r = this.#S.now() - this.#F[e];
|
|
14361
|
+
o2.start = Math.floor(Date.now() - r);
|
|
14362
|
+
}
|
|
14363
|
+
this.#y && (o2.size = this.#y[e]), t.unshift([i2, o2]);
|
|
14364
|
+
}
|
|
14365
|
+
return t;
|
|
14366
|
+
}
|
|
14367
|
+
load(t) {
|
|
14368
|
+
this.clear();
|
|
14369
|
+
for (let [e, i2] of t) {
|
|
14370
|
+
if (i2.start) {
|
|
14371
|
+
let s = Date.now() - i2.start;
|
|
14372
|
+
i2.start = this.#S.now() - s;
|
|
14373
|
+
}
|
|
14374
|
+
this.#W(e, i2.value, i2);
|
|
14375
|
+
}
|
|
14376
|
+
}
|
|
14377
|
+
set(t, e, i2 = {}) {
|
|
14378
|
+
let { status: s = u2.metrics.hasSubscribers ? {} : void 0 } = i2;
|
|
14379
|
+
i2.status = s, s && (s.op = "set", s.key = t, e !== void 0 && (s.value = e));
|
|
14380
|
+
let n2 = this.#W(t, e, i2);
|
|
14381
|
+
return s && u2.metrics.hasSubscribers && u2.metrics.publish(s), n2;
|
|
14382
|
+
}
|
|
14383
|
+
#W(t, e, i2 = {}) {
|
|
14384
|
+
let { ttl: s = this.ttl, start: n2, noDisposeOnSet: o2 = this.noDisposeOnSet, sizeCalculation: r = this.sizeCalculation, status: h2 } = i2;
|
|
14385
|
+
if (e === void 0) return h2 && (h2.set = "deleted"), this.delete(t), this;
|
|
14386
|
+
let { noUpdateTTL: a2 = this.noUpdateTTL } = i2;
|
|
14387
|
+
h2 && !this.#e(e) && (h2.value = e);
|
|
14388
|
+
let d = this.#k(t, e, i2.size || 0, r, h2);
|
|
14389
|
+
if (this.maxEntrySize && d > this.maxEntrySize) return this.#z(t, "set"), h2 && (h2.set = "miss", h2.maxEntrySizeExceeded = true), this;
|
|
14390
|
+
let f = this.#n === 0 ? void 0 : this.#s.get(t);
|
|
14391
|
+
if (f === void 0) f = this.#n === 0 ? this.#h : this.#_.length !== 0 ? this.#_.pop() : this.#n === this.#o ? this.#P(false) : this.#n, this.#i[f] = t, this.#t[f] = e, this.#s.set(t, f), this.#l[this.#h] = f, this.#u[f] = this.#h, this.#h = f, this.#n++, this.#I(f, d, h2), h2 && (h2.set = "add"), a2 = false, this.#U && this.#D?.(e, t, "add");
|
|
14392
|
+
else {
|
|
14393
|
+
this.#L(f);
|
|
14394
|
+
let p = this.#t[f];
|
|
14395
|
+
if (e !== p) {
|
|
14396
|
+
if (this.#O && this.#e(p)) {
|
|
14397
|
+
p.__abortController.abort(new Error("replaced"));
|
|
14398
|
+
let { __staleWhileFetching: m } = p;
|
|
14399
|
+
m !== void 0 && !o2 && (this.#T && this.#m?.(m, t, "set"), this.#f && this.#r?.push([m, t, "set"]));
|
|
14400
|
+
} else o2 || (this.#T && this.#m?.(p, t, "set"), this.#f && this.#r?.push([p, t, "set"]));
|
|
14401
|
+
if (this.#C(f), this.#I(f, d, h2), this.#t[f] = e, h2) {
|
|
14402
|
+
h2.set = "replace";
|
|
14403
|
+
let m = p && this.#e(p) ? p.__staleWhileFetching : p;
|
|
14404
|
+
m !== void 0 && (h2.oldValue = m);
|
|
14405
|
+
}
|
|
14406
|
+
} else h2 && (h2.set = "update");
|
|
14407
|
+
this.#U && this.onInsert?.(e, t, e === p ? "update" : "replace");
|
|
14408
|
+
}
|
|
14409
|
+
if (s !== 0 && !this.#d && this.#H(), this.#d && (a2 || this.#N(f, s, n2), h2 && this.#E(h2, f)), !o2 && this.#f && this.#r) {
|
|
14410
|
+
let p = this.#r, m;
|
|
14411
|
+
for (; m = p?.shift(); ) this.#w?.(...m);
|
|
14412
|
+
}
|
|
14413
|
+
return this;
|
|
14414
|
+
}
|
|
14415
|
+
pop() {
|
|
14416
|
+
try {
|
|
14417
|
+
for (; this.#n; ) {
|
|
14418
|
+
let t = this.#t[this.#a];
|
|
14419
|
+
if (this.#P(true), this.#e(t)) {
|
|
14420
|
+
if (t.__staleWhileFetching) return t.__staleWhileFetching;
|
|
14421
|
+
} else if (t !== void 0) return t;
|
|
14422
|
+
}
|
|
14423
|
+
} finally {
|
|
14424
|
+
if (this.#f && this.#r) {
|
|
14425
|
+
let t = this.#r, e;
|
|
14426
|
+
for (; e = t?.shift(); ) this.#w?.(...e);
|
|
14427
|
+
}
|
|
14428
|
+
}
|
|
14429
|
+
}
|
|
14430
|
+
#P(t) {
|
|
14431
|
+
let e = this.#a, i2 = this.#i[e], s = this.#t[e];
|
|
14432
|
+
return this.#O && this.#e(s) ? s.__abortController.abort(new Error("evicted")) : (this.#T || this.#f) && (this.#T && this.#m?.(s, i2, "evict"), this.#f && this.#r?.push([s, i2, "evict"])), this.#C(e), this.#g?.[e] && (clearTimeout(this.#g[e]), this.#g[e] = void 0), t && (this.#i[e] = void 0, this.#t[e] = void 0, this.#_.push(e)), this.#n === 1 ? (this.#a = this.#h = 0, this.#_.length = 0) : this.#a = this.#l[e], this.#s.delete(i2), this.#n--, e;
|
|
14433
|
+
}
|
|
14434
|
+
has(t, e = {}) {
|
|
14435
|
+
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14436
|
+
e.status = i2, i2 && (i2.op = "has", i2.key = t);
|
|
14437
|
+
let s = this.#Y(t, e);
|
|
14438
|
+
return u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
14439
|
+
}
|
|
14440
|
+
#Y(t, e = {}) {
|
|
14441
|
+
let { updateAgeOnHas: i2 = this.updateAgeOnHas, status: s } = e, n2 = this.#s.get(t);
|
|
14442
|
+
if (n2 !== void 0) {
|
|
14443
|
+
let o2 = this.#t[n2];
|
|
14444
|
+
if (this.#e(o2) && o2.__staleWhileFetching === void 0) return false;
|
|
14445
|
+
if (this.#p(n2)) s && (s.has = "stale", this.#E(s, n2));
|
|
14446
|
+
else return i2 && this.#R(n2), s && (s.has = "hit", this.#E(s, n2)), true;
|
|
14447
|
+
} else s && (s.has = "miss");
|
|
14448
|
+
return false;
|
|
14449
|
+
}
|
|
14450
|
+
peek(t, e = {}) {
|
|
14451
|
+
let { status: i2 = C() ? {} : void 0 } = e;
|
|
14452
|
+
i2 && (i2.op = "peek", i2.key = t), e.status = i2;
|
|
14453
|
+
let s = this.#J(t, e);
|
|
14454
|
+
return u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
14455
|
+
}
|
|
14456
|
+
#J(t, e) {
|
|
14457
|
+
let { status: i2, allowStale: s = this.allowStale } = e, n2 = this.#s.get(t);
|
|
14458
|
+
if (n2 === void 0 || !s && this.#p(n2)) {
|
|
14459
|
+
i2 && (i2.peek = n2 === void 0 ? "miss" : "stale");
|
|
14460
|
+
return;
|
|
14461
|
+
}
|
|
14462
|
+
let o2 = this.#t[n2], r = this.#e(o2) ? o2.__staleWhileFetching : o2;
|
|
14463
|
+
return i2 && (r !== void 0 ? (i2.peek = "hit", i2.value = r) : i2.peek = "miss"), r;
|
|
14464
|
+
}
|
|
14465
|
+
#G(t, e, i2, s) {
|
|
14466
|
+
let n2 = e === void 0 ? void 0 : this.#t[e];
|
|
14467
|
+
if (this.#e(n2)) return n2;
|
|
14468
|
+
let o2 = new AbortController(), { signal: r } = i2;
|
|
14469
|
+
r?.addEventListener("abort", () => o2.abort(r.reason), { signal: o2.signal });
|
|
14470
|
+
let h2 = { signal: o2.signal, options: i2, context: s }, a2 = (w, _ = false) => {
|
|
14471
|
+
let { aborted: l } = o2.signal, S = i2.ignoreFetchAbort && w !== void 0, y = i2.ignoreFetchAbort || !!(i2.allowStaleOnFetchAbort && w !== void 0);
|
|
14472
|
+
if (i2.status && (l && !_ ? (i2.status.fetchAborted = true, i2.status.fetchError = o2.signal.reason, S && (i2.status.fetchAbortIgnored = true)) : i2.status.fetchResolved = true), l && !S && !_) return f(o2.signal.reason, y);
|
|
14473
|
+
let b = m, g = this.#t[e];
|
|
14474
|
+
return (g === m || g === void 0 && S && _) && (w === void 0 ? b.__staleWhileFetching !== void 0 ? this.#t[e] = b.__staleWhileFetching : this.#z(t, "fetch") : (i2.status && (i2.status.fetchUpdated = true), this.#W(t, w, h2.options))), w;
|
|
14475
|
+
}, d = (w) => (i2.status && (i2.status.fetchRejected = true, i2.status.fetchError = w), f(w, false)), f = (w, _) => {
|
|
14476
|
+
let { aborted: l } = o2.signal, S = l && i2.allowStaleOnFetchAbort, y = S || i2.allowStaleOnFetchRejection, b = y || i2.noDeleteOnFetchRejection, g = m;
|
|
14477
|
+
if (this.#t[e] === m && (!b || !_ && g.__staleWhileFetching === void 0 ? this.#z(t, "fetch") : S || (this.#t[e] = g.__staleWhileFetching)), y) return i2.status && g.__staleWhileFetching !== void 0 && (i2.status.returnedStale = true), g.__staleWhileFetching;
|
|
14478
|
+
if (g.__returned === g) throw w;
|
|
14479
|
+
}, p = (w, _) => {
|
|
14480
|
+
let l = this.#M?.(t, n2, h2);
|
|
14481
|
+
l && l instanceof Promise && l.then((S) => w(S === void 0 ? void 0 : S), _), o2.signal.addEventListener("abort", () => {
|
|
14482
|
+
(!i2.ignoreFetchAbort || i2.allowStaleOnFetchAbort) && (w(void 0), i2.allowStaleOnFetchAbort && (w = (S) => a2(S, true)));
|
|
14483
|
+
});
|
|
14484
|
+
};
|
|
14485
|
+
i2.status && (i2.status.fetchDispatched = true);
|
|
14486
|
+
let m = new Promise(p).then(a2, d), T = Object.assign(m, { __abortController: o2, __staleWhileFetching: n2, __returned: void 0 });
|
|
14487
|
+
return e === void 0 ? (this.#W(t, T, { ...h2.options, status: void 0 }), e = this.#s.get(t)) : this.#t[e] = T, T;
|
|
14488
|
+
}
|
|
14489
|
+
#e(t) {
|
|
14490
|
+
if (!this.#O) return false;
|
|
14491
|
+
let e = t;
|
|
14492
|
+
return !!e && e instanceof Promise && e.hasOwnProperty("__staleWhileFetching") && e.__abortController instanceof AbortController;
|
|
14493
|
+
}
|
|
14494
|
+
fetch(t, e = {}) {
|
|
14495
|
+
let i2 = u2.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
14496
|
+
e.status = s, s && e.context && (s.context = e.context);
|
|
14497
|
+
let n2 = this.#V(t, e);
|
|
14498
|
+
return s && i2 && (s.trace = true, u2.tracing.tracePromise(() => n2, s).catch(() => {
|
|
14499
|
+
})), n2;
|
|
14500
|
+
}
|
|
14501
|
+
async #V(t, e = {}) {
|
|
14502
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, ttl: o2 = this.ttl, noDisposeOnSet: r = this.noDisposeOnSet, size: h2 = 0, sizeCalculation: a2 = this.sizeCalculation, noUpdateTTL: d = this.noUpdateTTL, noDeleteOnFetchRejection: f = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection: p = this.allowStaleOnFetchRejection, ignoreFetchAbort: m = this.ignoreFetchAbort, allowStaleOnFetchAbort: T = this.allowStaleOnFetchAbort, context: w, forceRefresh: _ = false, status: l, signal: S } = e;
|
|
14503
|
+
if (l && (l.op = "fetch", l.key = t, _ && (l.forceRefresh = true)), !this.#O) return l && (l.fetch = "get"), this.#x(t, { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, status: l });
|
|
14504
|
+
let y = { allowStale: i2, updateAgeOnGet: s, noDeleteOnStaleGet: n2, ttl: o2, noDisposeOnSet: r, size: h2, sizeCalculation: a2, noUpdateTTL: d, noDeleteOnFetchRejection: f, allowStaleOnFetchRejection: p, allowStaleOnFetchAbort: T, ignoreFetchAbort: m, status: l, signal: S }, b = this.#s.get(t);
|
|
14505
|
+
if (b === void 0) {
|
|
14506
|
+
l && (l.fetch = "miss");
|
|
14507
|
+
let g = this.#G(t, b, y, w);
|
|
14508
|
+
return g.__returned = g;
|
|
14509
|
+
} else {
|
|
14510
|
+
let g = this.#t[b];
|
|
14511
|
+
if (this.#e(g)) {
|
|
14512
|
+
let E = i2 && g.__staleWhileFetching !== void 0;
|
|
14513
|
+
return l && (l.fetch = "inflight", E && (l.returnedStale = true)), E ? g.__staleWhileFetching : g.__returned = g;
|
|
14514
|
+
}
|
|
14515
|
+
let A = this.#p(b);
|
|
14516
|
+
if (!_ && !A) return l && (l.fetch = "hit"), this.#L(b), s && this.#R(b), l && this.#E(l, b), g;
|
|
14517
|
+
let v = this.#G(t, b, y, w), z = v.__staleWhileFetching !== void 0 && i2;
|
|
14518
|
+
return l && (l.fetch = A ? "stale" : "refresh", z && A && (l.returnedStale = true)), z ? v.__staleWhileFetching : v.__returned = v;
|
|
14519
|
+
}
|
|
14520
|
+
}
|
|
14521
|
+
forceFetch(t, e = {}) {
|
|
14522
|
+
let i2 = u2.tracing.hasSubscribers, { status: s = C() ? {} : void 0 } = e;
|
|
14523
|
+
e.status = s, s && e.context && (s.context = e.context);
|
|
14524
|
+
let n2 = this.#K(t, e);
|
|
14525
|
+
return s && i2 && (s.trace = true, u2.tracing.tracePromise(() => n2, s).catch(() => {
|
|
14526
|
+
})), n2;
|
|
14527
|
+
}
|
|
14528
|
+
async #K(t, e = {}) {
|
|
14529
|
+
let i2 = await this.#V(t, e);
|
|
14530
|
+
if (i2 === void 0) throw new Error("fetch() returned undefined");
|
|
14531
|
+
return i2;
|
|
14532
|
+
}
|
|
14533
|
+
memo(t, e = {}) {
|
|
14534
|
+
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14535
|
+
e.status = i2, i2 && (i2.op = "memo", i2.key = t, e.context && (i2.context = e.context));
|
|
14536
|
+
let s = this.#Q(t, e);
|
|
14537
|
+
return i2 && (i2.value = s), u2.metrics.hasSubscribers && u2.metrics.publish(i2), s;
|
|
14538
|
+
}
|
|
14539
|
+
#Q(t, e = {}) {
|
|
14540
|
+
let i2 = this.#j;
|
|
14541
|
+
if (!i2) throw new Error("no memoMethod provided to constructor");
|
|
14542
|
+
let { context: s, status: n2, forceRefresh: o2, ...r } = e;
|
|
14543
|
+
n2 && o2 && (n2.forceRefresh = true);
|
|
14544
|
+
let h2 = this.#x(t, r), a2 = o2 || h2 === void 0;
|
|
14545
|
+
if (n2 && (n2.memo = a2 ? "miss" : "hit", a2 || (n2.value = h2)), !a2) return h2;
|
|
14546
|
+
let d = i2(t, h2, { options: r, context: s });
|
|
14547
|
+
return n2 && (n2.value = d), this.#W(t, d, r), d;
|
|
14548
|
+
}
|
|
14549
|
+
get(t, e = {}) {
|
|
14550
|
+
let { status: i2 = u2.metrics.hasSubscribers ? {} : void 0 } = e;
|
|
14551
|
+
e.status = i2, i2 && (i2.op = "get", i2.key = t);
|
|
14552
|
+
let s = this.#x(t, e);
|
|
14553
|
+
return i2 && (s !== void 0 && (i2.value = s), u2.metrics.hasSubscribers && u2.metrics.publish(i2)), s;
|
|
14554
|
+
}
|
|
14555
|
+
#x(t, e = {}) {
|
|
14556
|
+
let { allowStale: i2 = this.allowStale, updateAgeOnGet: s = this.updateAgeOnGet, noDeleteOnStaleGet: n2 = this.noDeleteOnStaleGet, status: o2 } = e, r = this.#s.get(t);
|
|
14557
|
+
if (r === void 0) {
|
|
14558
|
+
o2 && (o2.get = "miss");
|
|
14559
|
+
return;
|
|
14560
|
+
}
|
|
14561
|
+
let h2 = this.#t[r], a2 = this.#e(h2);
|
|
14562
|
+
return o2 && this.#E(o2, r), this.#p(r) ? a2 ? (o2 && (o2.get = "stale-fetching"), i2 && h2.__staleWhileFetching !== void 0 ? (o2 && (o2.returnedStale = true), h2.__staleWhileFetching) : void 0) : (n2 || this.#z(t, "expire"), o2 && (o2.get = "stale"), i2 ? (o2 && (o2.returnedStale = true), h2) : void 0) : (o2 && (o2.get = a2 ? "fetching" : "hit"), this.#L(r), s && this.#R(r), a2 ? h2.__staleWhileFetching : h2);
|
|
14563
|
+
}
|
|
14564
|
+
#B(t, e) {
|
|
14565
|
+
this.#u[e] = t, this.#l[t] = e;
|
|
14566
|
+
}
|
|
14567
|
+
#L(t) {
|
|
14568
|
+
t !== this.#h && (t === this.#a ? this.#a = this.#l[t] : this.#B(this.#u[t], this.#l[t]), this.#B(this.#h, t), this.#h = t);
|
|
14569
|
+
}
|
|
14570
|
+
delete(t) {
|
|
14571
|
+
return this.#z(t, "delete");
|
|
14572
|
+
}
|
|
14573
|
+
#z(t, e) {
|
|
14574
|
+
u2.metrics.hasSubscribers && u2.metrics.publish({ op: "delete", delete: e, key: t });
|
|
14575
|
+
let i2 = false;
|
|
14576
|
+
if (this.#n !== 0) {
|
|
14577
|
+
let s = this.#s.get(t);
|
|
14578
|
+
if (s !== void 0) if (this.#g?.[s] && (clearTimeout(this.#g?.[s]), this.#g[s] = void 0), i2 = true, this.#n === 1) this.#$(e);
|
|
14579
|
+
else {
|
|
14580
|
+
this.#C(s);
|
|
14581
|
+
let n2 = this.#t[s];
|
|
14582
|
+
if (this.#e(n2) ? n2.__abortController.abort(new Error("deleted")) : (this.#T || this.#f) && (this.#T && this.#m?.(n2, t, e), this.#f && this.#r?.push([n2, t, e])), this.#s.delete(t), this.#i[s] = void 0, this.#t[s] = void 0, s === this.#h) this.#h = this.#u[s];
|
|
14583
|
+
else if (s === this.#a) this.#a = this.#l[s];
|
|
14584
|
+
else {
|
|
14585
|
+
let o2 = this.#u[s];
|
|
14586
|
+
this.#l[o2] = this.#l[s];
|
|
14587
|
+
let r = this.#l[s];
|
|
14588
|
+
this.#u[r] = this.#u[s];
|
|
14589
|
+
}
|
|
14590
|
+
this.#n--, this.#_.push(s);
|
|
14591
|
+
}
|
|
14592
|
+
}
|
|
14593
|
+
if (this.#f && this.#r?.length) {
|
|
14594
|
+
let s = this.#r, n2;
|
|
14595
|
+
for (; n2 = s?.shift(); ) this.#w?.(...n2);
|
|
14596
|
+
}
|
|
14597
|
+
return i2;
|
|
14598
|
+
}
|
|
14599
|
+
clear() {
|
|
14600
|
+
return this.#$("delete");
|
|
14601
|
+
}
|
|
14602
|
+
#$(t) {
|
|
14603
|
+
for (let e of this.#v({ allowStale: true })) {
|
|
14604
|
+
let i2 = this.#t[e];
|
|
14605
|
+
if (this.#e(i2)) i2.__abortController.abort(new Error("deleted"));
|
|
14606
|
+
else {
|
|
14607
|
+
let s = this.#i[e];
|
|
14608
|
+
this.#T && this.#m?.(i2, s, t), this.#f && this.#r?.push([i2, s, t]);
|
|
14609
|
+
}
|
|
14610
|
+
}
|
|
14611
|
+
if (this.#s.clear(), this.#t.fill(void 0), this.#i.fill(void 0), this.#d && this.#F) {
|
|
14612
|
+
this.#d.fill(0), this.#F.fill(0);
|
|
14613
|
+
for (let e of this.#g ?? []) e !== void 0 && clearTimeout(e);
|
|
14614
|
+
this.#g?.fill(void 0);
|
|
14615
|
+
}
|
|
14616
|
+
if (this.#y && this.#y.fill(0), this.#a = 0, this.#h = 0, this.#_.length = 0, this.#b = 0, this.#n = 0, this.#f && this.#r) {
|
|
14617
|
+
let e = this.#r, i2;
|
|
14618
|
+
for (; i2 = e?.shift(); ) this.#w?.(...i2);
|
|
14619
|
+
}
|
|
14620
|
+
}
|
|
14621
|
+
};
|
|
14622
|
+
exports.LRUCache = L;
|
|
14623
|
+
}
|
|
14624
|
+
});
|
|
14625
|
+
|
|
14626
|
+
// node_modules/hosted-git-info/lib/hosts.js
|
|
14627
|
+
var require_hosts2 = __commonJS({
|
|
14628
|
+
"node_modules/hosted-git-info/lib/hosts.js"(exports, module) {
|
|
14629
|
+
"use strict";
|
|
14630
|
+
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
14631
|
+
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
14632
|
+
var formatHashFragment = (f) => f.toLowerCase().replace(/^\W+/g, "").replace(/(?<!\W)\W+$/, "").replace(/\//g, "").replace(/\W+/g, "-");
|
|
14633
|
+
var defaults2 = {
|
|
14634
|
+
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14635
|
+
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14636
|
+
edittemplate: ({ domain, user, project, committish, editpath, path: path26 }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path26)}`,
|
|
14637
|
+
browsetemplate: ({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`,
|
|
14638
|
+
browsetreetemplate: ({ domain, user, project, committish, treepath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14639
|
+
browseblobtemplate: ({ domain, user, project, committish, blobpath, path: path26, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path26}${maybeJoin("#", hashformat(fragment || ""))}`,
|
|
14640
|
+
docstemplate: ({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`,
|
|
14641
|
+
httpstemplate: ({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14642
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
14643
|
+
shortcuttemplate: ({ type: type2, user, project, committish }) => `${type2}:${user}/${project}${maybeJoin("#", committish)}`,
|
|
14644
|
+
pathtemplate: ({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`,
|
|
14645
|
+
bugstemplate: ({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`,
|
|
14646
|
+
hashformat: formatHashFragment
|
|
14647
|
+
};
|
|
14648
|
+
var hosts = {};
|
|
14649
|
+
hosts.github = {
|
|
14650
|
+
// First two are insecure and generally shouldn't be used any more, but
|
|
14651
|
+
// they are still supported.
|
|
14652
|
+
protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14653
|
+
domain: "github.com",
|
|
14654
|
+
treepath: "tree",
|
|
14655
|
+
blobpath: "blob",
|
|
14656
|
+
editpath: "edit",
|
|
14657
|
+
filetemplate: ({ auth, user, project, committish, path: path26 }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path26}`,
|
|
14658
|
+
gittemplate: ({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
14659
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14660
|
+
extract: (url) => {
|
|
14661
|
+
let [, user, project, type2, committish] = url.pathname.split("/", 5);
|
|
14662
|
+
if (type2 && type2 !== "tree") {
|
|
14663
|
+
return;
|
|
14664
|
+
}
|
|
14665
|
+
if (!type2) {
|
|
14666
|
+
committish = url.hash.slice(1);
|
|
14667
|
+
}
|
|
14668
|
+
if (project && project.endsWith(".git")) {
|
|
14669
|
+
project = project.slice(0, -4);
|
|
14670
|
+
}
|
|
14671
|
+
if (!user || !project) {
|
|
14672
|
+
return;
|
|
14673
|
+
}
|
|
14674
|
+
return { user, project, committish };
|
|
14675
|
+
}
|
|
14676
|
+
};
|
|
14677
|
+
hosts.bitbucket = {
|
|
14678
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14679
|
+
domain: "bitbucket.org",
|
|
14680
|
+
treepath: "src",
|
|
14681
|
+
blobpath: "src",
|
|
14682
|
+
editpath: "?mode=edit",
|
|
14683
|
+
edittemplate: ({ domain, user, project, committish, treepath, path: path26, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path26, editpath)}`,
|
|
14684
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`,
|
|
14685
|
+
extract: (url) => {
|
|
14686
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14687
|
+
if (["get"].includes(aux)) {
|
|
14688
|
+
return;
|
|
14689
|
+
}
|
|
14690
|
+
if (project && project.endsWith(".git")) {
|
|
14691
|
+
project = project.slice(0, -4);
|
|
14692
|
+
}
|
|
14693
|
+
if (!user || !project) {
|
|
14694
|
+
return;
|
|
14695
|
+
}
|
|
14696
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14697
|
+
}
|
|
14698
|
+
};
|
|
14699
|
+
hosts.gitlab = {
|
|
14700
|
+
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14701
|
+
domain: "gitlab.com",
|
|
14702
|
+
treepath: "tree",
|
|
14703
|
+
blobpath: "tree",
|
|
14704
|
+
editpath: "-/edit",
|
|
14705
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/api/v4/projects/${maybeEncode(user + "/" + project)}/repository/archive.tar.gz?sha=${maybeEncode(committish || "HEAD")}`,
|
|
14706
|
+
extract: (url) => {
|
|
14707
|
+
const path26 = url.pathname.slice(1);
|
|
14708
|
+
if (path26.includes("/-/") || path26.includes("/archive.tar.gz")) {
|
|
14709
|
+
return;
|
|
14710
|
+
}
|
|
14711
|
+
const segments = path26.split("/");
|
|
14712
|
+
let project = segments.pop();
|
|
14713
|
+
if (project.endsWith(".git")) {
|
|
14714
|
+
project = project.slice(0, -4);
|
|
14715
|
+
}
|
|
14716
|
+
const user = segments.join("/");
|
|
14717
|
+
if (!user || !project) {
|
|
14718
|
+
return;
|
|
14719
|
+
}
|
|
14720
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14721
|
+
}
|
|
14722
|
+
};
|
|
14723
|
+
hosts.gist = {
|
|
14724
|
+
protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
14725
|
+
domain: "gist.github.com",
|
|
14726
|
+
editpath: "edit",
|
|
14727
|
+
sshtemplate: ({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`,
|
|
14728
|
+
sshurltemplate: ({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14729
|
+
edittemplate: ({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`,
|
|
14730
|
+
browsetemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14731
|
+
browsetreetemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
14732
|
+
browseblobtemplate: ({ domain, project, committish, path: path26, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path26))}`,
|
|
14733
|
+
docstemplate: ({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`,
|
|
14734
|
+
httpstemplate: ({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14735
|
+
filetemplate: ({ user, project, committish, path: path26 }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path26}`,
|
|
14736
|
+
shortcuttemplate: ({ type: type2, project, committish }) => `${type2}:${project}${maybeJoin("#", committish)}`,
|
|
14737
|
+
pathtemplate: ({ project, committish }) => `${project}${maybeJoin("#", committish)}`,
|
|
14738
|
+
bugstemplate: ({ domain, project }) => `https://${domain}/${project}`,
|
|
14739
|
+
gittemplate: ({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`,
|
|
14740
|
+
tarballtemplate: ({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`,
|
|
14741
|
+
extract: (url) => {
|
|
14742
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14743
|
+
if (aux === "raw") {
|
|
14744
|
+
return;
|
|
14745
|
+
}
|
|
14746
|
+
if (!project) {
|
|
14747
|
+
if (!user) {
|
|
14748
|
+
return;
|
|
14749
|
+
}
|
|
14750
|
+
project = user;
|
|
14751
|
+
user = null;
|
|
14752
|
+
}
|
|
14753
|
+
if (project.endsWith(".git")) {
|
|
14754
|
+
project = project.slice(0, -4);
|
|
14755
|
+
}
|
|
14756
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14757
|
+
},
|
|
14758
|
+
hashformat: function(fragment) {
|
|
14759
|
+
return fragment && "file-" + formatHashFragment(fragment);
|
|
14760
|
+
}
|
|
14761
|
+
};
|
|
14762
|
+
hosts.sourcehut = {
|
|
14763
|
+
protocols: ["git+ssh:", "https:"],
|
|
14764
|
+
domain: "git.sr.ht",
|
|
14765
|
+
treepath: "tree",
|
|
14766
|
+
blobpath: "tree",
|
|
14767
|
+
filetemplate: ({ domain, user, project, committish, path: path26 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path26}`,
|
|
14768
|
+
httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}${maybeJoin("#", committish)}`,
|
|
14769
|
+
tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
|
|
14770
|
+
bugstemplate: () => null,
|
|
14771
|
+
extract: (url) => {
|
|
14772
|
+
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
14773
|
+
if (["archive"].includes(aux)) {
|
|
14774
|
+
return;
|
|
14775
|
+
}
|
|
14776
|
+
if (project && project.endsWith(".git")) {
|
|
14777
|
+
project = project.slice(0, -4);
|
|
14778
|
+
}
|
|
14779
|
+
if (!user || !project) {
|
|
14780
|
+
return;
|
|
14781
|
+
}
|
|
14782
|
+
return { user, project, committish: url.hash.slice(1) };
|
|
14783
|
+
}
|
|
14784
|
+
};
|
|
14785
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
14786
|
+
hosts[name] = Object.assign({}, defaults2, host);
|
|
14787
|
+
}
|
|
14788
|
+
module.exports = hosts;
|
|
14789
|
+
}
|
|
14790
|
+
});
|
|
14791
|
+
|
|
14792
|
+
// node_modules/hosted-git-info/lib/parse-url.js
|
|
14793
|
+
var require_parse_url2 = __commonJS({
|
|
14794
|
+
"node_modules/hosted-git-info/lib/parse-url.js"(exports, module) {
|
|
14795
|
+
var url = __require("url");
|
|
14796
|
+
var lastIndexOfBefore = (str2, char, beforeChar) => {
|
|
14797
|
+
const startPosition = str2.indexOf(beforeChar);
|
|
14798
|
+
return str2.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
14799
|
+
};
|
|
14800
|
+
var safeUrl = (u2) => {
|
|
14801
|
+
try {
|
|
14802
|
+
return new url.URL(u2);
|
|
14803
|
+
} catch {
|
|
14804
|
+
}
|
|
14805
|
+
};
|
|
14806
|
+
var correctProtocol = (arg, protocols) => {
|
|
14807
|
+
const firstColon = arg.indexOf(":");
|
|
14808
|
+
const proto = arg.slice(0, firstColon + 1);
|
|
14809
|
+
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
|
|
14810
|
+
return arg;
|
|
14811
|
+
}
|
|
14812
|
+
if (arg.substr(firstColon, 3) === "://") {
|
|
14813
|
+
return arg;
|
|
14814
|
+
}
|
|
14815
|
+
const firstAt = arg.indexOf("@");
|
|
14816
|
+
if (firstAt > -1) {
|
|
14817
|
+
if (firstAt > firstColon) {
|
|
14818
|
+
return `git+ssh://${arg}`;
|
|
14819
|
+
} else {
|
|
14820
|
+
return arg;
|
|
14821
|
+
}
|
|
14822
|
+
}
|
|
14823
|
+
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
|
|
14824
|
+
};
|
|
14825
|
+
var correctUrl = (giturl) => {
|
|
14826
|
+
const firstAt = lastIndexOfBefore(giturl, "@", "#");
|
|
14827
|
+
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
|
|
14828
|
+
if (lastColonBeforeHash > firstAt) {
|
|
14829
|
+
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
|
|
14830
|
+
}
|
|
14831
|
+
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
|
|
14832
|
+
giturl = `git+ssh://${giturl}`;
|
|
14833
|
+
}
|
|
14834
|
+
return giturl;
|
|
14835
|
+
};
|
|
14836
|
+
module.exports = (giturl, protocols) => {
|
|
14837
|
+
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
14838
|
+
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
14839
|
+
};
|
|
14840
|
+
}
|
|
14841
|
+
});
|
|
14842
|
+
|
|
14843
|
+
// node_modules/hosted-git-info/lib/from-url.js
|
|
14844
|
+
var require_from_url2 = __commonJS({
|
|
14845
|
+
"node_modules/hosted-git-info/lib/from-url.js"(exports, module) {
|
|
14846
|
+
"use strict";
|
|
14847
|
+
var parseUrl = require_parse_url2();
|
|
14848
|
+
var isGitHubShorthand = (arg) => {
|
|
14849
|
+
const firstHash = arg.indexOf("#");
|
|
14850
|
+
const firstSlash = arg.indexOf("/");
|
|
14851
|
+
const secondSlash = arg.indexOf("/", firstSlash + 1);
|
|
14852
|
+
const firstColon = arg.indexOf(":");
|
|
14853
|
+
const firstSpace = /\s/.exec(arg);
|
|
14854
|
+
const firstAt = arg.indexOf("@");
|
|
14855
|
+
const spaceOnlyAfterHash = !firstSpace || firstHash > -1 && firstSpace.index > firstHash;
|
|
14856
|
+
const atOnlyAfterHash = firstAt === -1 || firstHash > -1 && firstAt > firstHash;
|
|
14857
|
+
const colonOnlyAfterHash = firstColon === -1 || firstHash > -1 && firstColon > firstHash;
|
|
14858
|
+
const secondSlashOnlyAfterHash = secondSlash === -1 || firstHash > -1 && secondSlash > firstHash;
|
|
14859
|
+
const hasSlash = firstSlash > 0;
|
|
14860
|
+
const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== "/" : !arg.endsWith("/");
|
|
14861
|
+
const doesNotStartWithDot = !arg.startsWith(".");
|
|
14862
|
+
return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash;
|
|
14863
|
+
};
|
|
14864
|
+
module.exports = (giturl, opts, { gitHosts, protocols }) => {
|
|
14865
|
+
if (!giturl) {
|
|
14866
|
+
return;
|
|
14867
|
+
}
|
|
14868
|
+
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
|
|
14869
|
+
const parsed = parseUrl(correctedUrl, protocols);
|
|
14870
|
+
if (!parsed) {
|
|
14871
|
+
return;
|
|
14872
|
+
}
|
|
14873
|
+
const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
|
|
14874
|
+
const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
|
|
14875
|
+
const gitHostName = gitHostShortcut || gitHostDomain;
|
|
14876
|
+
if (!gitHostName) {
|
|
14877
|
+
return;
|
|
14878
|
+
}
|
|
14879
|
+
const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain];
|
|
14880
|
+
let auth = null;
|
|
14881
|
+
if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) {
|
|
14882
|
+
auth = `${parsed.username}${parsed.password ? ":" + parsed.password : ""}`;
|
|
14883
|
+
}
|
|
14884
|
+
let committish = null;
|
|
14885
|
+
let user = null;
|
|
14886
|
+
let project = null;
|
|
14887
|
+
let defaultRepresentation = null;
|
|
14888
|
+
try {
|
|
14889
|
+
if (gitHostShortcut) {
|
|
14890
|
+
let pathname = parsed.pathname.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname;
|
|
14891
|
+
const firstAt = pathname.indexOf("@");
|
|
14892
|
+
if (firstAt > -1) {
|
|
14893
|
+
pathname = pathname.slice(firstAt + 1);
|
|
14894
|
+
}
|
|
14895
|
+
const lastSlash = pathname.lastIndexOf("/");
|
|
14896
|
+
if (lastSlash > -1) {
|
|
14897
|
+
user = decodeURIComponent(pathname.slice(0, lastSlash));
|
|
14898
|
+
if (!user) {
|
|
14899
|
+
user = null;
|
|
14900
|
+
}
|
|
14901
|
+
project = decodeURIComponent(pathname.slice(lastSlash + 1));
|
|
14902
|
+
} else {
|
|
14903
|
+
project = decodeURIComponent(pathname);
|
|
14904
|
+
}
|
|
14905
|
+
if (project.endsWith(".git")) {
|
|
14906
|
+
project = project.slice(0, -4);
|
|
14907
|
+
}
|
|
14908
|
+
if (parsed.hash) {
|
|
14909
|
+
committish = decodeURIComponent(parsed.hash.slice(1));
|
|
14910
|
+
}
|
|
14911
|
+
defaultRepresentation = "shortcut";
|
|
14912
|
+
} else {
|
|
14913
|
+
if (!gitHostInfo.protocols.includes(parsed.protocol)) {
|
|
14914
|
+
return;
|
|
14915
|
+
}
|
|
14916
|
+
const segments = gitHostInfo.extract(parsed);
|
|
14917
|
+
if (!segments) {
|
|
14918
|
+
return;
|
|
14919
|
+
}
|
|
14920
|
+
user = segments.user && decodeURIComponent(segments.user);
|
|
14921
|
+
project = decodeURIComponent(segments.project);
|
|
14922
|
+
committish = decodeURIComponent(segments.committish);
|
|
14923
|
+
defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1);
|
|
14924
|
+
}
|
|
14925
|
+
} catch (err) {
|
|
14926
|
+
if (err instanceof URIError) {
|
|
14927
|
+
return;
|
|
14928
|
+
} else {
|
|
14929
|
+
throw err;
|
|
14930
|
+
}
|
|
14931
|
+
}
|
|
14932
|
+
return [gitHostName, user, auth, project, committish, defaultRepresentation, opts];
|
|
14933
|
+
};
|
|
14934
|
+
}
|
|
14935
|
+
});
|
|
14936
|
+
|
|
14937
|
+
// node_modules/hosted-git-info/lib/index.js
|
|
14938
|
+
var require_lib6 = __commonJS({
|
|
14939
|
+
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
14940
|
+
"use strict";
|
|
14941
|
+
var { LRUCache } = require_index_min2();
|
|
14942
|
+
var hosts = require_hosts2();
|
|
14943
|
+
var fromUrl = require_from_url2();
|
|
14944
|
+
var parseUrl = require_parse_url2();
|
|
14945
|
+
var cache2 = new LRUCache({ max: 1e3 });
|
|
14946
|
+
function unknownHostedUrl(url) {
|
|
14947
|
+
try {
|
|
14948
|
+
const {
|
|
14949
|
+
protocol,
|
|
14950
|
+
hostname,
|
|
14951
|
+
pathname
|
|
14952
|
+
} = new URL(url);
|
|
14953
|
+
if (!hostname) {
|
|
14954
|
+
return null;
|
|
14955
|
+
}
|
|
14956
|
+
const proto = /(?:git\+)http:$/.test(protocol) ? "http:" : "https:";
|
|
14957
|
+
const path26 = pathname.replace(/\.git$/, "");
|
|
14958
|
+
return `${proto}//${hostname}${path26}`;
|
|
14959
|
+
} catch {
|
|
14960
|
+
return null;
|
|
14961
|
+
}
|
|
14962
|
+
}
|
|
14963
|
+
var GitHost = class _GitHost {
|
|
14964
|
+
constructor(type2, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
14965
|
+
Object.assign(this, _GitHost.#gitHosts[type2], {
|
|
14966
|
+
type: type2,
|
|
14967
|
+
user,
|
|
14968
|
+
auth,
|
|
14969
|
+
project,
|
|
14970
|
+
committish,
|
|
14971
|
+
default: defaultRepresentation,
|
|
14972
|
+
opts
|
|
14973
|
+
});
|
|
14974
|
+
}
|
|
14975
|
+
static #gitHosts = { byShortcut: {}, byDomain: {} };
|
|
14976
|
+
static #protocols = {
|
|
14977
|
+
"git+ssh:": { name: "sshurl" },
|
|
14978
|
+
"ssh:": { name: "sshurl" },
|
|
14979
|
+
"git+https:": { name: "https", auth: true },
|
|
14980
|
+
"git:": { auth: true },
|
|
14981
|
+
"http:": { auth: true },
|
|
14982
|
+
"https:": { auth: true },
|
|
14983
|
+
"git+http:": { auth: true }
|
|
14984
|
+
};
|
|
14985
|
+
static addHost(name, host) {
|
|
14986
|
+
_GitHost.#gitHosts[name] = host;
|
|
14987
|
+
_GitHost.#gitHosts.byDomain[host.domain] = name;
|
|
14988
|
+
_GitHost.#gitHosts.byShortcut[`${name}:`] = name;
|
|
14989
|
+
_GitHost.#protocols[`${name}:`] = { name };
|
|
14990
|
+
}
|
|
14991
|
+
static fromUrl(giturl, opts) {
|
|
14992
|
+
if (typeof giturl !== "string") {
|
|
14993
|
+
return;
|
|
14994
|
+
}
|
|
14995
|
+
const key = giturl + JSON.stringify(opts || {});
|
|
14996
|
+
if (!cache2.has(key)) {
|
|
14997
|
+
const hostArgs = fromUrl(giturl, opts, {
|
|
14998
|
+
gitHosts: _GitHost.#gitHosts,
|
|
14999
|
+
protocols: _GitHost.#protocols
|
|
15000
|
+
});
|
|
15001
|
+
cache2.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
13863
15002
|
}
|
|
15003
|
+
return cache2.get(key);
|
|
13864
15004
|
}
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
if (
|
|
13872
|
-
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
if (checked !== null) {
|
|
13878
|
-
return checked;
|
|
13879
|
-
}
|
|
15005
|
+
static fromManifest(manifest, opts = {}) {
|
|
15006
|
+
if (!manifest || typeof manifest !== "object") {
|
|
15007
|
+
return;
|
|
15008
|
+
}
|
|
15009
|
+
const r = manifest.repository;
|
|
15010
|
+
const rurl = r && (typeof r === "string" ? r : typeof r === "object" && typeof r.url === "string" ? r.url : null);
|
|
15011
|
+
if (!rurl) {
|
|
15012
|
+
throw new Error("no repository");
|
|
15013
|
+
}
|
|
15014
|
+
const info = rurl && _GitHost.fromUrl(rurl.replace(/^git\+/, ""), opts) || null;
|
|
15015
|
+
if (info) {
|
|
15016
|
+
return info;
|
|
13880
15017
|
}
|
|
15018
|
+
const unk = unknownHostedUrl(rurl);
|
|
15019
|
+
return _GitHost.fromUrl(unk, opts) || unk;
|
|
13881
15020
|
}
|
|
13882
|
-
|
|
13883
|
-
|
|
13884
|
-
module.exports = function(identifier, options) {
|
|
13885
|
-
options = options || {};
|
|
13886
|
-
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
13887
|
-
function postprocess(value) {
|
|
13888
|
-
return upgrade ? upgradeGPLs(value) : value;
|
|
15021
|
+
static parseUrl(url) {
|
|
15022
|
+
return parseUrl(url);
|
|
13889
15023
|
}
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
|
|
15024
|
+
#fill(template, opts) {
|
|
15025
|
+
if (typeof template !== "function") {
|
|
15026
|
+
return null;
|
|
15027
|
+
}
|
|
15028
|
+
const options = { ...this, ...this.opts, ...opts };
|
|
15029
|
+
if (!options.path) {
|
|
15030
|
+
options.path = "";
|
|
15031
|
+
}
|
|
15032
|
+
if (options.path.startsWith("/")) {
|
|
15033
|
+
options.path = options.path.slice(1);
|
|
15034
|
+
}
|
|
15035
|
+
if (options.noCommittish) {
|
|
15036
|
+
options.committish = null;
|
|
15037
|
+
}
|
|
15038
|
+
const result = template(options);
|
|
15039
|
+
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
13893
15040
|
}
|
|
13894
|
-
|
|
13895
|
-
|
|
13896
|
-
return postprocess(identifier);
|
|
15041
|
+
hash() {
|
|
15042
|
+
return this.committish ? `#${this.committish}` : "";
|
|
13897
15043
|
}
|
|
13898
|
-
|
|
13899
|
-
|
|
13900
|
-
return postprocess(noPlus);
|
|
15044
|
+
ssh(opts) {
|
|
15045
|
+
return this.#fill(this.sshtemplate, opts);
|
|
13901
15046
|
}
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
return postprocess(transformed);
|
|
15047
|
+
sshurl(opts) {
|
|
15048
|
+
return this.#fill(this.sshurltemplate, opts);
|
|
13905
15049
|
}
|
|
13906
|
-
|
|
13907
|
-
if (
|
|
13908
|
-
return
|
|
15050
|
+
browse(path26, ...args) {
|
|
15051
|
+
if (typeof path26 !== "string") {
|
|
15052
|
+
return this.#fill(this.browsetemplate, path26);
|
|
13909
15053
|
}
|
|
13910
|
-
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
return
|
|
15054
|
+
if (typeof args[0] !== "string") {
|
|
15055
|
+
return this.#fill(this.browsetreetemplate, { ...args[0], path: path26 });
|
|
15056
|
+
}
|
|
15057
|
+
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
13914
15058
|
}
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
15059
|
+
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
15060
|
+
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
15061
|
+
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
15062
|
+
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
15063
|
+
// does not redirect to a different commit.
|
|
15064
|
+
browseFile(path26, ...args) {
|
|
15065
|
+
if (typeof args[0] !== "string") {
|
|
15066
|
+
return this.#fill(this.browseblobtemplate, { ...args[0], path: path26 });
|
|
15067
|
+
}
|
|
15068
|
+
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path: path26 });
|
|
13918
15069
|
}
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
return postprocess(transformed);
|
|
15070
|
+
docs(opts) {
|
|
15071
|
+
return this.#fill(this.docstemplate, opts);
|
|
13922
15072
|
}
|
|
13923
|
-
|
|
13924
|
-
|
|
13925
|
-
function upgradeGPLs(value) {
|
|
13926
|
-
if ([
|
|
13927
|
-
"GPL-1.0",
|
|
13928
|
-
"LGPL-1.0",
|
|
13929
|
-
"AGPL-1.0",
|
|
13930
|
-
"GPL-2.0",
|
|
13931
|
-
"LGPL-2.0",
|
|
13932
|
-
"AGPL-2.0",
|
|
13933
|
-
"LGPL-2.1"
|
|
13934
|
-
].indexOf(value) !== -1) {
|
|
13935
|
-
return value + "-only";
|
|
13936
|
-
} else if ([
|
|
13937
|
-
"GPL-1.0+",
|
|
13938
|
-
"GPL-2.0+",
|
|
13939
|
-
"GPL-3.0+",
|
|
13940
|
-
"LGPL-2.0+",
|
|
13941
|
-
"LGPL-2.1+",
|
|
13942
|
-
"LGPL-3.0+",
|
|
13943
|
-
"AGPL-1.0+",
|
|
13944
|
-
"AGPL-3.0+"
|
|
13945
|
-
].indexOf(value) !== -1) {
|
|
13946
|
-
return value.replace(/\+$/, "-or-later");
|
|
13947
|
-
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
13948
|
-
return value + "-or-later";
|
|
13949
|
-
} else {
|
|
13950
|
-
return value;
|
|
15073
|
+
bugs(opts) {
|
|
15074
|
+
return this.#fill(this.bugstemplate, opts);
|
|
13951
15075
|
}
|
|
13952
|
-
|
|
13953
|
-
|
|
13954
|
-
});
|
|
13955
|
-
|
|
13956
|
-
// node_modules/validate-npm-package-license/index.js
|
|
13957
|
-
var require_validate_npm_package_license = __commonJS({
|
|
13958
|
-
"node_modules/validate-npm-package-license/index.js"(exports, module) {
|
|
13959
|
-
var parse2 = require_spdx_expression_parse();
|
|
13960
|
-
var correct = require_spdx_correct();
|
|
13961
|
-
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
13962
|
-
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
13963
|
-
function startsWith(prefix, string) {
|
|
13964
|
-
return string.slice(0, prefix.length) === prefix;
|
|
13965
|
-
}
|
|
13966
|
-
function usesLicenseRef(ast) {
|
|
13967
|
-
if (ast.hasOwnProperty("license")) {
|
|
13968
|
-
var license = ast.license;
|
|
13969
|
-
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
13970
|
-
} else {
|
|
13971
|
-
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
15076
|
+
https(opts) {
|
|
15077
|
+
return this.#fill(this.httpstemplate, opts);
|
|
13972
15078
|
}
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
var ast;
|
|
13976
|
-
try {
|
|
13977
|
-
ast = parse2(argument);
|
|
13978
|
-
} catch (e) {
|
|
13979
|
-
var match2;
|
|
13980
|
-
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
13981
|
-
return {
|
|
13982
|
-
validForOldPackages: true,
|
|
13983
|
-
validForNewPackages: true,
|
|
13984
|
-
unlicensed: true
|
|
13985
|
-
};
|
|
13986
|
-
} else if (match2 = fileReferenceRE.exec(argument)) {
|
|
13987
|
-
return {
|
|
13988
|
-
validForOldPackages: true,
|
|
13989
|
-
validForNewPackages: true,
|
|
13990
|
-
inFile: match2[1]
|
|
13991
|
-
};
|
|
13992
|
-
} else {
|
|
13993
|
-
var result = {
|
|
13994
|
-
validForOldPackages: false,
|
|
13995
|
-
validForNewPackages: false,
|
|
13996
|
-
warnings: [genericWarning]
|
|
13997
|
-
};
|
|
13998
|
-
if (argument.trim().length !== 0) {
|
|
13999
|
-
var corrected = correct(argument);
|
|
14000
|
-
if (corrected) {
|
|
14001
|
-
result.warnings.push(
|
|
14002
|
-
'license is similar to the valid expression "' + corrected + '"'
|
|
14003
|
-
);
|
|
14004
|
-
}
|
|
14005
|
-
}
|
|
14006
|
-
return result;
|
|
14007
|
-
}
|
|
15079
|
+
git(opts) {
|
|
15080
|
+
return this.#fill(this.gittemplate, opts);
|
|
14008
15081
|
}
|
|
14009
|
-
|
|
14010
|
-
return
|
|
14011
|
-
|
|
14012
|
-
|
|
14013
|
-
|
|
14014
|
-
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14021
|
-
|
|
15082
|
+
shortcut(opts) {
|
|
15083
|
+
return this.#fill(this.shortcuttemplate, opts);
|
|
15084
|
+
}
|
|
15085
|
+
path(opts) {
|
|
15086
|
+
return this.#fill(this.pathtemplate, opts);
|
|
15087
|
+
}
|
|
15088
|
+
tarball(opts) {
|
|
15089
|
+
return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false });
|
|
15090
|
+
}
|
|
15091
|
+
file(path26, opts) {
|
|
15092
|
+
return this.#fill(this.filetemplate, { ...opts, path: path26 });
|
|
15093
|
+
}
|
|
15094
|
+
edit(path26, opts) {
|
|
15095
|
+
return this.#fill(this.edittemplate, { ...opts, path: path26 });
|
|
15096
|
+
}
|
|
15097
|
+
getDefaultRepresentation() {
|
|
15098
|
+
return this.default;
|
|
15099
|
+
}
|
|
15100
|
+
toString(opts) {
|
|
15101
|
+
if (this.default && typeof this[this.default] === "function") {
|
|
15102
|
+
return this[this.default](opts);
|
|
15103
|
+
}
|
|
15104
|
+
return this.sshurl(opts);
|
|
14022
15105
|
}
|
|
14023
15106
|
};
|
|
15107
|
+
for (const [name, host] of Object.entries(hosts)) {
|
|
15108
|
+
GitHost.addHost(name, host);
|
|
15109
|
+
}
|
|
15110
|
+
module.exports = GitHost;
|
|
14024
15111
|
}
|
|
14025
15112
|
});
|
|
14026
15113
|
|
|
@@ -14088,7 +15175,7 @@ var require_fixer = __commonJS({
|
|
|
14088
15175
|
var isValidSemver = require_valid();
|
|
14089
15176
|
var cleanSemver = require_clean();
|
|
14090
15177
|
var validateLicense = require_validate_npm_package_license();
|
|
14091
|
-
var hostedGitInfo =
|
|
15178
|
+
var hostedGitInfo = require_lib6();
|
|
14092
15179
|
var { isBuiltin } = __require("node:module");
|
|
14093
15180
|
var depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
|
14094
15181
|
var extractDescription = require_extract_description();
|
|
@@ -28401,6 +29488,9 @@ var getCustomProtocol = (urlString) => {
|
|
|
28401
29488
|
try {
|
|
28402
29489
|
const { protocol } = new URL(urlString);
|
|
28403
29490
|
const hasAuthority = urlString.slice(0, protocol.length + 2).toLowerCase() === `${protocol}//`;
|
|
29491
|
+
if (protocol === "localhost:" && !hasAuthority && /^\d{1,5}([/?#]|$)/.test(urlString.slice(protocol.length))) {
|
|
29492
|
+
return void 0;
|
|
29493
|
+
}
|
|
28404
29494
|
if (protocol.endsWith(":") && (!protocol.includes(".") || hasAuthority) && !supportedProtocols.has(protocol)) {
|
|
28405
29495
|
return protocol;
|
|
28406
29496
|
}
|