@socketsecurity/lib 3.3.0 → 3.3.2
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/CHANGELOG.md +14 -0
- package/README.md +3 -2
- package/dist/agent.d.ts +0 -4
- package/dist/agent.js +3 -7
- package/dist/constants/node.js +1 -1
- package/dist/constants/packages.d.ts +7 -0
- package/dist/constants/packages.js +13 -6
- package/dist/constants/socket.d.ts +1 -0
- package/dist/constants/socket.js +3 -0
- package/dist/dlx-package.js +27 -0
- package/dist/env/ci.d.ts +1 -0
- package/dist/env/ci.js +1 -0
- package/dist/env/debug.d.ts +1 -0
- package/dist/env/debug.js +1 -0
- package/dist/env/github.d.ts +8 -0
- package/dist/env/github.js +8 -0
- package/dist/env/helpers.d.ts +3 -0
- package/dist/env/helpers.js +3 -0
- package/dist/env/home.d.ts +1 -0
- package/dist/env/home.js +1 -0
- package/dist/env/locale.d.ts +3 -0
- package/dist/env/locale.js +3 -0
- package/dist/env/node-auth-token.d.ts +1 -0
- package/dist/env/node-auth-token.js +1 -0
- package/dist/env/node-env.d.ts +1 -0
- package/dist/env/node-env.js +1 -0
- package/dist/env/npm.d.ts +5 -0
- package/dist/env/npm.js +5 -0
- package/dist/env/package-manager.d.ts +3 -0
- package/dist/env/package-manager.js +5 -2
- package/dist/env/path.d.ts +1 -0
- package/dist/env/path.js +1 -0
- package/dist/env/pre-commit.d.ts +1 -0
- package/dist/env/pre-commit.js +1 -0
- package/dist/env/shell.d.ts +1 -0
- package/dist/env/shell.js +1 -0
- package/dist/env/socket-cli-shadow.d.ts +5 -0
- package/dist/env/socket-cli-shadow.js +5 -0
- package/dist/env/socket-cli.d.ts +14 -0
- package/dist/env/socket-cli.js +14 -0
- package/dist/env/socket.d.ts +15 -0
- package/dist/env/socket.js +15 -0
- package/dist/env/temp-dir.d.ts +3 -0
- package/dist/env/temp-dir.js +3 -0
- package/dist/env/term.d.ts +1 -0
- package/dist/env/term.js +1 -0
- package/dist/env/test.d.ts +3 -0
- package/dist/env/test.js +4 -1
- package/dist/env/windows.d.ts +4 -0
- package/dist/env/windows.js +4 -0
- package/dist/env/xdg.d.ts +3 -0
- package/dist/env/xdg.js +3 -0
- package/dist/external/@inquirer/checkbox.js +3361 -3
- package/dist/external/@inquirer/confirm.js +1 -0
- package/dist/external/@inquirer/input.js +1 -0
- package/dist/external/@inquirer/password.js +1 -0
- package/dist/external/@inquirer/search.js +1 -0
- package/dist/external/@inquirer/select.js +1 -0
- package/dist/external/@npmcli/arborist.js +5 -0
- package/dist/external/@yarnpkg/extensions.js +2 -2
- package/dist/external/cacache.js +4 -13036
- package/dist/external/libnpmpack.js +4 -67685
- package/dist/external/make-fetch-happen.js +4 -22639
- package/dist/external/normalize-package-data.js +4 -4478
- package/dist/external/npm-core.js +6588 -0
- package/dist/external/npm-pack.js +87518 -0
- package/dist/external/npm-package-arg.js +4 -4515
- package/dist/external/pacote.js +4 -50314
- package/dist/external/semver.js +4 -1934
- package/dist/fs.d.ts +0 -6
- package/dist/fs.js +0 -6
- package/dist/lifecycle-script-names.d.ts +1 -2
- package/dist/lifecycle-script-names.js +2 -4
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +4 -1
- package/dist/maintained-node-versions.d.ts +1 -2
- package/dist/maintained-node-versions.js +2 -4
- package/dist/package-default-node-range.d.ts +1 -2
- package/dist/package-default-node-range.js +3 -5
- package/dist/package-default-socket-categories.d.ts +1 -2
- package/dist/package-default-socket-categories.js +2 -4
- package/dist/package-extensions.d.ts +1 -2
- package/dist/package-extensions.js +2 -4
- package/dist/path.d.ts +11 -0
- package/dist/stdio/prompts.d.ts +17 -0
- package/dist/stdio/prompts.js +10 -11
- package/package.json +78 -73
- package/dist/external/@inquirer/core.js +0 -4
- package/dist/external/@inquirer/prompts.js +0 -4
|
@@ -1,4479 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Bundled from normalize-package-data
|
|
4
|
-
* This is a zero-dependency bundle created by esbuild.
|
|
5
|
-
*/
|
|
6
|
-
"use strict";
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
1
|
+
'use strict'
|
|
13
2
|
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"use strict";
|
|
18
|
-
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => void 0 : () => {
|
|
19
|
-
};
|
|
20
|
-
module2.exports = debug;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js
|
|
25
|
-
var require_constants = __commonJS({
|
|
26
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/constants.js"(exports2, module2) {
|
|
27
|
-
"use strict";
|
|
28
|
-
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
29
|
-
var MAX_LENGTH = 256;
|
|
30
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
31
|
-
9007199254740991;
|
|
32
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
33
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
34
|
-
var RELEASE_TYPES = [
|
|
35
|
-
"major",
|
|
36
|
-
"premajor",
|
|
37
|
-
"minor",
|
|
38
|
-
"preminor",
|
|
39
|
-
"patch",
|
|
40
|
-
"prepatch",
|
|
41
|
-
"prerelease"
|
|
42
|
-
];
|
|
43
|
-
module2.exports = {
|
|
44
|
-
MAX_LENGTH,
|
|
45
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
46
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
47
|
-
MAX_SAFE_INTEGER,
|
|
48
|
-
RELEASE_TYPES,
|
|
49
|
-
SEMVER_SPEC_VERSION,
|
|
50
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
51
|
-
FLAG_LOOSE: 2
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js
|
|
57
|
-
var require_re = __commonJS({
|
|
58
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/re.js"(exports2, module2) {
|
|
59
|
-
"use strict";
|
|
60
|
-
var {
|
|
61
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
|
62
|
-
MAX_SAFE_BUILD_LENGTH,
|
|
63
|
-
MAX_LENGTH
|
|
64
|
-
} = require_constants();
|
|
65
|
-
var debug = require_debug();
|
|
66
|
-
exports2 = module2.exports = {};
|
|
67
|
-
var re = exports2.re = [];
|
|
68
|
-
var safeRe = exports2.safeRe = [];
|
|
69
|
-
var src = exports2.src = [];
|
|
70
|
-
var safeSrc = exports2.safeSrc = [];
|
|
71
|
-
var t = exports2.t = {};
|
|
72
|
-
var R = 0;
|
|
73
|
-
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
74
|
-
var safeRegexReplacements = [
|
|
75
|
-
["\\s", 1],
|
|
76
|
-
["\\d", MAX_LENGTH],
|
|
77
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
78
|
-
];
|
|
79
|
-
var makeSafeRegex = /* @__PURE__ */ __name((value) => {
|
|
80
|
-
for (const [token, max] of safeRegexReplacements) {
|
|
81
|
-
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
82
|
-
}
|
|
83
|
-
return value;
|
|
84
|
-
}, "makeSafeRegex");
|
|
85
|
-
var createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
|
|
86
|
-
const safe = makeSafeRegex(value);
|
|
87
|
-
const index = R++;
|
|
88
|
-
debug(name, index, value);
|
|
89
|
-
t[name] = index;
|
|
90
|
-
src[index] = value;
|
|
91
|
-
safeSrc[index] = safe;
|
|
92
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
93
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
94
|
-
}, "createToken");
|
|
95
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
96
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
97
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
98
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
99
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
100
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
101
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
102
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
103
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
104
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
105
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
106
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
107
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
108
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
109
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
110
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
|
111
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
112
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
113
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
114
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
115
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
116
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
117
|
-
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
118
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
119
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
120
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
|
121
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
122
|
-
createToken("LONETILDE", "(?:~>?)");
|
|
123
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
124
|
-
exports2.tildeTrimReplace = "$1~";
|
|
125
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
126
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
127
|
-
createToken("LONECARET", "(?:\\^)");
|
|
128
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
129
|
-
exports2.caretTrimReplace = "$1^";
|
|
130
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
131
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
132
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
133
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
134
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
135
|
-
exports2.comparatorTrimReplace = "$1$2$3";
|
|
136
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
137
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
138
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
139
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
140
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js
|
|
145
|
-
var require_parse_options = __commonJS({
|
|
146
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/parse-options.js"(exports2, module2) {
|
|
147
|
-
"use strict";
|
|
148
|
-
var looseOption = Object.freeze({ loose: true });
|
|
149
|
-
var emptyOpts = Object.freeze({});
|
|
150
|
-
var parseOptions = /* @__PURE__ */ __name((options) => {
|
|
151
|
-
if (!options) {
|
|
152
|
-
return emptyOpts;
|
|
153
|
-
}
|
|
154
|
-
if (typeof options !== "object") {
|
|
155
|
-
return looseOption;
|
|
156
|
-
}
|
|
157
|
-
return options;
|
|
158
|
-
}, "parseOptions");
|
|
159
|
-
module2.exports = parseOptions;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js
|
|
164
|
-
var require_identifiers = __commonJS({
|
|
165
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
166
|
-
"use strict";
|
|
167
|
-
var numeric = /^[0-9]+$/;
|
|
168
|
-
var compareIdentifiers = /* @__PURE__ */ __name((a, b) => {
|
|
169
|
-
const anum = numeric.test(a);
|
|
170
|
-
const bnum = numeric.test(b);
|
|
171
|
-
if (anum && bnum) {
|
|
172
|
-
a = +a;
|
|
173
|
-
b = +b;
|
|
174
|
-
}
|
|
175
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
176
|
-
}, "compareIdentifiers");
|
|
177
|
-
var rcompareIdentifiers = /* @__PURE__ */ __name((a, b) => compareIdentifiers(b, a), "rcompareIdentifiers");
|
|
178
|
-
module2.exports = {
|
|
179
|
-
compareIdentifiers,
|
|
180
|
-
rcompareIdentifiers
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js
|
|
186
|
-
var require_semver = __commonJS({
|
|
187
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/semver.js"(exports2, module2) {
|
|
188
|
-
"use strict";
|
|
189
|
-
var debug = require_debug();
|
|
190
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
191
|
-
var { safeRe: re, t } = require_re();
|
|
192
|
-
var parseOptions = require_parse_options();
|
|
193
|
-
var { compareIdentifiers } = require_identifiers();
|
|
194
|
-
var SemVer = class _SemVer {
|
|
195
|
-
static {
|
|
196
|
-
__name(this, "SemVer");
|
|
197
|
-
}
|
|
198
|
-
constructor(version, options) {
|
|
199
|
-
options = parseOptions(options);
|
|
200
|
-
if (version instanceof _SemVer) {
|
|
201
|
-
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
202
|
-
return version;
|
|
203
|
-
} else {
|
|
204
|
-
version = version.version;
|
|
205
|
-
}
|
|
206
|
-
} else if (typeof version !== "string") {
|
|
207
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
208
|
-
}
|
|
209
|
-
if (version.length > MAX_LENGTH) {
|
|
210
|
-
throw new TypeError(
|
|
211
|
-
`version is longer than ${MAX_LENGTH} characters`
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
debug("SemVer", version, options);
|
|
215
|
-
this.options = options;
|
|
216
|
-
this.loose = !!options.loose;
|
|
217
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
218
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
219
|
-
if (!m) {
|
|
220
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
|
221
|
-
}
|
|
222
|
-
this.raw = version;
|
|
223
|
-
this.major = +m[1];
|
|
224
|
-
this.minor = +m[2];
|
|
225
|
-
this.patch = +m[3];
|
|
226
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
227
|
-
throw new TypeError("Invalid major version");
|
|
228
|
-
}
|
|
229
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
230
|
-
throw new TypeError("Invalid minor version");
|
|
231
|
-
}
|
|
232
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
233
|
-
throw new TypeError("Invalid patch version");
|
|
234
|
-
}
|
|
235
|
-
if (!m[4]) {
|
|
236
|
-
this.prerelease = [];
|
|
237
|
-
} else {
|
|
238
|
-
this.prerelease = m[4].split(".").map((id) => {
|
|
239
|
-
if (/^[0-9]+$/.test(id)) {
|
|
240
|
-
const num = +id;
|
|
241
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
242
|
-
return num;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
return id;
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
249
|
-
this.format();
|
|
250
|
-
}
|
|
251
|
-
format() {
|
|
252
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
253
|
-
if (this.prerelease.length) {
|
|
254
|
-
this.version += `-${this.prerelease.join(".")}`;
|
|
255
|
-
}
|
|
256
|
-
return this.version;
|
|
257
|
-
}
|
|
258
|
-
toString() {
|
|
259
|
-
return this.version;
|
|
260
|
-
}
|
|
261
|
-
compare(other) {
|
|
262
|
-
debug("SemVer.compare", this.version, this.options, other);
|
|
263
|
-
if (!(other instanceof _SemVer)) {
|
|
264
|
-
if (typeof other === "string" && other === this.version) {
|
|
265
|
-
return 0;
|
|
266
|
-
}
|
|
267
|
-
other = new _SemVer(other, this.options);
|
|
268
|
-
}
|
|
269
|
-
if (other.version === this.version) {
|
|
270
|
-
return 0;
|
|
271
|
-
}
|
|
272
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
273
|
-
}
|
|
274
|
-
compareMain(other) {
|
|
275
|
-
if (!(other instanceof _SemVer)) {
|
|
276
|
-
other = new _SemVer(other, this.options);
|
|
277
|
-
}
|
|
278
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
279
|
-
}
|
|
280
|
-
comparePre(other) {
|
|
281
|
-
if (!(other instanceof _SemVer)) {
|
|
282
|
-
other = new _SemVer(other, this.options);
|
|
283
|
-
}
|
|
284
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
|
285
|
-
return -1;
|
|
286
|
-
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
287
|
-
return 1;
|
|
288
|
-
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
289
|
-
return 0;
|
|
290
|
-
}
|
|
291
|
-
let i = 0;
|
|
292
|
-
do {
|
|
293
|
-
const a = this.prerelease[i];
|
|
294
|
-
const b = other.prerelease[i];
|
|
295
|
-
debug("prerelease compare", i, a, b);
|
|
296
|
-
if (a === void 0 && b === void 0) {
|
|
297
|
-
return 0;
|
|
298
|
-
} else if (b === void 0) {
|
|
299
|
-
return 1;
|
|
300
|
-
} else if (a === void 0) {
|
|
301
|
-
return -1;
|
|
302
|
-
} else if (a === b) {
|
|
303
|
-
continue;
|
|
304
|
-
} else {
|
|
305
|
-
return compareIdentifiers(a, b);
|
|
306
|
-
}
|
|
307
|
-
} while (++i);
|
|
308
|
-
}
|
|
309
|
-
compareBuild(other) {
|
|
310
|
-
if (!(other instanceof _SemVer)) {
|
|
311
|
-
other = new _SemVer(other, this.options);
|
|
312
|
-
}
|
|
313
|
-
let i = 0;
|
|
314
|
-
do {
|
|
315
|
-
const a = this.build[i];
|
|
316
|
-
const b = other.build[i];
|
|
317
|
-
debug("build compare", i, a, b);
|
|
318
|
-
if (a === void 0 && b === void 0) {
|
|
319
|
-
return 0;
|
|
320
|
-
} else if (b === void 0) {
|
|
321
|
-
return 1;
|
|
322
|
-
} else if (a === void 0) {
|
|
323
|
-
return -1;
|
|
324
|
-
} else if (a === b) {
|
|
325
|
-
continue;
|
|
326
|
-
} else {
|
|
327
|
-
return compareIdentifiers(a, b);
|
|
328
|
-
}
|
|
329
|
-
} while (++i);
|
|
330
|
-
}
|
|
331
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
332
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
333
|
-
inc(release, identifier, identifierBase) {
|
|
334
|
-
if (release.startsWith("pre")) {
|
|
335
|
-
if (!identifier && identifierBase === false) {
|
|
336
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
337
|
-
}
|
|
338
|
-
if (identifier) {
|
|
339
|
-
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
340
|
-
if (!match || match[1] !== identifier) {
|
|
341
|
-
throw new Error(`invalid identifier: ${identifier}`);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
switch (release) {
|
|
346
|
-
case "premajor":
|
|
347
|
-
this.prerelease.length = 0;
|
|
348
|
-
this.patch = 0;
|
|
349
|
-
this.minor = 0;
|
|
350
|
-
this.major++;
|
|
351
|
-
this.inc("pre", identifier, identifierBase);
|
|
352
|
-
break;
|
|
353
|
-
case "preminor":
|
|
354
|
-
this.prerelease.length = 0;
|
|
355
|
-
this.patch = 0;
|
|
356
|
-
this.minor++;
|
|
357
|
-
this.inc("pre", identifier, identifierBase);
|
|
358
|
-
break;
|
|
359
|
-
case "prepatch":
|
|
360
|
-
this.prerelease.length = 0;
|
|
361
|
-
this.inc("patch", identifier, identifierBase);
|
|
362
|
-
this.inc("pre", identifier, identifierBase);
|
|
363
|
-
break;
|
|
364
|
-
// If the input is a non-prerelease version, this acts the same as
|
|
365
|
-
// prepatch.
|
|
366
|
-
case "prerelease":
|
|
367
|
-
if (this.prerelease.length === 0) {
|
|
368
|
-
this.inc("patch", identifier, identifierBase);
|
|
369
|
-
}
|
|
370
|
-
this.inc("pre", identifier, identifierBase);
|
|
371
|
-
break;
|
|
372
|
-
case "release":
|
|
373
|
-
if (this.prerelease.length === 0) {
|
|
374
|
-
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
375
|
-
}
|
|
376
|
-
this.prerelease.length = 0;
|
|
377
|
-
break;
|
|
378
|
-
case "major":
|
|
379
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
380
|
-
this.major++;
|
|
381
|
-
}
|
|
382
|
-
this.minor = 0;
|
|
383
|
-
this.patch = 0;
|
|
384
|
-
this.prerelease = [];
|
|
385
|
-
break;
|
|
386
|
-
case "minor":
|
|
387
|
-
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
388
|
-
this.minor++;
|
|
389
|
-
}
|
|
390
|
-
this.patch = 0;
|
|
391
|
-
this.prerelease = [];
|
|
392
|
-
break;
|
|
393
|
-
case "patch":
|
|
394
|
-
if (this.prerelease.length === 0) {
|
|
395
|
-
this.patch++;
|
|
396
|
-
}
|
|
397
|
-
this.prerelease = [];
|
|
398
|
-
break;
|
|
399
|
-
// This probably shouldn't be used publicly.
|
|
400
|
-
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
401
|
-
case "pre": {
|
|
402
|
-
const base = Number(identifierBase) ? 1 : 0;
|
|
403
|
-
if (this.prerelease.length === 0) {
|
|
404
|
-
this.prerelease = [base];
|
|
405
|
-
} else {
|
|
406
|
-
let i = this.prerelease.length;
|
|
407
|
-
while (--i >= 0) {
|
|
408
|
-
if (typeof this.prerelease[i] === "number") {
|
|
409
|
-
this.prerelease[i]++;
|
|
410
|
-
i = -2;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
if (i === -1) {
|
|
414
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
415
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
416
|
-
}
|
|
417
|
-
this.prerelease.push(base);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
if (identifier) {
|
|
421
|
-
let prerelease = [identifier, base];
|
|
422
|
-
if (identifierBase === false) {
|
|
423
|
-
prerelease = [identifier];
|
|
424
|
-
}
|
|
425
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
426
|
-
if (isNaN(this.prerelease[1])) {
|
|
427
|
-
this.prerelease = prerelease;
|
|
428
|
-
}
|
|
429
|
-
} else {
|
|
430
|
-
this.prerelease = prerelease;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
break;
|
|
434
|
-
}
|
|
435
|
-
default:
|
|
436
|
-
throw new Error(`invalid increment argument: ${release}`);
|
|
437
|
-
}
|
|
438
|
-
this.raw = this.format();
|
|
439
|
-
if (this.build.length) {
|
|
440
|
-
this.raw += `+${this.build.join(".")}`;
|
|
441
|
-
}
|
|
442
|
-
return this;
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
|
-
module2.exports = SemVer;
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js
|
|
450
|
-
var require_parse = __commonJS({
|
|
451
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
452
|
-
"use strict";
|
|
453
|
-
var SemVer = require_semver();
|
|
454
|
-
var parse = /* @__PURE__ */ __name((version, options, throwErrors = false) => {
|
|
455
|
-
if (version instanceof SemVer) {
|
|
456
|
-
return version;
|
|
457
|
-
}
|
|
458
|
-
try {
|
|
459
|
-
return new SemVer(version, options);
|
|
460
|
-
} catch (er) {
|
|
461
|
-
if (!throwErrors) {
|
|
462
|
-
return null;
|
|
463
|
-
}
|
|
464
|
-
throw er;
|
|
465
|
-
}
|
|
466
|
-
}, "parse");
|
|
467
|
-
module2.exports = parse;
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
|
|
471
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js
|
|
472
|
-
var require_valid = __commonJS({
|
|
473
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
474
|
-
"use strict";
|
|
475
|
-
var parse = require_parse();
|
|
476
|
-
var valid = /* @__PURE__ */ __name((version, options) => {
|
|
477
|
-
const v = parse(version, options);
|
|
478
|
-
return v ? v.version : null;
|
|
479
|
-
}, "valid");
|
|
480
|
-
module2.exports = valid;
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
// node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js
|
|
485
|
-
var require_clean = __commonJS({
|
|
486
|
-
"node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
487
|
-
"use strict";
|
|
488
|
-
var parse = require_parse();
|
|
489
|
-
var clean = /* @__PURE__ */ __name((version, options) => {
|
|
490
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
491
|
-
return s ? s.version : null;
|
|
492
|
-
}, "clean");
|
|
493
|
-
module2.exports = clean;
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
// node_modules/.pnpm/spdx-license-ids@3.0.22/node_modules/spdx-license-ids/index.json
|
|
498
|
-
var require_spdx_license_ids = __commonJS({
|
|
499
|
-
"node_modules/.pnpm/spdx-license-ids@3.0.22/node_modules/spdx-license-ids/index.json"(exports2, module2) {
|
|
500
|
-
module2.exports = [
|
|
501
|
-
"0BSD",
|
|
502
|
-
"3D-Slicer-1.0",
|
|
503
|
-
"AAL",
|
|
504
|
-
"ADSL",
|
|
505
|
-
"AFL-1.1",
|
|
506
|
-
"AFL-1.2",
|
|
507
|
-
"AFL-2.0",
|
|
508
|
-
"AFL-2.1",
|
|
509
|
-
"AFL-3.0",
|
|
510
|
-
"AGPL-1.0-only",
|
|
511
|
-
"AGPL-1.0-or-later",
|
|
512
|
-
"AGPL-3.0-only",
|
|
513
|
-
"AGPL-3.0-or-later",
|
|
514
|
-
"AMD-newlib",
|
|
515
|
-
"AMDPLPA",
|
|
516
|
-
"AML",
|
|
517
|
-
"AML-glslang",
|
|
518
|
-
"AMPAS",
|
|
519
|
-
"ANTLR-PD",
|
|
520
|
-
"ANTLR-PD-fallback",
|
|
521
|
-
"APAFML",
|
|
522
|
-
"APL-1.0",
|
|
523
|
-
"APSL-1.0",
|
|
524
|
-
"APSL-1.1",
|
|
525
|
-
"APSL-1.2",
|
|
526
|
-
"APSL-2.0",
|
|
527
|
-
"ASWF-Digital-Assets-1.0",
|
|
528
|
-
"ASWF-Digital-Assets-1.1",
|
|
529
|
-
"Abstyles",
|
|
530
|
-
"AdaCore-doc",
|
|
531
|
-
"Adobe-2006",
|
|
532
|
-
"Adobe-Display-PostScript",
|
|
533
|
-
"Adobe-Glyph",
|
|
534
|
-
"Adobe-Utopia",
|
|
535
|
-
"Afmparse",
|
|
536
|
-
"Aladdin",
|
|
537
|
-
"Apache-1.0",
|
|
538
|
-
"Apache-1.1",
|
|
539
|
-
"Apache-2.0",
|
|
540
|
-
"App-s2p",
|
|
541
|
-
"Arphic-1999",
|
|
542
|
-
"Artistic-1.0",
|
|
543
|
-
"Artistic-1.0-Perl",
|
|
544
|
-
"Artistic-1.0-cl8",
|
|
545
|
-
"Artistic-2.0",
|
|
546
|
-
"Artistic-dist",
|
|
547
|
-
"Aspell-RU",
|
|
548
|
-
"BSD-1-Clause",
|
|
549
|
-
"BSD-2-Clause",
|
|
550
|
-
"BSD-2-Clause-Darwin",
|
|
551
|
-
"BSD-2-Clause-Patent",
|
|
552
|
-
"BSD-2-Clause-Views",
|
|
553
|
-
"BSD-2-Clause-first-lines",
|
|
554
|
-
"BSD-2-Clause-pkgconf-disclaimer",
|
|
555
|
-
"BSD-3-Clause",
|
|
556
|
-
"BSD-3-Clause-Attribution",
|
|
557
|
-
"BSD-3-Clause-Clear",
|
|
558
|
-
"BSD-3-Clause-HP",
|
|
559
|
-
"BSD-3-Clause-LBNL",
|
|
560
|
-
"BSD-3-Clause-Modification",
|
|
561
|
-
"BSD-3-Clause-No-Military-License",
|
|
562
|
-
"BSD-3-Clause-No-Nuclear-License",
|
|
563
|
-
"BSD-3-Clause-No-Nuclear-License-2014",
|
|
564
|
-
"BSD-3-Clause-No-Nuclear-Warranty",
|
|
565
|
-
"BSD-3-Clause-Open-MPI",
|
|
566
|
-
"BSD-3-Clause-Sun",
|
|
567
|
-
"BSD-3-Clause-acpica",
|
|
568
|
-
"BSD-3-Clause-flex",
|
|
569
|
-
"BSD-4-Clause",
|
|
570
|
-
"BSD-4-Clause-Shortened",
|
|
571
|
-
"BSD-4-Clause-UC",
|
|
572
|
-
"BSD-4.3RENO",
|
|
573
|
-
"BSD-4.3TAHOE",
|
|
574
|
-
"BSD-Advertising-Acknowledgement",
|
|
575
|
-
"BSD-Attribution-HPND-disclaimer",
|
|
576
|
-
"BSD-Inferno-Nettverk",
|
|
577
|
-
"BSD-Protection",
|
|
578
|
-
"BSD-Source-Code",
|
|
579
|
-
"BSD-Source-beginning-file",
|
|
580
|
-
"BSD-Systemics",
|
|
581
|
-
"BSD-Systemics-W3Works",
|
|
582
|
-
"BSL-1.0",
|
|
583
|
-
"BUSL-1.1",
|
|
584
|
-
"Baekmuk",
|
|
585
|
-
"Bahyph",
|
|
586
|
-
"Barr",
|
|
587
|
-
"Beerware",
|
|
588
|
-
"BitTorrent-1.0",
|
|
589
|
-
"BitTorrent-1.1",
|
|
590
|
-
"Bitstream-Charter",
|
|
591
|
-
"Bitstream-Vera",
|
|
592
|
-
"BlueOak-1.0.0",
|
|
593
|
-
"Boehm-GC",
|
|
594
|
-
"Boehm-GC-without-fee",
|
|
595
|
-
"Borceux",
|
|
596
|
-
"Brian-Gladman-2-Clause",
|
|
597
|
-
"Brian-Gladman-3-Clause",
|
|
598
|
-
"C-UDA-1.0",
|
|
599
|
-
"CAL-1.0",
|
|
600
|
-
"CAL-1.0-Combined-Work-Exception",
|
|
601
|
-
"CATOSL-1.1",
|
|
602
|
-
"CC-BY-1.0",
|
|
603
|
-
"CC-BY-2.0",
|
|
604
|
-
"CC-BY-2.5",
|
|
605
|
-
"CC-BY-2.5-AU",
|
|
606
|
-
"CC-BY-3.0",
|
|
607
|
-
"CC-BY-3.0-AT",
|
|
608
|
-
"CC-BY-3.0-AU",
|
|
609
|
-
"CC-BY-3.0-DE",
|
|
610
|
-
"CC-BY-3.0-IGO",
|
|
611
|
-
"CC-BY-3.0-NL",
|
|
612
|
-
"CC-BY-3.0-US",
|
|
613
|
-
"CC-BY-4.0",
|
|
614
|
-
"CC-BY-NC-1.0",
|
|
615
|
-
"CC-BY-NC-2.0",
|
|
616
|
-
"CC-BY-NC-2.5",
|
|
617
|
-
"CC-BY-NC-3.0",
|
|
618
|
-
"CC-BY-NC-3.0-DE",
|
|
619
|
-
"CC-BY-NC-4.0",
|
|
620
|
-
"CC-BY-NC-ND-1.0",
|
|
621
|
-
"CC-BY-NC-ND-2.0",
|
|
622
|
-
"CC-BY-NC-ND-2.5",
|
|
623
|
-
"CC-BY-NC-ND-3.0",
|
|
624
|
-
"CC-BY-NC-ND-3.0-DE",
|
|
625
|
-
"CC-BY-NC-ND-3.0-IGO",
|
|
626
|
-
"CC-BY-NC-ND-4.0",
|
|
627
|
-
"CC-BY-NC-SA-1.0",
|
|
628
|
-
"CC-BY-NC-SA-2.0",
|
|
629
|
-
"CC-BY-NC-SA-2.0-DE",
|
|
630
|
-
"CC-BY-NC-SA-2.0-FR",
|
|
631
|
-
"CC-BY-NC-SA-2.0-UK",
|
|
632
|
-
"CC-BY-NC-SA-2.5",
|
|
633
|
-
"CC-BY-NC-SA-3.0",
|
|
634
|
-
"CC-BY-NC-SA-3.0-DE",
|
|
635
|
-
"CC-BY-NC-SA-3.0-IGO",
|
|
636
|
-
"CC-BY-NC-SA-4.0",
|
|
637
|
-
"CC-BY-ND-1.0",
|
|
638
|
-
"CC-BY-ND-2.0",
|
|
639
|
-
"CC-BY-ND-2.5",
|
|
640
|
-
"CC-BY-ND-3.0",
|
|
641
|
-
"CC-BY-ND-3.0-DE",
|
|
642
|
-
"CC-BY-ND-4.0",
|
|
643
|
-
"CC-BY-SA-1.0",
|
|
644
|
-
"CC-BY-SA-2.0",
|
|
645
|
-
"CC-BY-SA-2.0-UK",
|
|
646
|
-
"CC-BY-SA-2.1-JP",
|
|
647
|
-
"CC-BY-SA-2.5",
|
|
648
|
-
"CC-BY-SA-3.0",
|
|
649
|
-
"CC-BY-SA-3.0-AT",
|
|
650
|
-
"CC-BY-SA-3.0-DE",
|
|
651
|
-
"CC-BY-SA-3.0-IGO",
|
|
652
|
-
"CC-BY-SA-4.0",
|
|
653
|
-
"CC-PDDC",
|
|
654
|
-
"CC-PDM-1.0",
|
|
655
|
-
"CC-SA-1.0",
|
|
656
|
-
"CC0-1.0",
|
|
657
|
-
"CDDL-1.0",
|
|
658
|
-
"CDDL-1.1",
|
|
659
|
-
"CDL-1.0",
|
|
660
|
-
"CDLA-Permissive-1.0",
|
|
661
|
-
"CDLA-Permissive-2.0",
|
|
662
|
-
"CDLA-Sharing-1.0",
|
|
663
|
-
"CECILL-1.0",
|
|
664
|
-
"CECILL-1.1",
|
|
665
|
-
"CECILL-2.0",
|
|
666
|
-
"CECILL-2.1",
|
|
667
|
-
"CECILL-B",
|
|
668
|
-
"CECILL-C",
|
|
669
|
-
"CERN-OHL-1.1",
|
|
670
|
-
"CERN-OHL-1.2",
|
|
671
|
-
"CERN-OHL-P-2.0",
|
|
672
|
-
"CERN-OHL-S-2.0",
|
|
673
|
-
"CERN-OHL-W-2.0",
|
|
674
|
-
"CFITSIO",
|
|
675
|
-
"CMU-Mach",
|
|
676
|
-
"CMU-Mach-nodoc",
|
|
677
|
-
"CNRI-Jython",
|
|
678
|
-
"CNRI-Python",
|
|
679
|
-
"CNRI-Python-GPL-Compatible",
|
|
680
|
-
"COIL-1.0",
|
|
681
|
-
"CPAL-1.0",
|
|
682
|
-
"CPL-1.0",
|
|
683
|
-
"CPOL-1.02",
|
|
684
|
-
"CUA-OPL-1.0",
|
|
685
|
-
"Caldera",
|
|
686
|
-
"Caldera-no-preamble",
|
|
687
|
-
"Catharon",
|
|
688
|
-
"ClArtistic",
|
|
689
|
-
"Clips",
|
|
690
|
-
"Community-Spec-1.0",
|
|
691
|
-
"Condor-1.1",
|
|
692
|
-
"Cornell-Lossless-JPEG",
|
|
693
|
-
"Cronyx",
|
|
694
|
-
"Crossword",
|
|
695
|
-
"CryptoSwift",
|
|
696
|
-
"CrystalStacker",
|
|
697
|
-
"Cube",
|
|
698
|
-
"D-FSL-1.0",
|
|
699
|
-
"DEC-3-Clause",
|
|
700
|
-
"DL-DE-BY-2.0",
|
|
701
|
-
"DL-DE-ZERO-2.0",
|
|
702
|
-
"DOC",
|
|
703
|
-
"DRL-1.0",
|
|
704
|
-
"DRL-1.1",
|
|
705
|
-
"DSDP",
|
|
706
|
-
"DocBook-DTD",
|
|
707
|
-
"DocBook-Schema",
|
|
708
|
-
"DocBook-Stylesheet",
|
|
709
|
-
"DocBook-XML",
|
|
710
|
-
"Dotseqn",
|
|
711
|
-
"ECL-1.0",
|
|
712
|
-
"ECL-2.0",
|
|
713
|
-
"EFL-1.0",
|
|
714
|
-
"EFL-2.0",
|
|
715
|
-
"EPICS",
|
|
716
|
-
"EPL-1.0",
|
|
717
|
-
"EPL-2.0",
|
|
718
|
-
"EUDatagrid",
|
|
719
|
-
"EUPL-1.0",
|
|
720
|
-
"EUPL-1.1",
|
|
721
|
-
"EUPL-1.2",
|
|
722
|
-
"Elastic-2.0",
|
|
723
|
-
"Entessa",
|
|
724
|
-
"ErlPL-1.1",
|
|
725
|
-
"Eurosym",
|
|
726
|
-
"FBM",
|
|
727
|
-
"FDK-AAC",
|
|
728
|
-
"FSFAP",
|
|
729
|
-
"FSFAP-no-warranty-disclaimer",
|
|
730
|
-
"FSFUL",
|
|
731
|
-
"FSFULLR",
|
|
732
|
-
"FSFULLRSD",
|
|
733
|
-
"FSFULLRWD",
|
|
734
|
-
"FSL-1.1-ALv2",
|
|
735
|
-
"FSL-1.1-MIT",
|
|
736
|
-
"FTL",
|
|
737
|
-
"Fair",
|
|
738
|
-
"Ferguson-Twofish",
|
|
739
|
-
"Frameworx-1.0",
|
|
740
|
-
"FreeBSD-DOC",
|
|
741
|
-
"FreeImage",
|
|
742
|
-
"Furuseth",
|
|
743
|
-
"GCR-docs",
|
|
744
|
-
"GD",
|
|
745
|
-
"GFDL-1.1-invariants-only",
|
|
746
|
-
"GFDL-1.1-invariants-or-later",
|
|
747
|
-
"GFDL-1.1-no-invariants-only",
|
|
748
|
-
"GFDL-1.1-no-invariants-or-later",
|
|
749
|
-
"GFDL-1.1-only",
|
|
750
|
-
"GFDL-1.1-or-later",
|
|
751
|
-
"GFDL-1.2-invariants-only",
|
|
752
|
-
"GFDL-1.2-invariants-or-later",
|
|
753
|
-
"GFDL-1.2-no-invariants-only",
|
|
754
|
-
"GFDL-1.2-no-invariants-or-later",
|
|
755
|
-
"GFDL-1.2-only",
|
|
756
|
-
"GFDL-1.2-or-later",
|
|
757
|
-
"GFDL-1.3-invariants-only",
|
|
758
|
-
"GFDL-1.3-invariants-or-later",
|
|
759
|
-
"GFDL-1.3-no-invariants-only",
|
|
760
|
-
"GFDL-1.3-no-invariants-or-later",
|
|
761
|
-
"GFDL-1.3-only",
|
|
762
|
-
"GFDL-1.3-or-later",
|
|
763
|
-
"GL2PS",
|
|
764
|
-
"GLWTPL",
|
|
765
|
-
"GPL-1.0-only",
|
|
766
|
-
"GPL-1.0-or-later",
|
|
767
|
-
"GPL-2.0-only",
|
|
768
|
-
"GPL-2.0-or-later",
|
|
769
|
-
"GPL-3.0-only",
|
|
770
|
-
"GPL-3.0-or-later",
|
|
771
|
-
"Game-Programming-Gems",
|
|
772
|
-
"Giftware",
|
|
773
|
-
"Glide",
|
|
774
|
-
"Glulxe",
|
|
775
|
-
"Graphics-Gems",
|
|
776
|
-
"Gutmann",
|
|
777
|
-
"HDF5",
|
|
778
|
-
"HIDAPI",
|
|
779
|
-
"HP-1986",
|
|
780
|
-
"HP-1989",
|
|
781
|
-
"HPND",
|
|
782
|
-
"HPND-DEC",
|
|
783
|
-
"HPND-Fenneberg-Livingston",
|
|
784
|
-
"HPND-INRIA-IMAG",
|
|
785
|
-
"HPND-Intel",
|
|
786
|
-
"HPND-Kevlin-Henney",
|
|
787
|
-
"HPND-MIT-disclaimer",
|
|
788
|
-
"HPND-Markus-Kuhn",
|
|
789
|
-
"HPND-Netrek",
|
|
790
|
-
"HPND-Pbmplus",
|
|
791
|
-
"HPND-UC",
|
|
792
|
-
"HPND-UC-export-US",
|
|
793
|
-
"HPND-doc",
|
|
794
|
-
"HPND-doc-sell",
|
|
795
|
-
"HPND-export-US",
|
|
796
|
-
"HPND-export-US-acknowledgement",
|
|
797
|
-
"HPND-export-US-modify",
|
|
798
|
-
"HPND-export2-US",
|
|
799
|
-
"HPND-merchantability-variant",
|
|
800
|
-
"HPND-sell-MIT-disclaimer-xserver",
|
|
801
|
-
"HPND-sell-regexpr",
|
|
802
|
-
"HPND-sell-variant",
|
|
803
|
-
"HPND-sell-variant-MIT-disclaimer",
|
|
804
|
-
"HPND-sell-variant-MIT-disclaimer-rev",
|
|
805
|
-
"HTMLTIDY",
|
|
806
|
-
"HaskellReport",
|
|
807
|
-
"Hippocratic-2.1",
|
|
808
|
-
"IBM-pibs",
|
|
809
|
-
"ICU",
|
|
810
|
-
"IEC-Code-Components-EULA",
|
|
811
|
-
"IJG",
|
|
812
|
-
"IJG-short",
|
|
813
|
-
"IPA",
|
|
814
|
-
"IPL-1.0",
|
|
815
|
-
"ISC",
|
|
816
|
-
"ISC-Veillard",
|
|
817
|
-
"ImageMagick",
|
|
818
|
-
"Imlib2",
|
|
819
|
-
"Info-ZIP",
|
|
820
|
-
"Inner-Net-2.0",
|
|
821
|
-
"InnoSetup",
|
|
822
|
-
"Intel",
|
|
823
|
-
"Intel-ACPI",
|
|
824
|
-
"Interbase-1.0",
|
|
825
|
-
"JPL-image",
|
|
826
|
-
"JPNIC",
|
|
827
|
-
"JSON",
|
|
828
|
-
"Jam",
|
|
829
|
-
"JasPer-2.0",
|
|
830
|
-
"Kastrup",
|
|
831
|
-
"Kazlib",
|
|
832
|
-
"Knuth-CTAN",
|
|
833
|
-
"LAL-1.2",
|
|
834
|
-
"LAL-1.3",
|
|
835
|
-
"LGPL-2.0-only",
|
|
836
|
-
"LGPL-2.0-or-later",
|
|
837
|
-
"LGPL-2.1-only",
|
|
838
|
-
"LGPL-2.1-or-later",
|
|
839
|
-
"LGPL-3.0-only",
|
|
840
|
-
"LGPL-3.0-or-later",
|
|
841
|
-
"LGPLLR",
|
|
842
|
-
"LOOP",
|
|
843
|
-
"LPD-document",
|
|
844
|
-
"LPL-1.0",
|
|
845
|
-
"LPL-1.02",
|
|
846
|
-
"LPPL-1.0",
|
|
847
|
-
"LPPL-1.1",
|
|
848
|
-
"LPPL-1.2",
|
|
849
|
-
"LPPL-1.3a",
|
|
850
|
-
"LPPL-1.3c",
|
|
851
|
-
"LZMA-SDK-9.11-to-9.20",
|
|
852
|
-
"LZMA-SDK-9.22",
|
|
853
|
-
"Latex2e",
|
|
854
|
-
"Latex2e-translated-notice",
|
|
855
|
-
"Leptonica",
|
|
856
|
-
"LiLiQ-P-1.1",
|
|
857
|
-
"LiLiQ-R-1.1",
|
|
858
|
-
"LiLiQ-Rplus-1.1",
|
|
859
|
-
"Libpng",
|
|
860
|
-
"Linux-OpenIB",
|
|
861
|
-
"Linux-man-pages-1-para",
|
|
862
|
-
"Linux-man-pages-copyleft",
|
|
863
|
-
"Linux-man-pages-copyleft-2-para",
|
|
864
|
-
"Linux-man-pages-copyleft-var",
|
|
865
|
-
"Lucida-Bitmap-Fonts",
|
|
866
|
-
"MIPS",
|
|
867
|
-
"MIT",
|
|
868
|
-
"MIT-0",
|
|
869
|
-
"MIT-CMU",
|
|
870
|
-
"MIT-Click",
|
|
871
|
-
"MIT-Festival",
|
|
872
|
-
"MIT-Khronos-old",
|
|
873
|
-
"MIT-Modern-Variant",
|
|
874
|
-
"MIT-Wu",
|
|
875
|
-
"MIT-advertising",
|
|
876
|
-
"MIT-enna",
|
|
877
|
-
"MIT-feh",
|
|
878
|
-
"MIT-open-group",
|
|
879
|
-
"MIT-testregex",
|
|
880
|
-
"MITNFA",
|
|
881
|
-
"MMIXware",
|
|
882
|
-
"MPEG-SSG",
|
|
883
|
-
"MPL-1.0",
|
|
884
|
-
"MPL-1.1",
|
|
885
|
-
"MPL-2.0",
|
|
886
|
-
"MPL-2.0-no-copyleft-exception",
|
|
887
|
-
"MS-LPL",
|
|
888
|
-
"MS-PL",
|
|
889
|
-
"MS-RL",
|
|
890
|
-
"MTLL",
|
|
891
|
-
"Mackerras-3-Clause",
|
|
892
|
-
"Mackerras-3-Clause-acknowledgment",
|
|
893
|
-
"MakeIndex",
|
|
894
|
-
"Martin-Birgmeier",
|
|
895
|
-
"McPhee-slideshow",
|
|
896
|
-
"Minpack",
|
|
897
|
-
"MirOS",
|
|
898
|
-
"Motosoto",
|
|
899
|
-
"MulanPSL-1.0",
|
|
900
|
-
"MulanPSL-2.0",
|
|
901
|
-
"Multics",
|
|
902
|
-
"Mup",
|
|
903
|
-
"NAIST-2003",
|
|
904
|
-
"NASA-1.3",
|
|
905
|
-
"NBPL-1.0",
|
|
906
|
-
"NCBI-PD",
|
|
907
|
-
"NCGL-UK-2.0",
|
|
908
|
-
"NCL",
|
|
909
|
-
"NCSA",
|
|
910
|
-
"NGPL",
|
|
911
|
-
"NICTA-1.0",
|
|
912
|
-
"NIST-PD",
|
|
913
|
-
"NIST-PD-fallback",
|
|
914
|
-
"NIST-Software",
|
|
915
|
-
"NLOD-1.0",
|
|
916
|
-
"NLOD-2.0",
|
|
917
|
-
"NLPL",
|
|
918
|
-
"NOSL",
|
|
919
|
-
"NPL-1.0",
|
|
920
|
-
"NPL-1.1",
|
|
921
|
-
"NPOSL-3.0",
|
|
922
|
-
"NRL",
|
|
923
|
-
"NTIA-PD",
|
|
924
|
-
"NTP",
|
|
925
|
-
"NTP-0",
|
|
926
|
-
"Naumen",
|
|
927
|
-
"NetCDF",
|
|
928
|
-
"Newsletr",
|
|
929
|
-
"Nokia",
|
|
930
|
-
"Noweb",
|
|
931
|
-
"O-UDA-1.0",
|
|
932
|
-
"OAR",
|
|
933
|
-
"OCCT-PL",
|
|
934
|
-
"OCLC-2.0",
|
|
935
|
-
"ODC-By-1.0",
|
|
936
|
-
"ODbL-1.0",
|
|
937
|
-
"OFFIS",
|
|
938
|
-
"OFL-1.0",
|
|
939
|
-
"OFL-1.0-RFN",
|
|
940
|
-
"OFL-1.0-no-RFN",
|
|
941
|
-
"OFL-1.1",
|
|
942
|
-
"OFL-1.1-RFN",
|
|
943
|
-
"OFL-1.1-no-RFN",
|
|
944
|
-
"OGC-1.0",
|
|
945
|
-
"OGDL-Taiwan-1.0",
|
|
946
|
-
"OGL-Canada-2.0",
|
|
947
|
-
"OGL-UK-1.0",
|
|
948
|
-
"OGL-UK-2.0",
|
|
949
|
-
"OGL-UK-3.0",
|
|
950
|
-
"OGTSL",
|
|
951
|
-
"OLDAP-1.1",
|
|
952
|
-
"OLDAP-1.2",
|
|
953
|
-
"OLDAP-1.3",
|
|
954
|
-
"OLDAP-1.4",
|
|
955
|
-
"OLDAP-2.0",
|
|
956
|
-
"OLDAP-2.0.1",
|
|
957
|
-
"OLDAP-2.1",
|
|
958
|
-
"OLDAP-2.2",
|
|
959
|
-
"OLDAP-2.2.1",
|
|
960
|
-
"OLDAP-2.2.2",
|
|
961
|
-
"OLDAP-2.3",
|
|
962
|
-
"OLDAP-2.4",
|
|
963
|
-
"OLDAP-2.5",
|
|
964
|
-
"OLDAP-2.6",
|
|
965
|
-
"OLDAP-2.7",
|
|
966
|
-
"OLDAP-2.8",
|
|
967
|
-
"OLFL-1.3",
|
|
968
|
-
"OML",
|
|
969
|
-
"OPL-1.0",
|
|
970
|
-
"OPL-UK-3.0",
|
|
971
|
-
"OPUBL-1.0",
|
|
972
|
-
"OSET-PL-2.1",
|
|
973
|
-
"OSL-1.0",
|
|
974
|
-
"OSL-1.1",
|
|
975
|
-
"OSL-2.0",
|
|
976
|
-
"OSL-2.1",
|
|
977
|
-
"OSL-3.0",
|
|
978
|
-
"OpenPBS-2.3",
|
|
979
|
-
"OpenSSL",
|
|
980
|
-
"OpenSSL-standalone",
|
|
981
|
-
"OpenVision",
|
|
982
|
-
"PADL",
|
|
983
|
-
"PDDL-1.0",
|
|
984
|
-
"PHP-3.0",
|
|
985
|
-
"PHP-3.01",
|
|
986
|
-
"PPL",
|
|
987
|
-
"PSF-2.0",
|
|
988
|
-
"Parity-6.0.0",
|
|
989
|
-
"Parity-7.0.0",
|
|
990
|
-
"Pixar",
|
|
991
|
-
"Plexus",
|
|
992
|
-
"PolyForm-Noncommercial-1.0.0",
|
|
993
|
-
"PolyForm-Small-Business-1.0.0",
|
|
994
|
-
"PostgreSQL",
|
|
995
|
-
"Python-2.0",
|
|
996
|
-
"Python-2.0.1",
|
|
997
|
-
"QPL-1.0",
|
|
998
|
-
"QPL-1.0-INRIA-2004",
|
|
999
|
-
"Qhull",
|
|
1000
|
-
"RHeCos-1.1",
|
|
1001
|
-
"RPL-1.1",
|
|
1002
|
-
"RPL-1.5",
|
|
1003
|
-
"RPSL-1.0",
|
|
1004
|
-
"RSA-MD",
|
|
1005
|
-
"RSCPL",
|
|
1006
|
-
"Rdisc",
|
|
1007
|
-
"Ruby",
|
|
1008
|
-
"Ruby-pty",
|
|
1009
|
-
"SAX-PD",
|
|
1010
|
-
"SAX-PD-2.0",
|
|
1011
|
-
"SCEA",
|
|
1012
|
-
"SGI-B-1.0",
|
|
1013
|
-
"SGI-B-1.1",
|
|
1014
|
-
"SGI-B-2.0",
|
|
1015
|
-
"SGI-OpenGL",
|
|
1016
|
-
"SGP4",
|
|
1017
|
-
"SHL-0.5",
|
|
1018
|
-
"SHL-0.51",
|
|
1019
|
-
"SISSL",
|
|
1020
|
-
"SISSL-1.2",
|
|
1021
|
-
"SL",
|
|
1022
|
-
"SMAIL-GPL",
|
|
1023
|
-
"SMLNJ",
|
|
1024
|
-
"SMPPL",
|
|
1025
|
-
"SNIA",
|
|
1026
|
-
"SOFA",
|
|
1027
|
-
"SPL-1.0",
|
|
1028
|
-
"SSH-OpenSSH",
|
|
1029
|
-
"SSH-short",
|
|
1030
|
-
"SSLeay-standalone",
|
|
1031
|
-
"SSPL-1.0",
|
|
1032
|
-
"SUL-1.0",
|
|
1033
|
-
"SWL",
|
|
1034
|
-
"Saxpath",
|
|
1035
|
-
"SchemeReport",
|
|
1036
|
-
"Sendmail",
|
|
1037
|
-
"Sendmail-8.23",
|
|
1038
|
-
"Sendmail-Open-Source-1.1",
|
|
1039
|
-
"SimPL-2.0",
|
|
1040
|
-
"Sleepycat",
|
|
1041
|
-
"Soundex",
|
|
1042
|
-
"Spencer-86",
|
|
1043
|
-
"Spencer-94",
|
|
1044
|
-
"Spencer-99",
|
|
1045
|
-
"SugarCRM-1.1.3",
|
|
1046
|
-
"Sun-PPP",
|
|
1047
|
-
"Sun-PPP-2000",
|
|
1048
|
-
"SunPro",
|
|
1049
|
-
"Symlinks",
|
|
1050
|
-
"TAPR-OHL-1.0",
|
|
1051
|
-
"TCL",
|
|
1052
|
-
"TCP-wrappers",
|
|
1053
|
-
"TGPPL-1.0",
|
|
1054
|
-
"TMate",
|
|
1055
|
-
"TORQUE-1.1",
|
|
1056
|
-
"TOSL",
|
|
1057
|
-
"TPDL",
|
|
1058
|
-
"TPL-1.0",
|
|
1059
|
-
"TTWL",
|
|
1060
|
-
"TTYP0",
|
|
1061
|
-
"TU-Berlin-1.0",
|
|
1062
|
-
"TU-Berlin-2.0",
|
|
1063
|
-
"TermReadKey",
|
|
1064
|
-
"ThirdEye",
|
|
1065
|
-
"TrustedQSL",
|
|
1066
|
-
"UCAR",
|
|
1067
|
-
"UCL-1.0",
|
|
1068
|
-
"UMich-Merit",
|
|
1069
|
-
"UPL-1.0",
|
|
1070
|
-
"URT-RLE",
|
|
1071
|
-
"Ubuntu-font-1.0",
|
|
1072
|
-
"Unicode-3.0",
|
|
1073
|
-
"Unicode-DFS-2015",
|
|
1074
|
-
"Unicode-DFS-2016",
|
|
1075
|
-
"Unicode-TOU",
|
|
1076
|
-
"UnixCrypt",
|
|
1077
|
-
"Unlicense",
|
|
1078
|
-
"Unlicense-libtelnet",
|
|
1079
|
-
"Unlicense-libwhirlpool",
|
|
1080
|
-
"VOSTROM",
|
|
1081
|
-
"VSL-1.0",
|
|
1082
|
-
"Vim",
|
|
1083
|
-
"W3C",
|
|
1084
|
-
"W3C-19980720",
|
|
1085
|
-
"W3C-20150513",
|
|
1086
|
-
"WTFPL",
|
|
1087
|
-
"Watcom-1.0",
|
|
1088
|
-
"Widget-Workshop",
|
|
1089
|
-
"Wsuipa",
|
|
1090
|
-
"X11",
|
|
1091
|
-
"X11-distribute-modifications-variant",
|
|
1092
|
-
"X11-swapped",
|
|
1093
|
-
"XFree86-1.1",
|
|
1094
|
-
"XSkat",
|
|
1095
|
-
"Xdebug-1.03",
|
|
1096
|
-
"Xerox",
|
|
1097
|
-
"Xfig",
|
|
1098
|
-
"Xnet",
|
|
1099
|
-
"YPL-1.0",
|
|
1100
|
-
"YPL-1.1",
|
|
1101
|
-
"ZPL-1.1",
|
|
1102
|
-
"ZPL-2.0",
|
|
1103
|
-
"ZPL-2.1",
|
|
1104
|
-
"Zed",
|
|
1105
|
-
"Zeeff",
|
|
1106
|
-
"Zend-2.0",
|
|
1107
|
-
"Zimbra-1.3",
|
|
1108
|
-
"Zimbra-1.4",
|
|
1109
|
-
"Zlib",
|
|
1110
|
-
"any-OSI",
|
|
1111
|
-
"any-OSI-perl-modules",
|
|
1112
|
-
"bcrypt-Solar-Designer",
|
|
1113
|
-
"blessing",
|
|
1114
|
-
"bzip2-1.0.6",
|
|
1115
|
-
"check-cvs",
|
|
1116
|
-
"checkmk",
|
|
1117
|
-
"copyleft-next-0.3.0",
|
|
1118
|
-
"copyleft-next-0.3.1",
|
|
1119
|
-
"curl",
|
|
1120
|
-
"cve-tou",
|
|
1121
|
-
"diffmark",
|
|
1122
|
-
"dtoa",
|
|
1123
|
-
"dvipdfm",
|
|
1124
|
-
"eGenix",
|
|
1125
|
-
"etalab-2.0",
|
|
1126
|
-
"fwlw",
|
|
1127
|
-
"gSOAP-1.3b",
|
|
1128
|
-
"generic-xts",
|
|
1129
|
-
"gnuplot",
|
|
1130
|
-
"gtkbook",
|
|
1131
|
-
"hdparm",
|
|
1132
|
-
"iMatix",
|
|
1133
|
-
"jove",
|
|
1134
|
-
"libpng-1.6.35",
|
|
1135
|
-
"libpng-2.0",
|
|
1136
|
-
"libselinux-1.0",
|
|
1137
|
-
"libtiff",
|
|
1138
|
-
"libutil-David-Nugent",
|
|
1139
|
-
"lsof",
|
|
1140
|
-
"magaz",
|
|
1141
|
-
"mailprio",
|
|
1142
|
-
"man2html",
|
|
1143
|
-
"metamail",
|
|
1144
|
-
"mpi-permissive",
|
|
1145
|
-
"mpich2",
|
|
1146
|
-
"mplus",
|
|
1147
|
-
"ngrep",
|
|
1148
|
-
"pkgconf",
|
|
1149
|
-
"pnmstitch",
|
|
1150
|
-
"psfrag",
|
|
1151
|
-
"psutils",
|
|
1152
|
-
"python-ldap",
|
|
1153
|
-
"radvd",
|
|
1154
|
-
"snprintf",
|
|
1155
|
-
"softSurfer",
|
|
1156
|
-
"ssh-keyscan",
|
|
1157
|
-
"swrule",
|
|
1158
|
-
"threeparttable",
|
|
1159
|
-
"ulem",
|
|
1160
|
-
"w3m",
|
|
1161
|
-
"wwl",
|
|
1162
|
-
"xinetd",
|
|
1163
|
-
"xkeyboard-config-Zinoviev",
|
|
1164
|
-
"xlock",
|
|
1165
|
-
"xpp",
|
|
1166
|
-
"xzoom",
|
|
1167
|
-
"zlib-acknowledgement"
|
|
1168
|
-
];
|
|
1169
|
-
}
|
|
1170
|
-
});
|
|
1171
|
-
|
|
1172
|
-
// node_modules/.pnpm/spdx-license-ids@3.0.22/node_modules/spdx-license-ids/deprecated.json
|
|
1173
|
-
var require_deprecated = __commonJS({
|
|
1174
|
-
"node_modules/.pnpm/spdx-license-ids@3.0.22/node_modules/spdx-license-ids/deprecated.json"(exports2, module2) {
|
|
1175
|
-
module2.exports = [
|
|
1176
|
-
"AGPL-1.0",
|
|
1177
|
-
"AGPL-3.0",
|
|
1178
|
-
"BSD-2-Clause-FreeBSD",
|
|
1179
|
-
"BSD-2-Clause-NetBSD",
|
|
1180
|
-
"GFDL-1.1",
|
|
1181
|
-
"GFDL-1.2",
|
|
1182
|
-
"GFDL-1.3",
|
|
1183
|
-
"GPL-1.0",
|
|
1184
|
-
"GPL-2.0",
|
|
1185
|
-
"GPL-2.0-with-GCC-exception",
|
|
1186
|
-
"GPL-2.0-with-autoconf-exception",
|
|
1187
|
-
"GPL-2.0-with-bison-exception",
|
|
1188
|
-
"GPL-2.0-with-classpath-exception",
|
|
1189
|
-
"GPL-2.0-with-font-exception",
|
|
1190
|
-
"GPL-3.0",
|
|
1191
|
-
"GPL-3.0-with-GCC-exception",
|
|
1192
|
-
"GPL-3.0-with-autoconf-exception",
|
|
1193
|
-
"LGPL-2.0",
|
|
1194
|
-
"LGPL-2.1",
|
|
1195
|
-
"LGPL-3.0",
|
|
1196
|
-
"Net-SNMP",
|
|
1197
|
-
"Nunit",
|
|
1198
|
-
"StandardML-NJ",
|
|
1199
|
-
"bzip2-1.0.5",
|
|
1200
|
-
"eCos-2.0",
|
|
1201
|
-
"wxWindows"
|
|
1202
|
-
];
|
|
1203
|
-
}
|
|
1204
|
-
});
|
|
1205
|
-
|
|
1206
|
-
// node_modules/.pnpm/spdx-exceptions@2.5.0/node_modules/spdx-exceptions/index.json
|
|
1207
|
-
var require_spdx_exceptions = __commonJS({
|
|
1208
|
-
"node_modules/.pnpm/spdx-exceptions@2.5.0/node_modules/spdx-exceptions/index.json"(exports2, module2) {
|
|
1209
|
-
module2.exports = [
|
|
1210
|
-
"389-exception",
|
|
1211
|
-
"Asterisk-exception",
|
|
1212
|
-
"Autoconf-exception-2.0",
|
|
1213
|
-
"Autoconf-exception-3.0",
|
|
1214
|
-
"Autoconf-exception-generic",
|
|
1215
|
-
"Autoconf-exception-generic-3.0",
|
|
1216
|
-
"Autoconf-exception-macro",
|
|
1217
|
-
"Bison-exception-1.24",
|
|
1218
|
-
"Bison-exception-2.2",
|
|
1219
|
-
"Bootloader-exception",
|
|
1220
|
-
"Classpath-exception-2.0",
|
|
1221
|
-
"CLISP-exception-2.0",
|
|
1222
|
-
"cryptsetup-OpenSSL-exception",
|
|
1223
|
-
"DigiRule-FOSS-exception",
|
|
1224
|
-
"eCos-exception-2.0",
|
|
1225
|
-
"Fawkes-Runtime-exception",
|
|
1226
|
-
"FLTK-exception",
|
|
1227
|
-
"fmt-exception",
|
|
1228
|
-
"Font-exception-2.0",
|
|
1229
|
-
"freertos-exception-2.0",
|
|
1230
|
-
"GCC-exception-2.0",
|
|
1231
|
-
"GCC-exception-2.0-note",
|
|
1232
|
-
"GCC-exception-3.1",
|
|
1233
|
-
"Gmsh-exception",
|
|
1234
|
-
"GNAT-exception",
|
|
1235
|
-
"GNOME-examples-exception",
|
|
1236
|
-
"GNU-compiler-exception",
|
|
1237
|
-
"gnu-javamail-exception",
|
|
1238
|
-
"GPL-3.0-interface-exception",
|
|
1239
|
-
"GPL-3.0-linking-exception",
|
|
1240
|
-
"GPL-3.0-linking-source-exception",
|
|
1241
|
-
"GPL-CC-1.0",
|
|
1242
|
-
"GStreamer-exception-2005",
|
|
1243
|
-
"GStreamer-exception-2008",
|
|
1244
|
-
"i2p-gpl-java-exception",
|
|
1245
|
-
"KiCad-libraries-exception",
|
|
1246
|
-
"LGPL-3.0-linking-exception",
|
|
1247
|
-
"libpri-OpenH323-exception",
|
|
1248
|
-
"Libtool-exception",
|
|
1249
|
-
"Linux-syscall-note",
|
|
1250
|
-
"LLGPL",
|
|
1251
|
-
"LLVM-exception",
|
|
1252
|
-
"LZMA-exception",
|
|
1253
|
-
"mif-exception",
|
|
1254
|
-
"OCaml-LGPL-linking-exception",
|
|
1255
|
-
"OCCT-exception-1.0",
|
|
1256
|
-
"OpenJDK-assembly-exception-1.0",
|
|
1257
|
-
"openvpn-openssl-exception",
|
|
1258
|
-
"PS-or-PDF-font-exception-20170817",
|
|
1259
|
-
"QPL-1.0-INRIA-2004-exception",
|
|
1260
|
-
"Qt-GPL-exception-1.0",
|
|
1261
|
-
"Qt-LGPL-exception-1.1",
|
|
1262
|
-
"Qwt-exception-1.0",
|
|
1263
|
-
"SANE-exception",
|
|
1264
|
-
"SHL-2.0",
|
|
1265
|
-
"SHL-2.1",
|
|
1266
|
-
"stunnel-exception",
|
|
1267
|
-
"SWI-exception",
|
|
1268
|
-
"Swift-exception",
|
|
1269
|
-
"Texinfo-exception",
|
|
1270
|
-
"u-boot-exception-2.0",
|
|
1271
|
-
"UBDL-exception",
|
|
1272
|
-
"Universal-FOSS-exception-1.0",
|
|
1273
|
-
"vsftpd-openssl-exception",
|
|
1274
|
-
"WxWindows-exception-3.1",
|
|
1275
|
-
"x11vnc-openssl-exception"
|
|
1276
|
-
];
|
|
1277
|
-
}
|
|
1278
|
-
});
|
|
1279
|
-
|
|
1280
|
-
// node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/scan.js
|
|
1281
|
-
var require_scan = __commonJS({
|
|
1282
|
-
"node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/scan.js"(exports2, module2) {
|
|
1283
|
-
"use strict";
|
|
1284
|
-
var licenses = [].concat(require_spdx_license_ids()).concat(require_deprecated());
|
|
1285
|
-
var exceptions = require_spdx_exceptions();
|
|
1286
|
-
module2.exports = function(source) {
|
|
1287
|
-
var index = 0;
|
|
1288
|
-
function hasMore() {
|
|
1289
|
-
return index < source.length;
|
|
1290
|
-
}
|
|
1291
|
-
__name(hasMore, "hasMore");
|
|
1292
|
-
function read(value) {
|
|
1293
|
-
if (value instanceof RegExp) {
|
|
1294
|
-
var chars = source.slice(index);
|
|
1295
|
-
var match = chars.match(value);
|
|
1296
|
-
if (match) {
|
|
1297
|
-
index += match[0].length;
|
|
1298
|
-
return match[0];
|
|
1299
|
-
}
|
|
1300
|
-
} else {
|
|
1301
|
-
if (source.indexOf(value, index) === index) {
|
|
1302
|
-
index += value.length;
|
|
1303
|
-
return value;
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
__name(read, "read");
|
|
1308
|
-
function skipWhitespace() {
|
|
1309
|
-
read(/[ ]*/);
|
|
1310
|
-
}
|
|
1311
|
-
__name(skipWhitespace, "skipWhitespace");
|
|
1312
|
-
function operator() {
|
|
1313
|
-
var string;
|
|
1314
|
-
var possibilities = ["WITH", "AND", "OR", "(", ")", ":", "+"];
|
|
1315
|
-
for (var i = 0; i < possibilities.length; i++) {
|
|
1316
|
-
string = read(possibilities[i]);
|
|
1317
|
-
if (string) {
|
|
1318
|
-
break;
|
|
1319
|
-
}
|
|
1320
|
-
}
|
|
1321
|
-
if (string === "+" && index > 1 && source[index - 2] === " ") {
|
|
1322
|
-
throw new Error("Space before `+`");
|
|
1323
|
-
}
|
|
1324
|
-
return string && {
|
|
1325
|
-
type: "OPERATOR",
|
|
1326
|
-
string
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
__name(operator, "operator");
|
|
1330
|
-
function idstring() {
|
|
1331
|
-
return read(/[A-Za-z0-9-.]+/);
|
|
1332
|
-
}
|
|
1333
|
-
__name(idstring, "idstring");
|
|
1334
|
-
function expectIdstring() {
|
|
1335
|
-
var string = idstring();
|
|
1336
|
-
if (!string) {
|
|
1337
|
-
throw new Error("Expected idstring at offset " + index);
|
|
1338
|
-
}
|
|
1339
|
-
return string;
|
|
1340
|
-
}
|
|
1341
|
-
__name(expectIdstring, "expectIdstring");
|
|
1342
|
-
function documentRef() {
|
|
1343
|
-
if (read("DocumentRef-")) {
|
|
1344
|
-
var string = expectIdstring();
|
|
1345
|
-
return { type: "DOCUMENTREF", string };
|
|
1346
|
-
}
|
|
1347
|
-
}
|
|
1348
|
-
__name(documentRef, "documentRef");
|
|
1349
|
-
function licenseRef() {
|
|
1350
|
-
if (read("LicenseRef-")) {
|
|
1351
|
-
var string = expectIdstring();
|
|
1352
|
-
return { type: "LICENSEREF", string };
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
__name(licenseRef, "licenseRef");
|
|
1356
|
-
function identifier() {
|
|
1357
|
-
var begin = index;
|
|
1358
|
-
var string = idstring();
|
|
1359
|
-
if (licenses.indexOf(string) !== -1) {
|
|
1360
|
-
return {
|
|
1361
|
-
type: "LICENSE",
|
|
1362
|
-
string
|
|
1363
|
-
};
|
|
1364
|
-
} else if (exceptions.indexOf(string) !== -1) {
|
|
1365
|
-
return {
|
|
1366
|
-
type: "EXCEPTION",
|
|
1367
|
-
string
|
|
1368
|
-
};
|
|
1369
|
-
}
|
|
1370
|
-
index = begin;
|
|
1371
|
-
}
|
|
1372
|
-
__name(identifier, "identifier");
|
|
1373
|
-
function parseToken() {
|
|
1374
|
-
return operator() || documentRef() || licenseRef() || identifier();
|
|
1375
|
-
}
|
|
1376
|
-
__name(parseToken, "parseToken");
|
|
1377
|
-
var tokens = [];
|
|
1378
|
-
while (hasMore()) {
|
|
1379
|
-
skipWhitespace();
|
|
1380
|
-
if (!hasMore()) {
|
|
1381
|
-
break;
|
|
1382
|
-
}
|
|
1383
|
-
var token = parseToken();
|
|
1384
|
-
if (!token) {
|
|
1385
|
-
throw new Error("Unexpected `" + source[index] + "` at offset " + index);
|
|
1386
|
-
}
|
|
1387
|
-
tokens.push(token);
|
|
1388
|
-
}
|
|
1389
|
-
return tokens;
|
|
1390
|
-
};
|
|
1391
|
-
}
|
|
1392
|
-
});
|
|
1393
|
-
|
|
1394
|
-
// node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/parse.js
|
|
1395
|
-
var require_parse2 = __commonJS({
|
|
1396
|
-
"node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/parse.js"(exports2, module2) {
|
|
1397
|
-
"use strict";
|
|
1398
|
-
module2.exports = function(tokens) {
|
|
1399
|
-
var index = 0;
|
|
1400
|
-
function hasMore() {
|
|
1401
|
-
return index < tokens.length;
|
|
1402
|
-
}
|
|
1403
|
-
__name(hasMore, "hasMore");
|
|
1404
|
-
function token() {
|
|
1405
|
-
return hasMore() ? tokens[index] : null;
|
|
1406
|
-
}
|
|
1407
|
-
__name(token, "token");
|
|
1408
|
-
function next() {
|
|
1409
|
-
if (!hasMore()) {
|
|
1410
|
-
throw new Error();
|
|
1411
|
-
}
|
|
1412
|
-
index++;
|
|
1413
|
-
}
|
|
1414
|
-
__name(next, "next");
|
|
1415
|
-
function parseOperator(operator) {
|
|
1416
|
-
var t = token();
|
|
1417
|
-
if (t && t.type === "OPERATOR" && operator === t.string) {
|
|
1418
|
-
next();
|
|
1419
|
-
return t.string;
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
__name(parseOperator, "parseOperator");
|
|
1423
|
-
function parseWith() {
|
|
1424
|
-
if (parseOperator("WITH")) {
|
|
1425
|
-
var t = token();
|
|
1426
|
-
if (t && t.type === "EXCEPTION") {
|
|
1427
|
-
next();
|
|
1428
|
-
return t.string;
|
|
1429
|
-
}
|
|
1430
|
-
throw new Error("Expected exception after `WITH`");
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
__name(parseWith, "parseWith");
|
|
1434
|
-
function parseLicenseRef() {
|
|
1435
|
-
var begin = index;
|
|
1436
|
-
var string = "";
|
|
1437
|
-
var t = token();
|
|
1438
|
-
if (t.type === "DOCUMENTREF") {
|
|
1439
|
-
next();
|
|
1440
|
-
string += "DocumentRef-" + t.string + ":";
|
|
1441
|
-
if (!parseOperator(":")) {
|
|
1442
|
-
throw new Error("Expected `:` after `DocumentRef-...`");
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
t = token();
|
|
1446
|
-
if (t.type === "LICENSEREF") {
|
|
1447
|
-
next();
|
|
1448
|
-
string += "LicenseRef-" + t.string;
|
|
1449
|
-
return { license: string };
|
|
1450
|
-
}
|
|
1451
|
-
index = begin;
|
|
1452
|
-
}
|
|
1453
|
-
__name(parseLicenseRef, "parseLicenseRef");
|
|
1454
|
-
function parseLicense() {
|
|
1455
|
-
var t = token();
|
|
1456
|
-
if (t && t.type === "LICENSE") {
|
|
1457
|
-
next();
|
|
1458
|
-
var node2 = { license: t.string };
|
|
1459
|
-
if (parseOperator("+")) {
|
|
1460
|
-
node2.plus = true;
|
|
1461
|
-
}
|
|
1462
|
-
var exception = parseWith();
|
|
1463
|
-
if (exception) {
|
|
1464
|
-
node2.exception = exception;
|
|
1465
|
-
}
|
|
1466
|
-
return node2;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
__name(parseLicense, "parseLicense");
|
|
1470
|
-
function parseParenthesizedExpression() {
|
|
1471
|
-
var left = parseOperator("(");
|
|
1472
|
-
if (!left) {
|
|
1473
|
-
return;
|
|
1474
|
-
}
|
|
1475
|
-
var expr = parseExpression();
|
|
1476
|
-
if (!parseOperator(")")) {
|
|
1477
|
-
throw new Error("Expected `)`");
|
|
1478
|
-
}
|
|
1479
|
-
return expr;
|
|
1480
|
-
}
|
|
1481
|
-
__name(parseParenthesizedExpression, "parseParenthesizedExpression");
|
|
1482
|
-
function parseAtom() {
|
|
1483
|
-
return parseParenthesizedExpression() || parseLicenseRef() || parseLicense();
|
|
1484
|
-
}
|
|
1485
|
-
__name(parseAtom, "parseAtom");
|
|
1486
|
-
function makeBinaryOpParser(operator, nextParser) {
|
|
1487
|
-
return /* @__PURE__ */ __name(function parseBinaryOp() {
|
|
1488
|
-
var left = nextParser();
|
|
1489
|
-
if (!left) {
|
|
1490
|
-
return;
|
|
1491
|
-
}
|
|
1492
|
-
if (!parseOperator(operator)) {
|
|
1493
|
-
return left;
|
|
1494
|
-
}
|
|
1495
|
-
var right = parseBinaryOp();
|
|
1496
|
-
if (!right) {
|
|
1497
|
-
throw new Error("Expected expression");
|
|
1498
|
-
}
|
|
1499
|
-
return {
|
|
1500
|
-
left,
|
|
1501
|
-
conjunction: operator.toLowerCase(),
|
|
1502
|
-
right
|
|
1503
|
-
};
|
|
1504
|
-
}, "parseBinaryOp");
|
|
1505
|
-
}
|
|
1506
|
-
__name(makeBinaryOpParser, "makeBinaryOpParser");
|
|
1507
|
-
var parseAnd = makeBinaryOpParser("AND", parseAtom);
|
|
1508
|
-
var parseExpression = makeBinaryOpParser("OR", parseAnd);
|
|
1509
|
-
var node = parseExpression();
|
|
1510
|
-
if (!node || hasMore()) {
|
|
1511
|
-
throw new Error("Syntax error");
|
|
1512
|
-
}
|
|
1513
|
-
return node;
|
|
1514
|
-
};
|
|
1515
|
-
}
|
|
1516
|
-
});
|
|
1517
|
-
|
|
1518
|
-
// node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/index.js
|
|
1519
|
-
var require_spdx_expression_parse = __commonJS({
|
|
1520
|
-
"node_modules/.pnpm/spdx-expression-parse@3.0.1/node_modules/spdx-expression-parse/index.js"(exports2, module2) {
|
|
1521
|
-
"use strict";
|
|
1522
|
-
var scan = require_scan();
|
|
1523
|
-
var parse = require_parse2();
|
|
1524
|
-
module2.exports = function(source) {
|
|
1525
|
-
return parse(scan(source));
|
|
1526
|
-
};
|
|
1527
|
-
}
|
|
1528
|
-
});
|
|
1529
|
-
|
|
1530
|
-
// node_modules/.pnpm/spdx-correct@3.2.0/node_modules/spdx-correct/index.js
|
|
1531
|
-
var require_spdx_correct = __commonJS({
|
|
1532
|
-
"node_modules/.pnpm/spdx-correct@3.2.0/node_modules/spdx-correct/index.js"(exports2, module2) {
|
|
1533
|
-
var parse = require_spdx_expression_parse();
|
|
1534
|
-
var spdxLicenseIds = require_spdx_license_ids();
|
|
1535
|
-
function valid(string) {
|
|
1536
|
-
try {
|
|
1537
|
-
parse(string);
|
|
1538
|
-
return true;
|
|
1539
|
-
} catch (error) {
|
|
1540
|
-
return false;
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
__name(valid, "valid");
|
|
1544
|
-
function sortTranspositions(a, b) {
|
|
1545
|
-
var length = b[0].length - a[0].length;
|
|
1546
|
-
if (length !== 0) return length;
|
|
1547
|
-
return a[0].toUpperCase().localeCompare(b[0].toUpperCase());
|
|
1548
|
-
}
|
|
1549
|
-
__name(sortTranspositions, "sortTranspositions");
|
|
1550
|
-
var transpositions = [
|
|
1551
|
-
["APGL", "AGPL"],
|
|
1552
|
-
["Gpl", "GPL"],
|
|
1553
|
-
["GLP", "GPL"],
|
|
1554
|
-
["APL", "Apache"],
|
|
1555
|
-
["ISD", "ISC"],
|
|
1556
|
-
["GLP", "GPL"],
|
|
1557
|
-
["IST", "ISC"],
|
|
1558
|
-
["Claude", "Clause"],
|
|
1559
|
-
[" or later", "+"],
|
|
1560
|
-
[" International", ""],
|
|
1561
|
-
["GNU", "GPL"],
|
|
1562
|
-
["GUN", "GPL"],
|
|
1563
|
-
["+", ""],
|
|
1564
|
-
["GNU GPL", "GPL"],
|
|
1565
|
-
["GNU LGPL", "LGPL"],
|
|
1566
|
-
["GNU/GPL", "GPL"],
|
|
1567
|
-
["GNU GLP", "GPL"],
|
|
1568
|
-
["GNU LESSER GENERAL PUBLIC LICENSE", "LGPL"],
|
|
1569
|
-
["GNU Lesser General Public License", "LGPL"],
|
|
1570
|
-
["GNU LESSER GENERAL PUBLIC LICENSE", "LGPL-2.1"],
|
|
1571
|
-
["GNU Lesser General Public License", "LGPL-2.1"],
|
|
1572
|
-
["LESSER GENERAL PUBLIC LICENSE", "LGPL"],
|
|
1573
|
-
["Lesser General Public License", "LGPL"],
|
|
1574
|
-
["LESSER GENERAL PUBLIC LICENSE", "LGPL-2.1"],
|
|
1575
|
-
["Lesser General Public License", "LGPL-2.1"],
|
|
1576
|
-
["GNU General Public License", "GPL"],
|
|
1577
|
-
["Gnu public license", "GPL"],
|
|
1578
|
-
["GNU Public License", "GPL"],
|
|
1579
|
-
["GNU GENERAL PUBLIC LICENSE", "GPL"],
|
|
1580
|
-
["MTI", "MIT"],
|
|
1581
|
-
["Mozilla Public License", "MPL"],
|
|
1582
|
-
["Universal Permissive License", "UPL"],
|
|
1583
|
-
["WTH", "WTF"],
|
|
1584
|
-
["WTFGPL", "WTFPL"],
|
|
1585
|
-
["-License", ""]
|
|
1586
|
-
].sort(sortTranspositions);
|
|
1587
|
-
var TRANSPOSED = 0;
|
|
1588
|
-
var CORRECT = 1;
|
|
1589
|
-
var transforms = [
|
|
1590
|
-
// e.g. 'mit'
|
|
1591
|
-
function(argument) {
|
|
1592
|
-
return argument.toUpperCase();
|
|
1593
|
-
},
|
|
1594
|
-
// e.g. 'MIT '
|
|
1595
|
-
function(argument) {
|
|
1596
|
-
return argument.trim();
|
|
1597
|
-
},
|
|
1598
|
-
// e.g. 'M.I.T.'
|
|
1599
|
-
function(argument) {
|
|
1600
|
-
return argument.replace(/\./g, "");
|
|
1601
|
-
},
|
|
1602
|
-
// e.g. 'Apache- 2.0'
|
|
1603
|
-
function(argument) {
|
|
1604
|
-
return argument.replace(/\s+/g, "");
|
|
1605
|
-
},
|
|
1606
|
-
// e.g. 'CC BY 4.0''
|
|
1607
|
-
function(argument) {
|
|
1608
|
-
return argument.replace(/\s+/g, "-");
|
|
1609
|
-
},
|
|
1610
|
-
// e.g. 'LGPLv2.1'
|
|
1611
|
-
function(argument) {
|
|
1612
|
-
return argument.replace("v", "-");
|
|
1613
|
-
},
|
|
1614
|
-
// e.g. 'Apache 2.0'
|
|
1615
|
-
function(argument) {
|
|
1616
|
-
return argument.replace(/,?\s*(\d)/, "-$1");
|
|
1617
|
-
},
|
|
1618
|
-
// e.g. 'GPL 2'
|
|
1619
|
-
function(argument) {
|
|
1620
|
-
return argument.replace(/,?\s*(\d)/, "-$1.0");
|
|
1621
|
-
},
|
|
1622
|
-
// e.g. 'Apache Version 2.0'
|
|
1623
|
-
function(argument) {
|
|
1624
|
-
return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, "-$2");
|
|
1625
|
-
},
|
|
1626
|
-
// e.g. 'Apache Version 2'
|
|
1627
|
-
function(argument) {
|
|
1628
|
-
return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, "-$2.0");
|
|
1629
|
-
},
|
|
1630
|
-
// e.g. 'ZLIB'
|
|
1631
|
-
function(argument) {
|
|
1632
|
-
return argument[0].toUpperCase() + argument.slice(1);
|
|
1633
|
-
},
|
|
1634
|
-
// e.g. 'MPL/2.0'
|
|
1635
|
-
function(argument) {
|
|
1636
|
-
return argument.replace("/", "-");
|
|
1637
|
-
},
|
|
1638
|
-
// e.g. 'Apache 2'
|
|
1639
|
-
function(argument) {
|
|
1640
|
-
return argument.replace(/\s*V\s*(\d)/, "-$1").replace(/(\d)$/, "$1.0");
|
|
1641
|
-
},
|
|
1642
|
-
// e.g. 'GPL-2.0', 'GPL-3.0'
|
|
1643
|
-
function(argument) {
|
|
1644
|
-
if (argument.indexOf("3.0") !== -1) {
|
|
1645
|
-
return argument + "-or-later";
|
|
1646
|
-
} else {
|
|
1647
|
-
return argument + "-only";
|
|
1648
|
-
}
|
|
1649
|
-
},
|
|
1650
|
-
// e.g. 'GPL-2.0-'
|
|
1651
|
-
function(argument) {
|
|
1652
|
-
return argument + "only";
|
|
1653
|
-
},
|
|
1654
|
-
// e.g. 'GPL2'
|
|
1655
|
-
function(argument) {
|
|
1656
|
-
return argument.replace(/(\d)$/, "-$1.0");
|
|
1657
|
-
},
|
|
1658
|
-
// e.g. 'BSD 3'
|
|
1659
|
-
function(argument) {
|
|
1660
|
-
return argument.replace(/(-| )?(\d)$/, "-$2-Clause");
|
|
1661
|
-
},
|
|
1662
|
-
// e.g. 'BSD clause 3'
|
|
1663
|
-
function(argument) {
|
|
1664
|
-
return argument.replace(/(-| )clause(-| )(\d)/, "-$3-Clause");
|
|
1665
|
-
},
|
|
1666
|
-
// e.g. 'New BSD license'
|
|
1667
|
-
function(argument) {
|
|
1668
|
-
return argument.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i, "BSD-3-Clause");
|
|
1669
|
-
},
|
|
1670
|
-
// e.g. 'Simplified BSD license'
|
|
1671
|
-
function(argument) {
|
|
1672
|
-
return argument.replace(/\bSimplified(-| )?BSD((-| )License)?/i, "BSD-2-Clause");
|
|
1673
|
-
},
|
|
1674
|
-
// e.g. 'Free BSD license'
|
|
1675
|
-
function(argument) {
|
|
1676
|
-
return argument.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i, "BSD-2-Clause-$1BSD");
|
|
1677
|
-
},
|
|
1678
|
-
// e.g. 'Clear BSD license'
|
|
1679
|
-
function(argument) {
|
|
1680
|
-
return argument.replace(/\bClear(-| )?BSD((-| )License)?/i, "BSD-3-Clause-Clear");
|
|
1681
|
-
},
|
|
1682
|
-
// e.g. 'Old BSD License'
|
|
1683
|
-
function(argument) {
|
|
1684
|
-
return argument.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i, "BSD-4-Clause");
|
|
1685
|
-
},
|
|
1686
|
-
// e.g. 'BY-NC-4.0'
|
|
1687
|
-
function(argument) {
|
|
1688
|
-
return "CC-" + argument;
|
|
1689
|
-
},
|
|
1690
|
-
// e.g. 'BY-NC'
|
|
1691
|
-
function(argument) {
|
|
1692
|
-
return "CC-" + argument + "-4.0";
|
|
1693
|
-
},
|
|
1694
|
-
// e.g. 'Attribution-NonCommercial'
|
|
1695
|
-
function(argument) {
|
|
1696
|
-
return argument.replace("Attribution", "BY").replace("NonCommercial", "NC").replace("NoDerivatives", "ND").replace(/ (\d)/, "-$1").replace(/ ?International/, "");
|
|
1697
|
-
},
|
|
1698
|
-
// e.g. 'Attribution-NonCommercial'
|
|
1699
|
-
function(argument) {
|
|
1700
|
-
return "CC-" + argument.replace("Attribution", "BY").replace("NonCommercial", "NC").replace("NoDerivatives", "ND").replace(/ (\d)/, "-$1").replace(/ ?International/, "") + "-4.0";
|
|
1701
|
-
}
|
|
1702
|
-
];
|
|
1703
|
-
var licensesWithVersions = spdxLicenseIds.map(function(id) {
|
|
1704
|
-
var match = /^(.*)-\d+\.\d+$/.exec(id);
|
|
1705
|
-
return match ? [match[0], match[1]] : [id, null];
|
|
1706
|
-
}).reduce(function(objectMap, item) {
|
|
1707
|
-
var key = item[1];
|
|
1708
|
-
objectMap[key] = objectMap[key] || [];
|
|
1709
|
-
objectMap[key].push(item[0]);
|
|
1710
|
-
return objectMap;
|
|
1711
|
-
}, {});
|
|
1712
|
-
var licensesWithOneVersion = Object.keys(licensesWithVersions).map(/* @__PURE__ */ __name(function makeEntries(key) {
|
|
1713
|
-
return [key, licensesWithVersions[key]];
|
|
1714
|
-
}, "makeEntries")).filter(/* @__PURE__ */ __name(function identifySoleVersions(item) {
|
|
1715
|
-
return (
|
|
1716
|
-
// Licenses has just one valid version suffix.
|
|
1717
|
-
item[1].length === 1 && item[0] !== null && // APL will be considered Apache, rather than APL-1.0
|
|
1718
|
-
item[0] !== "APL"
|
|
1719
|
-
);
|
|
1720
|
-
}, "identifySoleVersions")).map(/* @__PURE__ */ __name(function createLastResorts(item) {
|
|
1721
|
-
return [item[0], item[1][0]];
|
|
1722
|
-
}, "createLastResorts"));
|
|
1723
|
-
licensesWithVersions = void 0;
|
|
1724
|
-
var lastResorts = [
|
|
1725
|
-
["UNLI", "Unlicense"],
|
|
1726
|
-
["WTF", "WTFPL"],
|
|
1727
|
-
["2 CLAUSE", "BSD-2-Clause"],
|
|
1728
|
-
["2-CLAUSE", "BSD-2-Clause"],
|
|
1729
|
-
["3 CLAUSE", "BSD-3-Clause"],
|
|
1730
|
-
["3-CLAUSE", "BSD-3-Clause"],
|
|
1731
|
-
["AFFERO", "AGPL-3.0-or-later"],
|
|
1732
|
-
["AGPL", "AGPL-3.0-or-later"],
|
|
1733
|
-
["APACHE", "Apache-2.0"],
|
|
1734
|
-
["ARTISTIC", "Artistic-2.0"],
|
|
1735
|
-
["Affero", "AGPL-3.0-or-later"],
|
|
1736
|
-
["BEER", "Beerware"],
|
|
1737
|
-
["BOOST", "BSL-1.0"],
|
|
1738
|
-
["BSD", "BSD-2-Clause"],
|
|
1739
|
-
["CDDL", "CDDL-1.1"],
|
|
1740
|
-
["ECLIPSE", "EPL-1.0"],
|
|
1741
|
-
["FUCK", "WTFPL"],
|
|
1742
|
-
["GNU", "GPL-3.0-or-later"],
|
|
1743
|
-
["LGPL", "LGPL-3.0-or-later"],
|
|
1744
|
-
["GPLV1", "GPL-1.0-only"],
|
|
1745
|
-
["GPL-1", "GPL-1.0-only"],
|
|
1746
|
-
["GPLV2", "GPL-2.0-only"],
|
|
1747
|
-
["GPL-2", "GPL-2.0-only"],
|
|
1748
|
-
["GPL", "GPL-3.0-or-later"],
|
|
1749
|
-
["MIT +NO-FALSE-ATTRIBS", "MITNFA"],
|
|
1750
|
-
["MIT", "MIT"],
|
|
1751
|
-
["MPL", "MPL-2.0"],
|
|
1752
|
-
["X11", "X11"],
|
|
1753
|
-
["ZLIB", "Zlib"]
|
|
1754
|
-
].concat(licensesWithOneVersion).sort(sortTranspositions);
|
|
1755
|
-
var SUBSTRING = 0;
|
|
1756
|
-
var IDENTIFIER = 1;
|
|
1757
|
-
var validTransformation = /* @__PURE__ */ __name(function(identifier) {
|
|
1758
|
-
for (var i = 0; i < transforms.length; i++) {
|
|
1759
|
-
var transformed = transforms[i](identifier).trim();
|
|
1760
|
-
if (transformed !== identifier && valid(transformed)) {
|
|
1761
|
-
return transformed;
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
return null;
|
|
1765
|
-
}, "validTransformation");
|
|
1766
|
-
var validLastResort = /* @__PURE__ */ __name(function(identifier) {
|
|
1767
|
-
var upperCased = identifier.toUpperCase();
|
|
1768
|
-
for (var i = 0; i < lastResorts.length; i++) {
|
|
1769
|
-
var lastResort = lastResorts[i];
|
|
1770
|
-
if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
|
|
1771
|
-
return lastResort[IDENTIFIER];
|
|
1772
|
-
}
|
|
1773
|
-
}
|
|
1774
|
-
return null;
|
|
1775
|
-
}, "validLastResort");
|
|
1776
|
-
var anyCorrection = /* @__PURE__ */ __name(function(identifier, check) {
|
|
1777
|
-
for (var i = 0; i < transpositions.length; i++) {
|
|
1778
|
-
var transposition = transpositions[i];
|
|
1779
|
-
var transposed = transposition[TRANSPOSED];
|
|
1780
|
-
if (identifier.indexOf(transposed) > -1) {
|
|
1781
|
-
var corrected = identifier.replace(
|
|
1782
|
-
transposed,
|
|
1783
|
-
transposition[CORRECT]
|
|
1784
|
-
);
|
|
1785
|
-
var checked = check(corrected);
|
|
1786
|
-
if (checked !== null) {
|
|
1787
|
-
return checked;
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
return null;
|
|
1792
|
-
}, "anyCorrection");
|
|
1793
|
-
module2.exports = function(identifier, options) {
|
|
1794
|
-
options = options || {};
|
|
1795
|
-
var upgrade = options.upgrade === void 0 ? true : !!options.upgrade;
|
|
1796
|
-
function postprocess(value) {
|
|
1797
|
-
return upgrade ? upgradeGPLs(value) : value;
|
|
1798
|
-
}
|
|
1799
|
-
__name(postprocess, "postprocess");
|
|
1800
|
-
var validArugment = typeof identifier === "string" && identifier.trim().length !== 0;
|
|
1801
|
-
if (!validArugment) {
|
|
1802
|
-
throw Error("Invalid argument. Expected non-empty string.");
|
|
1803
|
-
}
|
|
1804
|
-
identifier = identifier.trim();
|
|
1805
|
-
if (valid(identifier)) {
|
|
1806
|
-
return postprocess(identifier);
|
|
1807
|
-
}
|
|
1808
|
-
var noPlus = identifier.replace(/\+$/, "").trim();
|
|
1809
|
-
if (valid(noPlus)) {
|
|
1810
|
-
return postprocess(noPlus);
|
|
1811
|
-
}
|
|
1812
|
-
var transformed = validTransformation(identifier);
|
|
1813
|
-
if (transformed !== null) {
|
|
1814
|
-
return postprocess(transformed);
|
|
1815
|
-
}
|
|
1816
|
-
transformed = anyCorrection(identifier, function(argument) {
|
|
1817
|
-
if (valid(argument)) {
|
|
1818
|
-
return argument;
|
|
1819
|
-
}
|
|
1820
|
-
return validTransformation(argument);
|
|
1821
|
-
});
|
|
1822
|
-
if (transformed !== null) {
|
|
1823
|
-
return postprocess(transformed);
|
|
1824
|
-
}
|
|
1825
|
-
transformed = validLastResort(identifier);
|
|
1826
|
-
if (transformed !== null) {
|
|
1827
|
-
return postprocess(transformed);
|
|
1828
|
-
}
|
|
1829
|
-
transformed = anyCorrection(identifier, validLastResort);
|
|
1830
|
-
if (transformed !== null) {
|
|
1831
|
-
return postprocess(transformed);
|
|
1832
|
-
}
|
|
1833
|
-
return null;
|
|
1834
|
-
};
|
|
1835
|
-
function upgradeGPLs(value) {
|
|
1836
|
-
if ([
|
|
1837
|
-
"GPL-1.0",
|
|
1838
|
-
"LGPL-1.0",
|
|
1839
|
-
"AGPL-1.0",
|
|
1840
|
-
"GPL-2.0",
|
|
1841
|
-
"LGPL-2.0",
|
|
1842
|
-
"AGPL-2.0",
|
|
1843
|
-
"LGPL-2.1"
|
|
1844
|
-
].indexOf(value) !== -1) {
|
|
1845
|
-
return value + "-only";
|
|
1846
|
-
} else if ([
|
|
1847
|
-
"GPL-1.0+",
|
|
1848
|
-
"GPL-2.0+",
|
|
1849
|
-
"GPL-3.0+",
|
|
1850
|
-
"LGPL-2.0+",
|
|
1851
|
-
"LGPL-2.1+",
|
|
1852
|
-
"LGPL-3.0+",
|
|
1853
|
-
"AGPL-1.0+",
|
|
1854
|
-
"AGPL-3.0+"
|
|
1855
|
-
].indexOf(value) !== -1) {
|
|
1856
|
-
return value.replace(/\+$/, "-or-later");
|
|
1857
|
-
} else if (["GPL-3.0", "LGPL-3.0", "AGPL-3.0"].indexOf(value) !== -1) {
|
|
1858
|
-
return value + "-or-later";
|
|
1859
|
-
} else {
|
|
1860
|
-
return value;
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
__name(upgradeGPLs, "upgradeGPLs");
|
|
1864
|
-
}
|
|
1865
|
-
});
|
|
1866
|
-
|
|
1867
|
-
// node_modules/.pnpm/validate-npm-package-license@3.0.4/node_modules/validate-npm-package-license/index.js
|
|
1868
|
-
var require_validate_npm_package_license = __commonJS({
|
|
1869
|
-
"node_modules/.pnpm/validate-npm-package-license@3.0.4/node_modules/validate-npm-package-license/index.js"(exports2, module2) {
|
|
1870
|
-
var parse = require_spdx_expression_parse();
|
|
1871
|
-
var correct = require_spdx_correct();
|
|
1872
|
-
var genericWarning = 'license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"';
|
|
1873
|
-
var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
|
|
1874
|
-
function startsWith(prefix, string) {
|
|
1875
|
-
return string.slice(0, prefix.length) === prefix;
|
|
1876
|
-
}
|
|
1877
|
-
__name(startsWith, "startsWith");
|
|
1878
|
-
function usesLicenseRef(ast) {
|
|
1879
|
-
if (ast.hasOwnProperty("license")) {
|
|
1880
|
-
var license = ast.license;
|
|
1881
|
-
return startsWith("LicenseRef", license) || startsWith("DocumentRef", license);
|
|
1882
|
-
} else {
|
|
1883
|
-
return usesLicenseRef(ast.left) || usesLicenseRef(ast.right);
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
__name(usesLicenseRef, "usesLicenseRef");
|
|
1887
|
-
module2.exports = function(argument) {
|
|
1888
|
-
var ast;
|
|
1889
|
-
try {
|
|
1890
|
-
ast = parse(argument);
|
|
1891
|
-
} catch (e) {
|
|
1892
|
-
var match;
|
|
1893
|
-
if (argument === "UNLICENSED" || argument === "UNLICENCED") {
|
|
1894
|
-
return {
|
|
1895
|
-
validForOldPackages: true,
|
|
1896
|
-
validForNewPackages: true,
|
|
1897
|
-
unlicensed: true
|
|
1898
|
-
};
|
|
1899
|
-
} else if (match = fileReferenceRE.exec(argument)) {
|
|
1900
|
-
return {
|
|
1901
|
-
validForOldPackages: true,
|
|
1902
|
-
validForNewPackages: true,
|
|
1903
|
-
inFile: match[1]
|
|
1904
|
-
};
|
|
1905
|
-
} else {
|
|
1906
|
-
var result = {
|
|
1907
|
-
validForOldPackages: false,
|
|
1908
|
-
validForNewPackages: false,
|
|
1909
|
-
warnings: [genericWarning]
|
|
1910
|
-
};
|
|
1911
|
-
if (argument.trim().length !== 0) {
|
|
1912
|
-
var corrected = correct(argument);
|
|
1913
|
-
if (corrected) {
|
|
1914
|
-
result.warnings.push(
|
|
1915
|
-
'license is similar to the valid expression "' + corrected + '"'
|
|
1916
|
-
);
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
return result;
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
if (usesLicenseRef(ast)) {
|
|
1923
|
-
return {
|
|
1924
|
-
validForNewPackages: false,
|
|
1925
|
-
validForOldPackages: false,
|
|
1926
|
-
spdx: true,
|
|
1927
|
-
warnings: [genericWarning]
|
|
1928
|
-
};
|
|
1929
|
-
} else {
|
|
1930
|
-
return {
|
|
1931
|
-
validForNewPackages: true,
|
|
1932
|
-
validForOldPackages: true,
|
|
1933
|
-
spdx: true
|
|
1934
|
-
};
|
|
1935
|
-
}
|
|
1936
|
-
};
|
|
1937
|
-
}
|
|
1938
|
-
});
|
|
1939
|
-
|
|
1940
|
-
// node_modules/.pnpm/lru-cache@11.2.2/node_modules/lru-cache/dist/commonjs/index.js
|
|
1941
|
-
var require_commonjs = __commonJS({
|
|
1942
|
-
"node_modules/.pnpm/lru-cache@11.2.2/node_modules/lru-cache/dist/commonjs/index.js"(exports2) {
|
|
1943
|
-
"use strict";
|
|
1944
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1945
|
-
exports2.LRUCache = void 0;
|
|
1946
|
-
var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
1947
|
-
var warned = /* @__PURE__ */ new Set();
|
|
1948
|
-
var PROCESS = typeof process === "object" && !!process ? process : {};
|
|
1949
|
-
var emitWarning = /* @__PURE__ */ __name((msg, type, code, fn) => {
|
|
1950
|
-
typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type, code, fn) : void 0;
|
|
1951
|
-
}, "emitWarning");
|
|
1952
|
-
var AC = globalThis.AbortController;
|
|
1953
|
-
var AS = globalThis.AbortSignal;
|
|
1954
|
-
if (typeof AC === "undefined") {
|
|
1955
|
-
AS = class AbortSignal {
|
|
1956
|
-
static {
|
|
1957
|
-
__name(this, "AbortSignal");
|
|
1958
|
-
}
|
|
1959
|
-
onabort;
|
|
1960
|
-
_onabort = [];
|
|
1961
|
-
reason;
|
|
1962
|
-
aborted = false;
|
|
1963
|
-
addEventListener(_, fn) {
|
|
1964
|
-
this._onabort.push(fn);
|
|
1965
|
-
}
|
|
1966
|
-
};
|
|
1967
|
-
AC = class AbortController {
|
|
1968
|
-
static {
|
|
1969
|
-
__name(this, "AbortController");
|
|
1970
|
-
}
|
|
1971
|
-
constructor() {
|
|
1972
|
-
warnACPolyfill();
|
|
1973
|
-
}
|
|
1974
|
-
signal = new AS();
|
|
1975
|
-
abort(reason) {
|
|
1976
|
-
if (this.signal.aborted)
|
|
1977
|
-
return;
|
|
1978
|
-
this.signal.reason = reason;
|
|
1979
|
-
this.signal.aborted = true;
|
|
1980
|
-
for (const fn of this.signal._onabort) {
|
|
1981
|
-
fn(reason);
|
|
1982
|
-
}
|
|
1983
|
-
this.signal.onabort?.(reason);
|
|
1984
|
-
}
|
|
1985
|
-
};
|
|
1986
|
-
let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
1987
|
-
const warnACPolyfill = /* @__PURE__ */ __name(() => {
|
|
1988
|
-
if (!printACPolyfillWarning)
|
|
1989
|
-
return;
|
|
1990
|
-
printACPolyfillWarning = false;
|
|
1991
|
-
emitWarning("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);
|
|
1992
|
-
}, "warnACPolyfill");
|
|
1993
|
-
}
|
|
1994
|
-
var shouldWarn = /* @__PURE__ */ __name((code) => !warned.has(code), "shouldWarn");
|
|
1995
|
-
var TYPE = Symbol("type");
|
|
1996
|
-
var isPosInt = /* @__PURE__ */ __name((n) => n && n === Math.floor(n) && n > 0 && isFinite(n), "isPosInt");
|
|
1997
|
-
var getUintArray = /* @__PURE__ */ __name((max) => !isPosInt(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 ? ZeroArray : null, "getUintArray");
|
|
1998
|
-
var ZeroArray = class extends Array {
|
|
1999
|
-
static {
|
|
2000
|
-
__name(this, "ZeroArray");
|
|
2001
|
-
}
|
|
2002
|
-
constructor(size) {
|
|
2003
|
-
super(size);
|
|
2004
|
-
this.fill(0);
|
|
2005
|
-
}
|
|
2006
|
-
};
|
|
2007
|
-
var Stack = class _Stack {
|
|
2008
|
-
static {
|
|
2009
|
-
__name(this, "Stack");
|
|
2010
|
-
}
|
|
2011
|
-
heap;
|
|
2012
|
-
length;
|
|
2013
|
-
// private constructor
|
|
2014
|
-
static #constructing = false;
|
|
2015
|
-
static create(max) {
|
|
2016
|
-
const HeapCls = getUintArray(max);
|
|
2017
|
-
if (!HeapCls)
|
|
2018
|
-
return [];
|
|
2019
|
-
_Stack.#constructing = true;
|
|
2020
|
-
const s = new _Stack(max, HeapCls);
|
|
2021
|
-
_Stack.#constructing = false;
|
|
2022
|
-
return s;
|
|
2023
|
-
}
|
|
2024
|
-
constructor(max, HeapCls) {
|
|
2025
|
-
if (!_Stack.#constructing) {
|
|
2026
|
-
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
2027
|
-
}
|
|
2028
|
-
this.heap = new HeapCls(max);
|
|
2029
|
-
this.length = 0;
|
|
2030
|
-
}
|
|
2031
|
-
push(n) {
|
|
2032
|
-
this.heap[this.length++] = n;
|
|
2033
|
-
}
|
|
2034
|
-
pop() {
|
|
2035
|
-
return this.heap[--this.length];
|
|
2036
|
-
}
|
|
2037
|
-
};
|
|
2038
|
-
var LRUCache = class _LRUCache {
|
|
2039
|
-
static {
|
|
2040
|
-
__name(this, "LRUCache");
|
|
2041
|
-
}
|
|
2042
|
-
// options that cannot be changed without disaster
|
|
2043
|
-
#max;
|
|
2044
|
-
#maxSize;
|
|
2045
|
-
#dispose;
|
|
2046
|
-
#onInsert;
|
|
2047
|
-
#disposeAfter;
|
|
2048
|
-
#fetchMethod;
|
|
2049
|
-
#memoMethod;
|
|
2050
|
-
#perf;
|
|
2051
|
-
/**
|
|
2052
|
-
* {@link LRUCache.OptionsBase.perf}
|
|
2053
|
-
*/
|
|
2054
|
-
get perf() {
|
|
2055
|
-
return this.#perf;
|
|
2056
|
-
}
|
|
2057
|
-
/**
|
|
2058
|
-
* {@link LRUCache.OptionsBase.ttl}
|
|
2059
|
-
*/
|
|
2060
|
-
ttl;
|
|
2061
|
-
/**
|
|
2062
|
-
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
2063
|
-
*/
|
|
2064
|
-
ttlResolution;
|
|
2065
|
-
/**
|
|
2066
|
-
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
2067
|
-
*/
|
|
2068
|
-
ttlAutopurge;
|
|
2069
|
-
/**
|
|
2070
|
-
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
2071
|
-
*/
|
|
2072
|
-
updateAgeOnGet;
|
|
2073
|
-
/**
|
|
2074
|
-
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
2075
|
-
*/
|
|
2076
|
-
updateAgeOnHas;
|
|
2077
|
-
/**
|
|
2078
|
-
* {@link LRUCache.OptionsBase.allowStale}
|
|
2079
|
-
*/
|
|
2080
|
-
allowStale;
|
|
2081
|
-
/**
|
|
2082
|
-
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
2083
|
-
*/
|
|
2084
|
-
noDisposeOnSet;
|
|
2085
|
-
/**
|
|
2086
|
-
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
2087
|
-
*/
|
|
2088
|
-
noUpdateTTL;
|
|
2089
|
-
/**
|
|
2090
|
-
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
2091
|
-
*/
|
|
2092
|
-
maxEntrySize;
|
|
2093
|
-
/**
|
|
2094
|
-
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
2095
|
-
*/
|
|
2096
|
-
sizeCalculation;
|
|
2097
|
-
/**
|
|
2098
|
-
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
2099
|
-
*/
|
|
2100
|
-
noDeleteOnFetchRejection;
|
|
2101
|
-
/**
|
|
2102
|
-
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
2103
|
-
*/
|
|
2104
|
-
noDeleteOnStaleGet;
|
|
2105
|
-
/**
|
|
2106
|
-
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
2107
|
-
*/
|
|
2108
|
-
allowStaleOnFetchAbort;
|
|
2109
|
-
/**
|
|
2110
|
-
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
2111
|
-
*/
|
|
2112
|
-
allowStaleOnFetchRejection;
|
|
2113
|
-
/**
|
|
2114
|
-
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
2115
|
-
*/
|
|
2116
|
-
ignoreFetchAbort;
|
|
2117
|
-
// computed properties
|
|
2118
|
-
#size;
|
|
2119
|
-
#calculatedSize;
|
|
2120
|
-
#keyMap;
|
|
2121
|
-
#keyList;
|
|
2122
|
-
#valList;
|
|
2123
|
-
#next;
|
|
2124
|
-
#prev;
|
|
2125
|
-
#head;
|
|
2126
|
-
#tail;
|
|
2127
|
-
#free;
|
|
2128
|
-
#disposed;
|
|
2129
|
-
#sizes;
|
|
2130
|
-
#starts;
|
|
2131
|
-
#ttls;
|
|
2132
|
-
#hasDispose;
|
|
2133
|
-
#hasFetchMethod;
|
|
2134
|
-
#hasDisposeAfter;
|
|
2135
|
-
#hasOnInsert;
|
|
2136
|
-
/**
|
|
2137
|
-
* Do not call this method unless you need to inspect the
|
|
2138
|
-
* inner workings of the cache. If anything returned by this
|
|
2139
|
-
* object is modified in any way, strange breakage may occur.
|
|
2140
|
-
*
|
|
2141
|
-
* These fields are private for a reason!
|
|
2142
|
-
*
|
|
2143
|
-
* @internal
|
|
2144
|
-
*/
|
|
2145
|
-
static unsafeExposeInternals(c) {
|
|
2146
|
-
return {
|
|
2147
|
-
// properties
|
|
2148
|
-
starts: c.#starts,
|
|
2149
|
-
ttls: c.#ttls,
|
|
2150
|
-
sizes: c.#sizes,
|
|
2151
|
-
keyMap: c.#keyMap,
|
|
2152
|
-
keyList: c.#keyList,
|
|
2153
|
-
valList: c.#valList,
|
|
2154
|
-
next: c.#next,
|
|
2155
|
-
prev: c.#prev,
|
|
2156
|
-
get head() {
|
|
2157
|
-
return c.#head;
|
|
2158
|
-
},
|
|
2159
|
-
get tail() {
|
|
2160
|
-
return c.#tail;
|
|
2161
|
-
},
|
|
2162
|
-
free: c.#free,
|
|
2163
|
-
// methods
|
|
2164
|
-
isBackgroundFetch: /* @__PURE__ */ __name((p) => c.#isBackgroundFetch(p), "isBackgroundFetch"),
|
|
2165
|
-
backgroundFetch: /* @__PURE__ */ __name((k, index, options, context) => c.#backgroundFetch(k, index, options, context), "backgroundFetch"),
|
|
2166
|
-
moveToTail: /* @__PURE__ */ __name((index) => c.#moveToTail(index), "moveToTail"),
|
|
2167
|
-
indexes: /* @__PURE__ */ __name((options) => c.#indexes(options), "indexes"),
|
|
2168
|
-
rindexes: /* @__PURE__ */ __name((options) => c.#rindexes(options), "rindexes"),
|
|
2169
|
-
isStale: /* @__PURE__ */ __name((index) => c.#isStale(index), "isStale")
|
|
2170
|
-
};
|
|
2171
|
-
}
|
|
2172
|
-
// Protected read-only members
|
|
2173
|
-
/**
|
|
2174
|
-
* {@link LRUCache.OptionsBase.max} (read-only)
|
|
2175
|
-
*/
|
|
2176
|
-
get max() {
|
|
2177
|
-
return this.#max;
|
|
2178
|
-
}
|
|
2179
|
-
/**
|
|
2180
|
-
* {@link LRUCache.OptionsBase.maxSize} (read-only)
|
|
2181
|
-
*/
|
|
2182
|
-
get maxSize() {
|
|
2183
|
-
return this.#maxSize;
|
|
2184
|
-
}
|
|
2185
|
-
/**
|
|
2186
|
-
* The total computed size of items in the cache (read-only)
|
|
2187
|
-
*/
|
|
2188
|
-
get calculatedSize() {
|
|
2189
|
-
return this.#calculatedSize;
|
|
2190
|
-
}
|
|
2191
|
-
/**
|
|
2192
|
-
* The number of items stored in the cache (read-only)
|
|
2193
|
-
*/
|
|
2194
|
-
get size() {
|
|
2195
|
-
return this.#size;
|
|
2196
|
-
}
|
|
2197
|
-
/**
|
|
2198
|
-
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
2199
|
-
*/
|
|
2200
|
-
get fetchMethod() {
|
|
2201
|
-
return this.#fetchMethod;
|
|
2202
|
-
}
|
|
2203
|
-
get memoMethod() {
|
|
2204
|
-
return this.#memoMethod;
|
|
2205
|
-
}
|
|
2206
|
-
/**
|
|
2207
|
-
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
2208
|
-
*/
|
|
2209
|
-
get dispose() {
|
|
2210
|
-
return this.#dispose;
|
|
2211
|
-
}
|
|
2212
|
-
/**
|
|
2213
|
-
* {@link LRUCache.OptionsBase.onInsert} (read-only)
|
|
2214
|
-
*/
|
|
2215
|
-
get onInsert() {
|
|
2216
|
-
return this.#onInsert;
|
|
2217
|
-
}
|
|
2218
|
-
/**
|
|
2219
|
-
* {@link LRUCache.OptionsBase.disposeAfter} (read-only)
|
|
2220
|
-
*/
|
|
2221
|
-
get disposeAfter() {
|
|
2222
|
-
return this.#disposeAfter;
|
|
2223
|
-
}
|
|
2224
|
-
constructor(options) {
|
|
2225
|
-
const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf } = options;
|
|
2226
|
-
if (perf !== void 0) {
|
|
2227
|
-
if (typeof perf?.now !== "function") {
|
|
2228
|
-
throw new TypeError("perf option must have a now() method if specified");
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
this.#perf = perf ?? defaultPerf;
|
|
2232
|
-
if (max !== 0 && !isPosInt(max)) {
|
|
2233
|
-
throw new TypeError("max option must be a nonnegative integer");
|
|
2234
|
-
}
|
|
2235
|
-
const UintArray = max ? getUintArray(max) : Array;
|
|
2236
|
-
if (!UintArray) {
|
|
2237
|
-
throw new Error("invalid max value: " + max);
|
|
2238
|
-
}
|
|
2239
|
-
this.#max = max;
|
|
2240
|
-
this.#maxSize = maxSize;
|
|
2241
|
-
this.maxEntrySize = maxEntrySize || this.#maxSize;
|
|
2242
|
-
this.sizeCalculation = sizeCalculation;
|
|
2243
|
-
if (this.sizeCalculation) {
|
|
2244
|
-
if (!this.#maxSize && !this.maxEntrySize) {
|
|
2245
|
-
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
2246
|
-
}
|
|
2247
|
-
if (typeof this.sizeCalculation !== "function") {
|
|
2248
|
-
throw new TypeError("sizeCalculation set to non-function");
|
|
2249
|
-
}
|
|
2250
|
-
}
|
|
2251
|
-
if (memoMethod !== void 0 && typeof memoMethod !== "function") {
|
|
2252
|
-
throw new TypeError("memoMethod must be a function if defined");
|
|
2253
|
-
}
|
|
2254
|
-
this.#memoMethod = memoMethod;
|
|
2255
|
-
if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
|
|
2256
|
-
throw new TypeError("fetchMethod must be a function if specified");
|
|
2257
|
-
}
|
|
2258
|
-
this.#fetchMethod = fetchMethod;
|
|
2259
|
-
this.#hasFetchMethod = !!fetchMethod;
|
|
2260
|
-
this.#keyMap = /* @__PURE__ */ new Map();
|
|
2261
|
-
this.#keyList = new Array(max).fill(void 0);
|
|
2262
|
-
this.#valList = new Array(max).fill(void 0);
|
|
2263
|
-
this.#next = new UintArray(max);
|
|
2264
|
-
this.#prev = new UintArray(max);
|
|
2265
|
-
this.#head = 0;
|
|
2266
|
-
this.#tail = 0;
|
|
2267
|
-
this.#free = Stack.create(max);
|
|
2268
|
-
this.#size = 0;
|
|
2269
|
-
this.#calculatedSize = 0;
|
|
2270
|
-
if (typeof dispose === "function") {
|
|
2271
|
-
this.#dispose = dispose;
|
|
2272
|
-
}
|
|
2273
|
-
if (typeof onInsert === "function") {
|
|
2274
|
-
this.#onInsert = onInsert;
|
|
2275
|
-
}
|
|
2276
|
-
if (typeof disposeAfter === "function") {
|
|
2277
|
-
this.#disposeAfter = disposeAfter;
|
|
2278
|
-
this.#disposed = [];
|
|
2279
|
-
} else {
|
|
2280
|
-
this.#disposeAfter = void 0;
|
|
2281
|
-
this.#disposed = void 0;
|
|
2282
|
-
}
|
|
2283
|
-
this.#hasDispose = !!this.#dispose;
|
|
2284
|
-
this.#hasOnInsert = !!this.#onInsert;
|
|
2285
|
-
this.#hasDisposeAfter = !!this.#disposeAfter;
|
|
2286
|
-
this.noDisposeOnSet = !!noDisposeOnSet;
|
|
2287
|
-
this.noUpdateTTL = !!noUpdateTTL;
|
|
2288
|
-
this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
|
|
2289
|
-
this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
|
|
2290
|
-
this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
|
|
2291
|
-
this.ignoreFetchAbort = !!ignoreFetchAbort;
|
|
2292
|
-
if (this.maxEntrySize !== 0) {
|
|
2293
|
-
if (this.#maxSize !== 0) {
|
|
2294
|
-
if (!isPosInt(this.#maxSize)) {
|
|
2295
|
-
throw new TypeError("maxSize must be a positive integer if specified");
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
if (!isPosInt(this.maxEntrySize)) {
|
|
2299
|
-
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
2300
|
-
}
|
|
2301
|
-
this.#initializeSizeTracking();
|
|
2302
|
-
}
|
|
2303
|
-
this.allowStale = !!allowStale;
|
|
2304
|
-
this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
|
|
2305
|
-
this.updateAgeOnGet = !!updateAgeOnGet;
|
|
2306
|
-
this.updateAgeOnHas = !!updateAgeOnHas;
|
|
2307
|
-
this.ttlResolution = isPosInt(ttlResolution) || ttlResolution === 0 ? ttlResolution : 1;
|
|
2308
|
-
this.ttlAutopurge = !!ttlAutopurge;
|
|
2309
|
-
this.ttl = ttl || 0;
|
|
2310
|
-
if (this.ttl) {
|
|
2311
|
-
if (!isPosInt(this.ttl)) {
|
|
2312
|
-
throw new TypeError("ttl must be a positive integer if specified");
|
|
2313
|
-
}
|
|
2314
|
-
this.#initializeTTLTracking();
|
|
2315
|
-
}
|
|
2316
|
-
if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
|
|
2317
|
-
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
2318
|
-
}
|
|
2319
|
-
if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
|
|
2320
|
-
const code = "LRU_CACHE_UNBOUNDED";
|
|
2321
|
-
if (shouldWarn(code)) {
|
|
2322
|
-
warned.add(code);
|
|
2323
|
-
const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
|
|
2324
|
-
emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache);
|
|
2325
|
-
}
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
/**
|
|
2329
|
-
* Return the number of ms left in the item's TTL. If item is not in cache,
|
|
2330
|
-
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
2331
|
-
*/
|
|
2332
|
-
getRemainingTTL(key) {
|
|
2333
|
-
return this.#keyMap.has(key) ? Infinity : 0;
|
|
2334
|
-
}
|
|
2335
|
-
#initializeTTLTracking() {
|
|
2336
|
-
const ttls = new ZeroArray(this.#max);
|
|
2337
|
-
const starts = new ZeroArray(this.#max);
|
|
2338
|
-
this.#ttls = ttls;
|
|
2339
|
-
this.#starts = starts;
|
|
2340
|
-
this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {
|
|
2341
|
-
starts[index] = ttl !== 0 ? start : 0;
|
|
2342
|
-
ttls[index] = ttl;
|
|
2343
|
-
if (ttl !== 0 && this.ttlAutopurge) {
|
|
2344
|
-
const t = setTimeout(() => {
|
|
2345
|
-
if (this.#isStale(index)) {
|
|
2346
|
-
this.#delete(this.#keyList[index], "expire");
|
|
2347
|
-
}
|
|
2348
|
-
}, ttl + 1);
|
|
2349
|
-
if (t.unref) {
|
|
2350
|
-
t.unref();
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
};
|
|
2354
|
-
this.#updateItemAge = (index) => {
|
|
2355
|
-
starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;
|
|
2356
|
-
};
|
|
2357
|
-
this.#statusTTL = (status, index) => {
|
|
2358
|
-
if (ttls[index]) {
|
|
2359
|
-
const ttl = ttls[index];
|
|
2360
|
-
const start = starts[index];
|
|
2361
|
-
if (!ttl || !start)
|
|
2362
|
-
return;
|
|
2363
|
-
status.ttl = ttl;
|
|
2364
|
-
status.start = start;
|
|
2365
|
-
status.now = cachedNow || getNow();
|
|
2366
|
-
const age = status.now - start;
|
|
2367
|
-
status.remainingTTL = ttl - age;
|
|
2368
|
-
}
|
|
2369
|
-
};
|
|
2370
|
-
let cachedNow = 0;
|
|
2371
|
-
const getNow = /* @__PURE__ */ __name(() => {
|
|
2372
|
-
const n = this.#perf.now();
|
|
2373
|
-
if (this.ttlResolution > 0) {
|
|
2374
|
-
cachedNow = n;
|
|
2375
|
-
const t = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
2376
|
-
if (t.unref) {
|
|
2377
|
-
t.unref();
|
|
2378
|
-
}
|
|
2379
|
-
}
|
|
2380
|
-
return n;
|
|
2381
|
-
}, "getNow");
|
|
2382
|
-
this.getRemainingTTL = (key) => {
|
|
2383
|
-
const index = this.#keyMap.get(key);
|
|
2384
|
-
if (index === void 0) {
|
|
2385
|
-
return 0;
|
|
2386
|
-
}
|
|
2387
|
-
const ttl = ttls[index];
|
|
2388
|
-
const start = starts[index];
|
|
2389
|
-
if (!ttl || !start) {
|
|
2390
|
-
return Infinity;
|
|
2391
|
-
}
|
|
2392
|
-
const age = (cachedNow || getNow()) - start;
|
|
2393
|
-
return ttl - age;
|
|
2394
|
-
};
|
|
2395
|
-
this.#isStale = (index) => {
|
|
2396
|
-
const s = starts[index];
|
|
2397
|
-
const t = ttls[index];
|
|
2398
|
-
return !!t && !!s && (cachedNow || getNow()) - s > t;
|
|
2399
|
-
};
|
|
2400
|
-
}
|
|
2401
|
-
// conditionally set private methods related to TTL
|
|
2402
|
-
#updateItemAge = /* @__PURE__ */ __name(() => {
|
|
2403
|
-
}, "#updateItemAge");
|
|
2404
|
-
#statusTTL = /* @__PURE__ */ __name(() => {
|
|
2405
|
-
}, "#statusTTL");
|
|
2406
|
-
#setItemTTL = /* @__PURE__ */ __name(() => {
|
|
2407
|
-
}, "#setItemTTL");
|
|
2408
|
-
/* c8 ignore stop */
|
|
2409
|
-
#isStale = /* @__PURE__ */ __name(() => false, "#isStale");
|
|
2410
|
-
#initializeSizeTracking() {
|
|
2411
|
-
const sizes = new ZeroArray(this.#max);
|
|
2412
|
-
this.#calculatedSize = 0;
|
|
2413
|
-
this.#sizes = sizes;
|
|
2414
|
-
this.#removeItemSize = (index) => {
|
|
2415
|
-
this.#calculatedSize -= sizes[index];
|
|
2416
|
-
sizes[index] = 0;
|
|
2417
|
-
};
|
|
2418
|
-
this.#requireSize = (k, v, size, sizeCalculation) => {
|
|
2419
|
-
if (this.#isBackgroundFetch(v)) {
|
|
2420
|
-
return 0;
|
|
2421
|
-
}
|
|
2422
|
-
if (!isPosInt(size)) {
|
|
2423
|
-
if (sizeCalculation) {
|
|
2424
|
-
if (typeof sizeCalculation !== "function") {
|
|
2425
|
-
throw new TypeError("sizeCalculation must be a function");
|
|
2426
|
-
}
|
|
2427
|
-
size = sizeCalculation(v, k);
|
|
2428
|
-
if (!isPosInt(size)) {
|
|
2429
|
-
throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
2430
|
-
}
|
|
2431
|
-
} else {
|
|
2432
|
-
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
2433
|
-
}
|
|
2434
|
-
}
|
|
2435
|
-
return size;
|
|
2436
|
-
};
|
|
2437
|
-
this.#addItemSize = (index, size, status) => {
|
|
2438
|
-
sizes[index] = size;
|
|
2439
|
-
if (this.#maxSize) {
|
|
2440
|
-
const maxSize = this.#maxSize - sizes[index];
|
|
2441
|
-
while (this.#calculatedSize > maxSize) {
|
|
2442
|
-
this.#evict(true);
|
|
2443
|
-
}
|
|
2444
|
-
}
|
|
2445
|
-
this.#calculatedSize += sizes[index];
|
|
2446
|
-
if (status) {
|
|
2447
|
-
status.entrySize = size;
|
|
2448
|
-
status.totalCalculatedSize = this.#calculatedSize;
|
|
2449
|
-
}
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2452
|
-
#removeItemSize = /* @__PURE__ */ __name((_i) => {
|
|
2453
|
-
}, "#removeItemSize");
|
|
2454
|
-
#addItemSize = /* @__PURE__ */ __name((_i, _s, _st) => {
|
|
2455
|
-
}, "#addItemSize");
|
|
2456
|
-
#requireSize = /* @__PURE__ */ __name((_k, _v, size, sizeCalculation) => {
|
|
2457
|
-
if (size || sizeCalculation) {
|
|
2458
|
-
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
2459
|
-
}
|
|
2460
|
-
return 0;
|
|
2461
|
-
}, "#requireSize");
|
|
2462
|
-
*#indexes({ allowStale = this.allowStale } = {}) {
|
|
2463
|
-
if (this.#size) {
|
|
2464
|
-
for (let i = this.#tail; true; ) {
|
|
2465
|
-
if (!this.#isValidIndex(i)) {
|
|
2466
|
-
break;
|
|
2467
|
-
}
|
|
2468
|
-
if (allowStale || !this.#isStale(i)) {
|
|
2469
|
-
yield i;
|
|
2470
|
-
}
|
|
2471
|
-
if (i === this.#head) {
|
|
2472
|
-
break;
|
|
2473
|
-
} else {
|
|
2474
|
-
i = this.#prev[i];
|
|
2475
|
-
}
|
|
2476
|
-
}
|
|
2477
|
-
}
|
|
2478
|
-
}
|
|
2479
|
-
*#rindexes({ allowStale = this.allowStale } = {}) {
|
|
2480
|
-
if (this.#size) {
|
|
2481
|
-
for (let i = this.#head; true; ) {
|
|
2482
|
-
if (!this.#isValidIndex(i)) {
|
|
2483
|
-
break;
|
|
2484
|
-
}
|
|
2485
|
-
if (allowStale || !this.#isStale(i)) {
|
|
2486
|
-
yield i;
|
|
2487
|
-
}
|
|
2488
|
-
if (i === this.#tail) {
|
|
2489
|
-
break;
|
|
2490
|
-
} else {
|
|
2491
|
-
i = this.#next[i];
|
|
2492
|
-
}
|
|
2493
|
-
}
|
|
2494
|
-
}
|
|
2495
|
-
}
|
|
2496
|
-
#isValidIndex(index) {
|
|
2497
|
-
return index !== void 0 && this.#keyMap.get(this.#keyList[index]) === index;
|
|
2498
|
-
}
|
|
2499
|
-
/**
|
|
2500
|
-
* Return a generator yielding `[key, value]` pairs,
|
|
2501
|
-
* in order from most recently used to least recently used.
|
|
2502
|
-
*/
|
|
2503
|
-
*entries() {
|
|
2504
|
-
for (const i of this.#indexes()) {
|
|
2505
|
-
if (this.#valList[i] !== void 0 && this.#keyList[i] !== void 0 && !this.#isBackgroundFetch(this.#valList[i])) {
|
|
2506
|
-
yield [this.#keyList[i], this.#valList[i]];
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
}
|
|
2510
|
-
/**
|
|
2511
|
-
* Inverse order version of {@link LRUCache.entries}
|
|
2512
|
-
*
|
|
2513
|
-
* Return a generator yielding `[key, value]` pairs,
|
|
2514
|
-
* in order from least recently used to most recently used.
|
|
2515
|
-
*/
|
|
2516
|
-
*rentries() {
|
|
2517
|
-
for (const i of this.#rindexes()) {
|
|
2518
|
-
if (this.#valList[i] !== void 0 && this.#keyList[i] !== void 0 && !this.#isBackgroundFetch(this.#valList[i])) {
|
|
2519
|
-
yield [this.#keyList[i], this.#valList[i]];
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
/**
|
|
2524
|
-
* Return a generator yielding the keys in the cache,
|
|
2525
|
-
* in order from most recently used to least recently used.
|
|
2526
|
-
*/
|
|
2527
|
-
*keys() {
|
|
2528
|
-
for (const i of this.#indexes()) {
|
|
2529
|
-
const k = this.#keyList[i];
|
|
2530
|
-
if (k !== void 0 && !this.#isBackgroundFetch(this.#valList[i])) {
|
|
2531
|
-
yield k;
|
|
2532
|
-
}
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
/**
|
|
2536
|
-
* Inverse order version of {@link LRUCache.keys}
|
|
2537
|
-
*
|
|
2538
|
-
* Return a generator yielding the keys in the cache,
|
|
2539
|
-
* in order from least recently used to most recently used.
|
|
2540
|
-
*/
|
|
2541
|
-
*rkeys() {
|
|
2542
|
-
for (const i of this.#rindexes()) {
|
|
2543
|
-
const k = this.#keyList[i];
|
|
2544
|
-
if (k !== void 0 && !this.#isBackgroundFetch(this.#valList[i])) {
|
|
2545
|
-
yield k;
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
/**
|
|
2550
|
-
* Return a generator yielding the values in the cache,
|
|
2551
|
-
* in order from most recently used to least recently used.
|
|
2552
|
-
*/
|
|
2553
|
-
*values() {
|
|
2554
|
-
for (const i of this.#indexes()) {
|
|
2555
|
-
const v = this.#valList[i];
|
|
2556
|
-
if (v !== void 0 && !this.#isBackgroundFetch(this.#valList[i])) {
|
|
2557
|
-
yield this.#valList[i];
|
|
2558
|
-
}
|
|
2559
|
-
}
|
|
2560
|
-
}
|
|
2561
|
-
/**
|
|
2562
|
-
* Inverse order version of {@link LRUCache.values}
|
|
2563
|
-
*
|
|
2564
|
-
* Return a generator yielding the values in the cache,
|
|
2565
|
-
* in order from least recently used to most recently used.
|
|
2566
|
-
*/
|
|
2567
|
-
*rvalues() {
|
|
2568
|
-
for (const i of this.#rindexes()) {
|
|
2569
|
-
const v = this.#valList[i];
|
|
2570
|
-
if (v !== void 0 && !this.#isBackgroundFetch(this.#valList[i])) {
|
|
2571
|
-
yield this.#valList[i];
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
/**
|
|
2576
|
-
* Iterating over the cache itself yields the same results as
|
|
2577
|
-
* {@link LRUCache.entries}
|
|
2578
|
-
*/
|
|
2579
|
-
[Symbol.iterator]() {
|
|
2580
|
-
return this.entries();
|
|
2581
|
-
}
|
|
2582
|
-
/**
|
|
2583
|
-
* A String value that is used in the creation of the default string
|
|
2584
|
-
* description of an object. Called by the built-in method
|
|
2585
|
-
* `Object.prototype.toString`.
|
|
2586
|
-
*/
|
|
2587
|
-
[Symbol.toStringTag] = "LRUCache";
|
|
2588
|
-
/**
|
|
2589
|
-
* Find a value for which the supplied fn method returns a truthy value,
|
|
2590
|
-
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
|
|
2591
|
-
*/
|
|
2592
|
-
find(fn, getOptions = {}) {
|
|
2593
|
-
for (const i of this.#indexes()) {
|
|
2594
|
-
const v = this.#valList[i];
|
|
2595
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
2596
|
-
if (value === void 0)
|
|
2597
|
-
continue;
|
|
2598
|
-
if (fn(value, this.#keyList[i], this)) {
|
|
2599
|
-
return this.get(this.#keyList[i], getOptions);
|
|
2600
|
-
}
|
|
2601
|
-
}
|
|
2602
|
-
}
|
|
2603
|
-
/**
|
|
2604
|
-
* Call the supplied function on each item in the cache, in order from most
|
|
2605
|
-
* recently used to least recently used.
|
|
2606
|
-
*
|
|
2607
|
-
* `fn` is called as `fn(value, key, cache)`.
|
|
2608
|
-
*
|
|
2609
|
-
* If `thisp` is provided, function will be called in the `this`-context of
|
|
2610
|
-
* the provided object, or the cache if no `thisp` object is provided.
|
|
2611
|
-
*
|
|
2612
|
-
* Does not update age or recenty of use, or iterate over stale values.
|
|
2613
|
-
*/
|
|
2614
|
-
forEach(fn, thisp = this) {
|
|
2615
|
-
for (const i of this.#indexes()) {
|
|
2616
|
-
const v = this.#valList[i];
|
|
2617
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
2618
|
-
if (value === void 0)
|
|
2619
|
-
continue;
|
|
2620
|
-
fn.call(thisp, value, this.#keyList[i], this);
|
|
2621
|
-
}
|
|
2622
|
-
}
|
|
2623
|
-
/**
|
|
2624
|
-
* The same as {@link LRUCache.forEach} but items are iterated over in
|
|
2625
|
-
* reverse order. (ie, less recently used items are iterated over first.)
|
|
2626
|
-
*/
|
|
2627
|
-
rforEach(fn, thisp = this) {
|
|
2628
|
-
for (const i of this.#rindexes()) {
|
|
2629
|
-
const v = this.#valList[i];
|
|
2630
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
2631
|
-
if (value === void 0)
|
|
2632
|
-
continue;
|
|
2633
|
-
fn.call(thisp, value, this.#keyList[i], this);
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
/**
|
|
2637
|
-
* Delete any stale entries. Returns true if anything was removed,
|
|
2638
|
-
* false otherwise.
|
|
2639
|
-
*/
|
|
2640
|
-
purgeStale() {
|
|
2641
|
-
let deleted = false;
|
|
2642
|
-
for (const i of this.#rindexes({ allowStale: true })) {
|
|
2643
|
-
if (this.#isStale(i)) {
|
|
2644
|
-
this.#delete(this.#keyList[i], "expire");
|
|
2645
|
-
deleted = true;
|
|
2646
|
-
}
|
|
2647
|
-
}
|
|
2648
|
-
return deleted;
|
|
2649
|
-
}
|
|
2650
|
-
/**
|
|
2651
|
-
* Get the extended info about a given entry, to get its value, size, and
|
|
2652
|
-
* TTL info simultaneously. Returns `undefined` if the key is not present.
|
|
2653
|
-
*
|
|
2654
|
-
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
|
|
2655
|
-
* serialization, the `start` value is always the current timestamp, and the
|
|
2656
|
-
* `ttl` is a calculated remaining time to live (negative if expired).
|
|
2657
|
-
*
|
|
2658
|
-
* Always returns stale values, if their info is found in the cache, so be
|
|
2659
|
-
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
|
|
2660
|
-
* if relevant.
|
|
2661
|
-
*/
|
|
2662
|
-
info(key) {
|
|
2663
|
-
const i = this.#keyMap.get(key);
|
|
2664
|
-
if (i === void 0)
|
|
2665
|
-
return void 0;
|
|
2666
|
-
const v = this.#valList[i];
|
|
2667
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
2668
|
-
if (value === void 0)
|
|
2669
|
-
return void 0;
|
|
2670
|
-
const entry = { value };
|
|
2671
|
-
if (this.#ttls && this.#starts) {
|
|
2672
|
-
const ttl = this.#ttls[i];
|
|
2673
|
-
const start = this.#starts[i];
|
|
2674
|
-
if (ttl && start) {
|
|
2675
|
-
const remain = ttl - (this.#perf.now() - start);
|
|
2676
|
-
entry.ttl = remain;
|
|
2677
|
-
entry.start = Date.now();
|
|
2678
|
-
}
|
|
2679
|
-
}
|
|
2680
|
-
if (this.#sizes) {
|
|
2681
|
-
entry.size = this.#sizes[i];
|
|
2682
|
-
}
|
|
2683
|
-
return entry;
|
|
2684
|
-
}
|
|
2685
|
-
/**
|
|
2686
|
-
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
2687
|
-
* passed to {@link LRUCache#load}.
|
|
2688
|
-
*
|
|
2689
|
-
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
2690
|
-
* timestamp, even if `performance.now()` is available.
|
|
2691
|
-
*
|
|
2692
|
-
* Stale entries are always included in the `dump`, even if
|
|
2693
|
-
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
2694
|
-
*
|
|
2695
|
-
* Note: this returns an actual array, not a generator, so it can be more
|
|
2696
|
-
* easily passed around.
|
|
2697
|
-
*/
|
|
2698
|
-
dump() {
|
|
2699
|
-
const arr = [];
|
|
2700
|
-
for (const i of this.#indexes({ allowStale: true })) {
|
|
2701
|
-
const key = this.#keyList[i];
|
|
2702
|
-
const v = this.#valList[i];
|
|
2703
|
-
const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
2704
|
-
if (value === void 0 || key === void 0)
|
|
2705
|
-
continue;
|
|
2706
|
-
const entry = { value };
|
|
2707
|
-
if (this.#ttls && this.#starts) {
|
|
2708
|
-
entry.ttl = this.#ttls[i];
|
|
2709
|
-
const age = this.#perf.now() - this.#starts[i];
|
|
2710
|
-
entry.start = Math.floor(Date.now() - age);
|
|
2711
|
-
}
|
|
2712
|
-
if (this.#sizes) {
|
|
2713
|
-
entry.size = this.#sizes[i];
|
|
2714
|
-
}
|
|
2715
|
-
arr.unshift([key, entry]);
|
|
2716
|
-
}
|
|
2717
|
-
return arr;
|
|
2718
|
-
}
|
|
2719
|
-
/**
|
|
2720
|
-
* Reset the cache and load in the items in entries in the order listed.
|
|
2721
|
-
*
|
|
2722
|
-
* The shape of the resulting cache may be different if the same options are
|
|
2723
|
-
* not used in both caches.
|
|
2724
|
-
*
|
|
2725
|
-
* The `start` fields are assumed to be calculated relative to a portable
|
|
2726
|
-
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
2727
|
-
*/
|
|
2728
|
-
load(arr) {
|
|
2729
|
-
this.clear();
|
|
2730
|
-
for (const [key, entry] of arr) {
|
|
2731
|
-
if (entry.start) {
|
|
2732
|
-
const age = Date.now() - entry.start;
|
|
2733
|
-
entry.start = this.#perf.now() - age;
|
|
2734
|
-
}
|
|
2735
|
-
this.set(key, entry.value, entry);
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
/**
|
|
2739
|
-
* Add a value to the cache.
|
|
2740
|
-
*
|
|
2741
|
-
* Note: if `undefined` is specified as a value, this is an alias for
|
|
2742
|
-
* {@link LRUCache#delete}
|
|
2743
|
-
*
|
|
2744
|
-
* Fields on the {@link LRUCache.SetOptions} options param will override
|
|
2745
|
-
* their corresponding values in the constructor options for the scope
|
|
2746
|
-
* of this single `set()` operation.
|
|
2747
|
-
*
|
|
2748
|
-
* If `start` is provided, then that will set the effective start
|
|
2749
|
-
* time for the TTL calculation. Note that this must be a previous
|
|
2750
|
-
* value of `performance.now()` if supported, or a previous value of
|
|
2751
|
-
* `Date.now()` if not.
|
|
2752
|
-
*
|
|
2753
|
-
* Options object may also include `size`, which will prevent
|
|
2754
|
-
* calling the `sizeCalculation` function and just use the specified
|
|
2755
|
-
* number if it is a positive integer, and `noDisposeOnSet` which
|
|
2756
|
-
* will prevent calling a `dispose` function in the case of
|
|
2757
|
-
* overwrites.
|
|
2758
|
-
*
|
|
2759
|
-
* If the `size` (or return value of `sizeCalculation`) for a given
|
|
2760
|
-
* entry is greater than `maxEntrySize`, then the item will not be
|
|
2761
|
-
* added to the cache.
|
|
2762
|
-
*
|
|
2763
|
-
* Will update the recency of the entry.
|
|
2764
|
-
*
|
|
2765
|
-
* If the value is `undefined`, then this is an alias for
|
|
2766
|
-
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
2767
|
-
*/
|
|
2768
|
-
set(k, v, setOptions = {}) {
|
|
2769
|
-
if (v === void 0) {
|
|
2770
|
-
this.delete(k);
|
|
2771
|
-
return this;
|
|
2772
|
-
}
|
|
2773
|
-
const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions;
|
|
2774
|
-
let { noUpdateTTL = this.noUpdateTTL } = setOptions;
|
|
2775
|
-
const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
|
2776
|
-
if (this.maxEntrySize && size > this.maxEntrySize) {
|
|
2777
|
-
if (status) {
|
|
2778
|
-
status.set = "miss";
|
|
2779
|
-
status.maxEntrySizeExceeded = true;
|
|
2780
|
-
}
|
|
2781
|
-
this.#delete(k, "set");
|
|
2782
|
-
return this;
|
|
2783
|
-
}
|
|
2784
|
-
let index = this.#size === 0 ? void 0 : this.#keyMap.get(k);
|
|
2785
|
-
if (index === void 0) {
|
|
2786
|
-
index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(false) : this.#size;
|
|
2787
|
-
this.#keyList[index] = k;
|
|
2788
|
-
this.#valList[index] = v;
|
|
2789
|
-
this.#keyMap.set(k, index);
|
|
2790
|
-
this.#next[this.#tail] = index;
|
|
2791
|
-
this.#prev[index] = this.#tail;
|
|
2792
|
-
this.#tail = index;
|
|
2793
|
-
this.#size++;
|
|
2794
|
-
this.#addItemSize(index, size, status);
|
|
2795
|
-
if (status)
|
|
2796
|
-
status.set = "add";
|
|
2797
|
-
noUpdateTTL = false;
|
|
2798
|
-
if (this.#hasOnInsert) {
|
|
2799
|
-
this.#onInsert?.(v, k, "add");
|
|
2800
|
-
}
|
|
2801
|
-
} else {
|
|
2802
|
-
this.#moveToTail(index);
|
|
2803
|
-
const oldVal = this.#valList[index];
|
|
2804
|
-
if (v !== oldVal) {
|
|
2805
|
-
if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
|
|
2806
|
-
oldVal.__abortController.abort(new Error("replaced"));
|
|
2807
|
-
const { __staleWhileFetching: s } = oldVal;
|
|
2808
|
-
if (s !== void 0 && !noDisposeOnSet) {
|
|
2809
|
-
if (this.#hasDispose) {
|
|
2810
|
-
this.#dispose?.(s, k, "set");
|
|
2811
|
-
}
|
|
2812
|
-
if (this.#hasDisposeAfter) {
|
|
2813
|
-
this.#disposed?.push([s, k, "set"]);
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
} else if (!noDisposeOnSet) {
|
|
2817
|
-
if (this.#hasDispose) {
|
|
2818
|
-
this.#dispose?.(oldVal, k, "set");
|
|
2819
|
-
}
|
|
2820
|
-
if (this.#hasDisposeAfter) {
|
|
2821
|
-
this.#disposed?.push([oldVal, k, "set"]);
|
|
2822
|
-
}
|
|
2823
|
-
}
|
|
2824
|
-
this.#removeItemSize(index);
|
|
2825
|
-
this.#addItemSize(index, size, status);
|
|
2826
|
-
this.#valList[index] = v;
|
|
2827
|
-
if (status) {
|
|
2828
|
-
status.set = "replace";
|
|
2829
|
-
const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ? oldVal.__staleWhileFetching : oldVal;
|
|
2830
|
-
if (oldValue !== void 0)
|
|
2831
|
-
status.oldValue = oldValue;
|
|
2832
|
-
}
|
|
2833
|
-
} else if (status) {
|
|
2834
|
-
status.set = "update";
|
|
2835
|
-
}
|
|
2836
|
-
if (this.#hasOnInsert) {
|
|
2837
|
-
this.onInsert?.(v, k, v === oldVal ? "update" : "replace");
|
|
2838
|
-
}
|
|
2839
|
-
}
|
|
2840
|
-
if (ttl !== 0 && !this.#ttls) {
|
|
2841
|
-
this.#initializeTTLTracking();
|
|
2842
|
-
}
|
|
2843
|
-
if (this.#ttls) {
|
|
2844
|
-
if (!noUpdateTTL) {
|
|
2845
|
-
this.#setItemTTL(index, ttl, start);
|
|
2846
|
-
}
|
|
2847
|
-
if (status)
|
|
2848
|
-
this.#statusTTL(status, index);
|
|
2849
|
-
}
|
|
2850
|
-
if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
|
2851
|
-
const dt = this.#disposed;
|
|
2852
|
-
let task;
|
|
2853
|
-
while (task = dt?.shift()) {
|
|
2854
|
-
this.#disposeAfter?.(...task);
|
|
2855
|
-
}
|
|
2856
|
-
}
|
|
2857
|
-
return this;
|
|
2858
|
-
}
|
|
2859
|
-
/**
|
|
2860
|
-
* Evict the least recently used item, returning its value or
|
|
2861
|
-
* `undefined` if cache is empty.
|
|
2862
|
-
*/
|
|
2863
|
-
pop() {
|
|
2864
|
-
try {
|
|
2865
|
-
while (this.#size) {
|
|
2866
|
-
const val = this.#valList[this.#head];
|
|
2867
|
-
this.#evict(true);
|
|
2868
|
-
if (this.#isBackgroundFetch(val)) {
|
|
2869
|
-
if (val.__staleWhileFetching) {
|
|
2870
|
-
return val.__staleWhileFetching;
|
|
2871
|
-
}
|
|
2872
|
-
} else if (val !== void 0) {
|
|
2873
|
-
return val;
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
} finally {
|
|
2877
|
-
if (this.#hasDisposeAfter && this.#disposed) {
|
|
2878
|
-
const dt = this.#disposed;
|
|
2879
|
-
let task;
|
|
2880
|
-
while (task = dt?.shift()) {
|
|
2881
|
-
this.#disposeAfter?.(...task);
|
|
2882
|
-
}
|
|
2883
|
-
}
|
|
2884
|
-
}
|
|
2885
|
-
}
|
|
2886
|
-
#evict(free) {
|
|
2887
|
-
const head = this.#head;
|
|
2888
|
-
const k = this.#keyList[head];
|
|
2889
|
-
const v = this.#valList[head];
|
|
2890
|
-
if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
|
|
2891
|
-
v.__abortController.abort(new Error("evicted"));
|
|
2892
|
-
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
2893
|
-
if (this.#hasDispose) {
|
|
2894
|
-
this.#dispose?.(v, k, "evict");
|
|
2895
|
-
}
|
|
2896
|
-
if (this.#hasDisposeAfter) {
|
|
2897
|
-
this.#disposed?.push([v, k, "evict"]);
|
|
2898
|
-
}
|
|
2899
|
-
}
|
|
2900
|
-
this.#removeItemSize(head);
|
|
2901
|
-
if (free) {
|
|
2902
|
-
this.#keyList[head] = void 0;
|
|
2903
|
-
this.#valList[head] = void 0;
|
|
2904
|
-
this.#free.push(head);
|
|
2905
|
-
}
|
|
2906
|
-
if (this.#size === 1) {
|
|
2907
|
-
this.#head = this.#tail = 0;
|
|
2908
|
-
this.#free.length = 0;
|
|
2909
|
-
} else {
|
|
2910
|
-
this.#head = this.#next[head];
|
|
2911
|
-
}
|
|
2912
|
-
this.#keyMap.delete(k);
|
|
2913
|
-
this.#size--;
|
|
2914
|
-
return head;
|
|
2915
|
-
}
|
|
2916
|
-
/**
|
|
2917
|
-
* Check if a key is in the cache, without updating the recency of use.
|
|
2918
|
-
* Will return false if the item is stale, even though it is technically
|
|
2919
|
-
* in the cache.
|
|
2920
|
-
*
|
|
2921
|
-
* Check if a key is in the cache, without updating the recency of
|
|
2922
|
-
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
|
|
2923
|
-
* to `true` in either the options or the constructor.
|
|
2924
|
-
*
|
|
2925
|
-
* Will return `false` if the item is stale, even though it is technically in
|
|
2926
|
-
* the cache. The difference can be determined (if it matters) by using a
|
|
2927
|
-
* `status` argument, and inspecting the `has` field.
|
|
2928
|
-
*
|
|
2929
|
-
* Will not update item age unless
|
|
2930
|
-
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
2931
|
-
*/
|
|
2932
|
-
has(k, hasOptions = {}) {
|
|
2933
|
-
const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
|
|
2934
|
-
const index = this.#keyMap.get(k);
|
|
2935
|
-
if (index !== void 0) {
|
|
2936
|
-
const v = this.#valList[index];
|
|
2937
|
-
if (this.#isBackgroundFetch(v) && v.__staleWhileFetching === void 0) {
|
|
2938
|
-
return false;
|
|
2939
|
-
}
|
|
2940
|
-
if (!this.#isStale(index)) {
|
|
2941
|
-
if (updateAgeOnHas) {
|
|
2942
|
-
this.#updateItemAge(index);
|
|
2943
|
-
}
|
|
2944
|
-
if (status) {
|
|
2945
|
-
status.has = "hit";
|
|
2946
|
-
this.#statusTTL(status, index);
|
|
2947
|
-
}
|
|
2948
|
-
return true;
|
|
2949
|
-
} else if (status) {
|
|
2950
|
-
status.has = "stale";
|
|
2951
|
-
this.#statusTTL(status, index);
|
|
2952
|
-
}
|
|
2953
|
-
} else if (status) {
|
|
2954
|
-
status.has = "miss";
|
|
2955
|
-
}
|
|
2956
|
-
return false;
|
|
2957
|
-
}
|
|
2958
|
-
/**
|
|
2959
|
-
* Like {@link LRUCache#get} but doesn't update recency or delete stale
|
|
2960
|
-
* items.
|
|
2961
|
-
*
|
|
2962
|
-
* Returns `undefined` if the item is stale, unless
|
|
2963
|
-
* {@link LRUCache.OptionsBase.allowStale} is set.
|
|
2964
|
-
*/
|
|
2965
|
-
peek(k, peekOptions = {}) {
|
|
2966
|
-
const { allowStale = this.allowStale } = peekOptions;
|
|
2967
|
-
const index = this.#keyMap.get(k);
|
|
2968
|
-
if (index === void 0 || !allowStale && this.#isStale(index)) {
|
|
2969
|
-
return;
|
|
2970
|
-
}
|
|
2971
|
-
const v = this.#valList[index];
|
|
2972
|
-
return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
|
|
2973
|
-
}
|
|
2974
|
-
#backgroundFetch(k, index, options, context) {
|
|
2975
|
-
const v = index === void 0 ? void 0 : this.#valList[index];
|
|
2976
|
-
if (this.#isBackgroundFetch(v)) {
|
|
2977
|
-
return v;
|
|
2978
|
-
}
|
|
2979
|
-
const ac = new AC();
|
|
2980
|
-
const { signal } = options;
|
|
2981
|
-
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
|
2982
|
-
signal: ac.signal
|
|
2983
|
-
});
|
|
2984
|
-
const fetchOpts = {
|
|
2985
|
-
signal: ac.signal,
|
|
2986
|
-
options,
|
|
2987
|
-
context
|
|
2988
|
-
};
|
|
2989
|
-
const cb = /* @__PURE__ */ __name((v2, updateCache = false) => {
|
|
2990
|
-
const { aborted } = ac.signal;
|
|
2991
|
-
const ignoreAbort = options.ignoreFetchAbort && v2 !== void 0;
|
|
2992
|
-
if (options.status) {
|
|
2993
|
-
if (aborted && !updateCache) {
|
|
2994
|
-
options.status.fetchAborted = true;
|
|
2995
|
-
options.status.fetchError = ac.signal.reason;
|
|
2996
|
-
if (ignoreAbort)
|
|
2997
|
-
options.status.fetchAbortIgnored = true;
|
|
2998
|
-
} else {
|
|
2999
|
-
options.status.fetchResolved = true;
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
if (aborted && !ignoreAbort && !updateCache) {
|
|
3003
|
-
return fetchFail(ac.signal.reason);
|
|
3004
|
-
}
|
|
3005
|
-
const bf2 = p;
|
|
3006
|
-
const vl = this.#valList[index];
|
|
3007
|
-
if (vl === p || ignoreAbort && updateCache && vl === void 0) {
|
|
3008
|
-
if (v2 === void 0) {
|
|
3009
|
-
if (bf2.__staleWhileFetching !== void 0) {
|
|
3010
|
-
this.#valList[index] = bf2.__staleWhileFetching;
|
|
3011
|
-
} else {
|
|
3012
|
-
this.#delete(k, "fetch");
|
|
3013
|
-
}
|
|
3014
|
-
} else {
|
|
3015
|
-
if (options.status)
|
|
3016
|
-
options.status.fetchUpdated = true;
|
|
3017
|
-
this.set(k, v2, fetchOpts.options);
|
|
3018
|
-
}
|
|
3019
|
-
}
|
|
3020
|
-
return v2;
|
|
3021
|
-
}, "cb");
|
|
3022
|
-
const eb = /* @__PURE__ */ __name((er) => {
|
|
3023
|
-
if (options.status) {
|
|
3024
|
-
options.status.fetchRejected = true;
|
|
3025
|
-
options.status.fetchError = er;
|
|
3026
|
-
}
|
|
3027
|
-
return fetchFail(er);
|
|
3028
|
-
}, "eb");
|
|
3029
|
-
const fetchFail = /* @__PURE__ */ __name((er) => {
|
|
3030
|
-
const { aborted } = ac.signal;
|
|
3031
|
-
const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
|
|
3032
|
-
const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
|
|
3033
|
-
const noDelete = allowStale || options.noDeleteOnFetchRejection;
|
|
3034
|
-
const bf2 = p;
|
|
3035
|
-
if (this.#valList[index] === p) {
|
|
3036
|
-
const del = !noDelete || bf2.__staleWhileFetching === void 0;
|
|
3037
|
-
if (del) {
|
|
3038
|
-
this.#delete(k, "fetch");
|
|
3039
|
-
} else if (!allowStaleAborted) {
|
|
3040
|
-
this.#valList[index] = bf2.__staleWhileFetching;
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
if (allowStale) {
|
|
3044
|
-
if (options.status && bf2.__staleWhileFetching !== void 0) {
|
|
3045
|
-
options.status.returnedStale = true;
|
|
3046
|
-
}
|
|
3047
|
-
return bf2.__staleWhileFetching;
|
|
3048
|
-
} else if (bf2.__returned === bf2) {
|
|
3049
|
-
throw er;
|
|
3050
|
-
}
|
|
3051
|
-
}, "fetchFail");
|
|
3052
|
-
const pcall = /* @__PURE__ */ __name((res, rej) => {
|
|
3053
|
-
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
3054
|
-
if (fmp && fmp instanceof Promise) {
|
|
3055
|
-
fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej);
|
|
3056
|
-
}
|
|
3057
|
-
ac.signal.addEventListener("abort", () => {
|
|
3058
|
-
if (!options.ignoreFetchAbort || options.allowStaleOnFetchAbort) {
|
|
3059
|
-
res(void 0);
|
|
3060
|
-
if (options.allowStaleOnFetchAbort) {
|
|
3061
|
-
res = /* @__PURE__ */ __name((v2) => cb(v2, true), "res");
|
|
3062
|
-
}
|
|
3063
|
-
}
|
|
3064
|
-
});
|
|
3065
|
-
}, "pcall");
|
|
3066
|
-
if (options.status)
|
|
3067
|
-
options.status.fetchDispatched = true;
|
|
3068
|
-
const p = new Promise(pcall).then(cb, eb);
|
|
3069
|
-
const bf = Object.assign(p, {
|
|
3070
|
-
__abortController: ac,
|
|
3071
|
-
__staleWhileFetching: v,
|
|
3072
|
-
__returned: void 0
|
|
3073
|
-
});
|
|
3074
|
-
if (index === void 0) {
|
|
3075
|
-
this.set(k, bf, { ...fetchOpts.options, status: void 0 });
|
|
3076
|
-
index = this.#keyMap.get(k);
|
|
3077
|
-
} else {
|
|
3078
|
-
this.#valList[index] = bf;
|
|
3079
|
-
}
|
|
3080
|
-
return bf;
|
|
3081
|
-
}
|
|
3082
|
-
#isBackgroundFetch(p) {
|
|
3083
|
-
if (!this.#hasFetchMethod)
|
|
3084
|
-
return false;
|
|
3085
|
-
const b = p;
|
|
3086
|
-
return !!b && b instanceof Promise && b.hasOwnProperty("__staleWhileFetching") && b.__abortController instanceof AC;
|
|
3087
|
-
}
|
|
3088
|
-
async fetch(k, fetchOptions = {}) {
|
|
3089
|
-
const {
|
|
3090
|
-
// get options
|
|
3091
|
-
allowStale = this.allowStale,
|
|
3092
|
-
updateAgeOnGet = this.updateAgeOnGet,
|
|
3093
|
-
noDeleteOnStaleGet = this.noDeleteOnStaleGet,
|
|
3094
|
-
// set options
|
|
3095
|
-
ttl = this.ttl,
|
|
3096
|
-
noDisposeOnSet = this.noDisposeOnSet,
|
|
3097
|
-
size = 0,
|
|
3098
|
-
sizeCalculation = this.sizeCalculation,
|
|
3099
|
-
noUpdateTTL = this.noUpdateTTL,
|
|
3100
|
-
// fetch exclusive options
|
|
3101
|
-
noDeleteOnFetchRejection = this.noDeleteOnFetchRejection,
|
|
3102
|
-
allowStaleOnFetchRejection = this.allowStaleOnFetchRejection,
|
|
3103
|
-
ignoreFetchAbort = this.ignoreFetchAbort,
|
|
3104
|
-
allowStaleOnFetchAbort = this.allowStaleOnFetchAbort,
|
|
3105
|
-
context,
|
|
3106
|
-
forceRefresh = false,
|
|
3107
|
-
status,
|
|
3108
|
-
signal
|
|
3109
|
-
} = fetchOptions;
|
|
3110
|
-
if (!this.#hasFetchMethod) {
|
|
3111
|
-
if (status)
|
|
3112
|
-
status.fetch = "get";
|
|
3113
|
-
return this.get(k, {
|
|
3114
|
-
allowStale,
|
|
3115
|
-
updateAgeOnGet,
|
|
3116
|
-
noDeleteOnStaleGet,
|
|
3117
|
-
status
|
|
3118
|
-
});
|
|
3119
|
-
}
|
|
3120
|
-
const options = {
|
|
3121
|
-
allowStale,
|
|
3122
|
-
updateAgeOnGet,
|
|
3123
|
-
noDeleteOnStaleGet,
|
|
3124
|
-
ttl,
|
|
3125
|
-
noDisposeOnSet,
|
|
3126
|
-
size,
|
|
3127
|
-
sizeCalculation,
|
|
3128
|
-
noUpdateTTL,
|
|
3129
|
-
noDeleteOnFetchRejection,
|
|
3130
|
-
allowStaleOnFetchRejection,
|
|
3131
|
-
allowStaleOnFetchAbort,
|
|
3132
|
-
ignoreFetchAbort,
|
|
3133
|
-
status,
|
|
3134
|
-
signal
|
|
3135
|
-
};
|
|
3136
|
-
let index = this.#keyMap.get(k);
|
|
3137
|
-
if (index === void 0) {
|
|
3138
|
-
if (status)
|
|
3139
|
-
status.fetch = "miss";
|
|
3140
|
-
const p = this.#backgroundFetch(k, index, options, context);
|
|
3141
|
-
return p.__returned = p;
|
|
3142
|
-
} else {
|
|
3143
|
-
const v = this.#valList[index];
|
|
3144
|
-
if (this.#isBackgroundFetch(v)) {
|
|
3145
|
-
const stale = allowStale && v.__staleWhileFetching !== void 0;
|
|
3146
|
-
if (status) {
|
|
3147
|
-
status.fetch = "inflight";
|
|
3148
|
-
if (stale)
|
|
3149
|
-
status.returnedStale = true;
|
|
3150
|
-
}
|
|
3151
|
-
return stale ? v.__staleWhileFetching : v.__returned = v;
|
|
3152
|
-
}
|
|
3153
|
-
const isStale = this.#isStale(index);
|
|
3154
|
-
if (!forceRefresh && !isStale) {
|
|
3155
|
-
if (status)
|
|
3156
|
-
status.fetch = "hit";
|
|
3157
|
-
this.#moveToTail(index);
|
|
3158
|
-
if (updateAgeOnGet) {
|
|
3159
|
-
this.#updateItemAge(index);
|
|
3160
|
-
}
|
|
3161
|
-
if (status)
|
|
3162
|
-
this.#statusTTL(status, index);
|
|
3163
|
-
return v;
|
|
3164
|
-
}
|
|
3165
|
-
const p = this.#backgroundFetch(k, index, options, context);
|
|
3166
|
-
const hasStale = p.__staleWhileFetching !== void 0;
|
|
3167
|
-
const staleVal = hasStale && allowStale;
|
|
3168
|
-
if (status) {
|
|
3169
|
-
status.fetch = isStale ? "stale" : "refresh";
|
|
3170
|
-
if (staleVal && isStale)
|
|
3171
|
-
status.returnedStale = true;
|
|
3172
|
-
}
|
|
3173
|
-
return staleVal ? p.__staleWhileFetching : p.__returned = p;
|
|
3174
|
-
}
|
|
3175
|
-
}
|
|
3176
|
-
async forceFetch(k, fetchOptions = {}) {
|
|
3177
|
-
const v = await this.fetch(k, fetchOptions);
|
|
3178
|
-
if (v === void 0)
|
|
3179
|
-
throw new Error("fetch() returned undefined");
|
|
3180
|
-
return v;
|
|
3181
|
-
}
|
|
3182
|
-
memo(k, memoOptions = {}) {
|
|
3183
|
-
const memoMethod = this.#memoMethod;
|
|
3184
|
-
if (!memoMethod) {
|
|
3185
|
-
throw new Error("no memoMethod provided to constructor");
|
|
3186
|
-
}
|
|
3187
|
-
const { context, forceRefresh, ...options } = memoOptions;
|
|
3188
|
-
const v = this.get(k, options);
|
|
3189
|
-
if (!forceRefresh && v !== void 0)
|
|
3190
|
-
return v;
|
|
3191
|
-
const vv = memoMethod(k, v, {
|
|
3192
|
-
options,
|
|
3193
|
-
context
|
|
3194
|
-
});
|
|
3195
|
-
this.set(k, vv, options);
|
|
3196
|
-
return vv;
|
|
3197
|
-
}
|
|
3198
|
-
/**
|
|
3199
|
-
* Return a value from the cache. Will update the recency of the cache
|
|
3200
|
-
* entry found.
|
|
3201
|
-
*
|
|
3202
|
-
* If the key is not found, get() will return `undefined`.
|
|
3203
|
-
*/
|
|
3204
|
-
get(k, getOptions = {}) {
|
|
3205
|
-
const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions;
|
|
3206
|
-
const index = this.#keyMap.get(k);
|
|
3207
|
-
if (index !== void 0) {
|
|
3208
|
-
const value = this.#valList[index];
|
|
3209
|
-
const fetching = this.#isBackgroundFetch(value);
|
|
3210
|
-
if (status)
|
|
3211
|
-
this.#statusTTL(status, index);
|
|
3212
|
-
if (this.#isStale(index)) {
|
|
3213
|
-
if (status)
|
|
3214
|
-
status.get = "stale";
|
|
3215
|
-
if (!fetching) {
|
|
3216
|
-
if (!noDeleteOnStaleGet) {
|
|
3217
|
-
this.#delete(k, "expire");
|
|
3218
|
-
}
|
|
3219
|
-
if (status && allowStale)
|
|
3220
|
-
status.returnedStale = true;
|
|
3221
|
-
return allowStale ? value : void 0;
|
|
3222
|
-
} else {
|
|
3223
|
-
if (status && allowStale && value.__staleWhileFetching !== void 0) {
|
|
3224
|
-
status.returnedStale = true;
|
|
3225
|
-
}
|
|
3226
|
-
return allowStale ? value.__staleWhileFetching : void 0;
|
|
3227
|
-
}
|
|
3228
|
-
} else {
|
|
3229
|
-
if (status)
|
|
3230
|
-
status.get = "hit";
|
|
3231
|
-
if (fetching) {
|
|
3232
|
-
return value.__staleWhileFetching;
|
|
3233
|
-
}
|
|
3234
|
-
this.#moveToTail(index);
|
|
3235
|
-
if (updateAgeOnGet) {
|
|
3236
|
-
this.#updateItemAge(index);
|
|
3237
|
-
}
|
|
3238
|
-
return value;
|
|
3239
|
-
}
|
|
3240
|
-
} else if (status) {
|
|
3241
|
-
status.get = "miss";
|
|
3242
|
-
}
|
|
3243
|
-
}
|
|
3244
|
-
#connect(p, n) {
|
|
3245
|
-
this.#prev[n] = p;
|
|
3246
|
-
this.#next[p] = n;
|
|
3247
|
-
}
|
|
3248
|
-
#moveToTail(index) {
|
|
3249
|
-
if (index !== this.#tail) {
|
|
3250
|
-
if (index === this.#head) {
|
|
3251
|
-
this.#head = this.#next[index];
|
|
3252
|
-
} else {
|
|
3253
|
-
this.#connect(this.#prev[index], this.#next[index]);
|
|
3254
|
-
}
|
|
3255
|
-
this.#connect(this.#tail, index);
|
|
3256
|
-
this.#tail = index;
|
|
3257
|
-
}
|
|
3258
|
-
}
|
|
3259
|
-
/**
|
|
3260
|
-
* Deletes a key out of the cache.
|
|
3261
|
-
*
|
|
3262
|
-
* Returns true if the key was deleted, false otherwise.
|
|
3263
|
-
*/
|
|
3264
|
-
delete(k) {
|
|
3265
|
-
return this.#delete(k, "delete");
|
|
3266
|
-
}
|
|
3267
|
-
#delete(k, reason) {
|
|
3268
|
-
let deleted = false;
|
|
3269
|
-
if (this.#size !== 0) {
|
|
3270
|
-
const index = this.#keyMap.get(k);
|
|
3271
|
-
if (index !== void 0) {
|
|
3272
|
-
deleted = true;
|
|
3273
|
-
if (this.#size === 1) {
|
|
3274
|
-
this.#clear(reason);
|
|
3275
|
-
} else {
|
|
3276
|
-
this.#removeItemSize(index);
|
|
3277
|
-
const v = this.#valList[index];
|
|
3278
|
-
if (this.#isBackgroundFetch(v)) {
|
|
3279
|
-
v.__abortController.abort(new Error("deleted"));
|
|
3280
|
-
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
3281
|
-
if (this.#hasDispose) {
|
|
3282
|
-
this.#dispose?.(v, k, reason);
|
|
3283
|
-
}
|
|
3284
|
-
if (this.#hasDisposeAfter) {
|
|
3285
|
-
this.#disposed?.push([v, k, reason]);
|
|
3286
|
-
}
|
|
3287
|
-
}
|
|
3288
|
-
this.#keyMap.delete(k);
|
|
3289
|
-
this.#keyList[index] = void 0;
|
|
3290
|
-
this.#valList[index] = void 0;
|
|
3291
|
-
if (index === this.#tail) {
|
|
3292
|
-
this.#tail = this.#prev[index];
|
|
3293
|
-
} else if (index === this.#head) {
|
|
3294
|
-
this.#head = this.#next[index];
|
|
3295
|
-
} else {
|
|
3296
|
-
const pi = this.#prev[index];
|
|
3297
|
-
this.#next[pi] = this.#next[index];
|
|
3298
|
-
const ni = this.#next[index];
|
|
3299
|
-
this.#prev[ni] = this.#prev[index];
|
|
3300
|
-
}
|
|
3301
|
-
this.#size--;
|
|
3302
|
-
this.#free.push(index);
|
|
3303
|
-
}
|
|
3304
|
-
}
|
|
3305
|
-
}
|
|
3306
|
-
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
|
3307
|
-
const dt = this.#disposed;
|
|
3308
|
-
let task;
|
|
3309
|
-
while (task = dt?.shift()) {
|
|
3310
|
-
this.#disposeAfter?.(...task);
|
|
3311
|
-
}
|
|
3312
|
-
}
|
|
3313
|
-
return deleted;
|
|
3314
|
-
}
|
|
3315
|
-
/**
|
|
3316
|
-
* Clear the cache entirely, throwing away all values.
|
|
3317
|
-
*/
|
|
3318
|
-
clear() {
|
|
3319
|
-
return this.#clear("delete");
|
|
3320
|
-
}
|
|
3321
|
-
#clear(reason) {
|
|
3322
|
-
for (const index of this.#rindexes({ allowStale: true })) {
|
|
3323
|
-
const v = this.#valList[index];
|
|
3324
|
-
if (this.#isBackgroundFetch(v)) {
|
|
3325
|
-
v.__abortController.abort(new Error("deleted"));
|
|
3326
|
-
} else {
|
|
3327
|
-
const k = this.#keyList[index];
|
|
3328
|
-
if (this.#hasDispose) {
|
|
3329
|
-
this.#dispose?.(v, k, reason);
|
|
3330
|
-
}
|
|
3331
|
-
if (this.#hasDisposeAfter) {
|
|
3332
|
-
this.#disposed?.push([v, k, reason]);
|
|
3333
|
-
}
|
|
3334
|
-
}
|
|
3335
|
-
}
|
|
3336
|
-
this.#keyMap.clear();
|
|
3337
|
-
this.#valList.fill(void 0);
|
|
3338
|
-
this.#keyList.fill(void 0);
|
|
3339
|
-
if (this.#ttls && this.#starts) {
|
|
3340
|
-
this.#ttls.fill(0);
|
|
3341
|
-
this.#starts.fill(0);
|
|
3342
|
-
}
|
|
3343
|
-
if (this.#sizes) {
|
|
3344
|
-
this.#sizes.fill(0);
|
|
3345
|
-
}
|
|
3346
|
-
this.#head = 0;
|
|
3347
|
-
this.#tail = 0;
|
|
3348
|
-
this.#free.length = 0;
|
|
3349
|
-
this.#calculatedSize = 0;
|
|
3350
|
-
this.#size = 0;
|
|
3351
|
-
if (this.#hasDisposeAfter && this.#disposed) {
|
|
3352
|
-
const dt = this.#disposed;
|
|
3353
|
-
let task;
|
|
3354
|
-
while (task = dt?.shift()) {
|
|
3355
|
-
this.#disposeAfter?.(...task);
|
|
3356
|
-
}
|
|
3357
|
-
}
|
|
3358
|
-
}
|
|
3359
|
-
};
|
|
3360
|
-
exports2.LRUCache = LRUCache;
|
|
3361
|
-
}
|
|
3362
|
-
});
|
|
3363
|
-
|
|
3364
|
-
// node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/hosts.js
|
|
3365
|
-
var require_hosts = __commonJS({
|
|
3366
|
-
"node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/hosts.js"(exports2, module2) {
|
|
3367
|
-
"use strict";
|
|
3368
|
-
var maybeJoin = /* @__PURE__ */ __name((...args) => args.every((arg) => arg) ? args.join("") : "", "maybeJoin");
|
|
3369
|
-
var maybeEncode = /* @__PURE__ */ __name((arg) => arg ? encodeURIComponent(arg) : "", "maybeEncode");
|
|
3370
|
-
var formatHashFragment = /* @__PURE__ */ __name((f) => f.toLowerCase().replace(/^\W+/g, "").replace(/(?<!\W)\W+$/, "").replace(/\//g, "").replace(/\W+/g, "-"), "formatHashFragment");
|
|
3371
|
-
var defaults = {
|
|
3372
|
-
sshtemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`, "sshtemplate"),
|
|
3373
|
-
sshurltemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, "sshurltemplate"),
|
|
3374
|
-
edittemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, editpath, path }) => `https://${domain}/${user}/${project}${maybeJoin("/", editpath, "/", maybeEncode(committish || "HEAD"), "/", path)}`, "edittemplate"),
|
|
3375
|
-
browsetemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, treepath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}`, "browsetemplate"),
|
|
3376
|
-
browsetreetemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, treepath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || "HEAD")}/${path}${maybeJoin("#", hashformat(fragment || ""))}`, "browsetreetemplate"),
|
|
3377
|
-
browseblobtemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, blobpath, path, fragment, hashformat }) => `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || "HEAD")}/${path}${maybeJoin("#", hashformat(fragment || ""))}`, "browseblobtemplate"),
|
|
3378
|
-
docstemplate: /* @__PURE__ */ __name(({ domain, user, project, treepath, committish }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish))}#readme`, "docstemplate"),
|
|
3379
|
-
httpstemplate: /* @__PURE__ */ __name(({ auth, domain, user, project, committish }) => `git+https://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, "httpstemplate"),
|
|
3380
|
-
filetemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || "HEAD")}/${path}`, "filetemplate"),
|
|
3381
|
-
shortcuttemplate: /* @__PURE__ */ __name(({ type, user, project, committish }) => `${type}:${user}/${project}${maybeJoin("#", committish)}`, "shortcuttemplate"),
|
|
3382
|
-
pathtemplate: /* @__PURE__ */ __name(({ user, project, committish }) => `${user}/${project}${maybeJoin("#", committish)}`, "pathtemplate"),
|
|
3383
|
-
bugstemplate: /* @__PURE__ */ __name(({ domain, user, project }) => `https://${domain}/${user}/${project}/issues`, "bugstemplate"),
|
|
3384
|
-
hashformat: formatHashFragment
|
|
3385
|
-
};
|
|
3386
|
-
var hosts = {};
|
|
3387
|
-
hosts.github = {
|
|
3388
|
-
// First two are insecure and generally shouldn't be used any more, but
|
|
3389
|
-
// they are still supported.
|
|
3390
|
-
protocols: ["git:", "http:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
3391
|
-
domain: "github.com",
|
|
3392
|
-
treepath: "tree",
|
|
3393
|
-
blobpath: "blob",
|
|
3394
|
-
editpath: "edit",
|
|
3395
|
-
filetemplate: /* @__PURE__ */ __name(({ auth, user, project, committish, path }) => `https://${maybeJoin(auth, "@")}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || "HEAD")}/${path}`, "filetemplate"),
|
|
3396
|
-
gittemplate: /* @__PURE__ */ __name(({ auth, domain, user, project, committish }) => `git://${maybeJoin(auth, "@")}${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, "gittemplate"),
|
|
3397
|
-
tarballtemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`, "tarballtemplate"),
|
|
3398
|
-
extract: /* @__PURE__ */ __name((url) => {
|
|
3399
|
-
let [, user, project, type, committish] = url.pathname.split("/", 5);
|
|
3400
|
-
if (type && type !== "tree") {
|
|
3401
|
-
return;
|
|
3402
|
-
}
|
|
3403
|
-
if (!type) {
|
|
3404
|
-
committish = url.hash.slice(1);
|
|
3405
|
-
}
|
|
3406
|
-
if (project && project.endsWith(".git")) {
|
|
3407
|
-
project = project.slice(0, -4);
|
|
3408
|
-
}
|
|
3409
|
-
if (!user || !project) {
|
|
3410
|
-
return;
|
|
3411
|
-
}
|
|
3412
|
-
return { user, project, committish };
|
|
3413
|
-
}, "extract")
|
|
3414
|
-
};
|
|
3415
|
-
hosts.bitbucket = {
|
|
3416
|
-
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
3417
|
-
domain: "bitbucket.org",
|
|
3418
|
-
treepath: "src",
|
|
3419
|
-
blobpath: "src",
|
|
3420
|
-
editpath: "?mode=edit",
|
|
3421
|
-
edittemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, treepath, path, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", treepath, "/", maybeEncode(committish || "HEAD"), "/", path, editpath)}`, "edittemplate"),
|
|
3422
|
-
tarballtemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/get/${maybeEncode(committish || "HEAD")}.tar.gz`, "tarballtemplate"),
|
|
3423
|
-
extract: /* @__PURE__ */ __name((url) => {
|
|
3424
|
-
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
3425
|
-
if (["get"].includes(aux)) {
|
|
3426
|
-
return;
|
|
3427
|
-
}
|
|
3428
|
-
if (project && project.endsWith(".git")) {
|
|
3429
|
-
project = project.slice(0, -4);
|
|
3430
|
-
}
|
|
3431
|
-
if (!user || !project) {
|
|
3432
|
-
return;
|
|
3433
|
-
}
|
|
3434
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
3435
|
-
}, "extract")
|
|
3436
|
-
};
|
|
3437
|
-
hosts.gitlab = {
|
|
3438
|
-
protocols: ["git+ssh:", "git+https:", "ssh:", "https:"],
|
|
3439
|
-
domain: "gitlab.com",
|
|
3440
|
-
treepath: "tree",
|
|
3441
|
-
blobpath: "tree",
|
|
3442
|
-
editpath: "-/edit",
|
|
3443
|
-
tarballtemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || "HEAD")}`, "tarballtemplate"),
|
|
3444
|
-
extract: /* @__PURE__ */ __name((url) => {
|
|
3445
|
-
const path = url.pathname.slice(1);
|
|
3446
|
-
if (path.includes("/-/") || path.includes("/archive.tar.gz")) {
|
|
3447
|
-
return;
|
|
3448
|
-
}
|
|
3449
|
-
const segments = path.split("/");
|
|
3450
|
-
let project = segments.pop();
|
|
3451
|
-
if (project.endsWith(".git")) {
|
|
3452
|
-
project = project.slice(0, -4);
|
|
3453
|
-
}
|
|
3454
|
-
const user = segments.join("/");
|
|
3455
|
-
if (!user || !project) {
|
|
3456
|
-
return;
|
|
3457
|
-
}
|
|
3458
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
3459
|
-
}, "extract")
|
|
3460
|
-
};
|
|
3461
|
-
hosts.gist = {
|
|
3462
|
-
protocols: ["git:", "git+ssh:", "git+https:", "ssh:", "https:"],
|
|
3463
|
-
domain: "gist.github.com",
|
|
3464
|
-
editpath: "edit",
|
|
3465
|
-
sshtemplate: /* @__PURE__ */ __name(({ domain, project, committish }) => `git@${domain}:${project}.git${maybeJoin("#", committish)}`, "sshtemplate"),
|
|
3466
|
-
sshurltemplate: /* @__PURE__ */ __name(({ domain, project, committish }) => `git+ssh://git@${domain}/${project}.git${maybeJoin("#", committish)}`, "sshurltemplate"),
|
|
3467
|
-
edittemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, editpath }) => `https://${domain}/${user}/${project}${maybeJoin("/", maybeEncode(committish))}/${editpath}`, "edittemplate"),
|
|
3468
|
-
browsetemplate: /* @__PURE__ */ __name(({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`, "browsetemplate"),
|
|
3469
|
-
browsetreetemplate: /* @__PURE__ */ __name(({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path))}`, "browsetreetemplate"),
|
|
3470
|
-
browseblobtemplate: /* @__PURE__ */ __name(({ domain, project, committish, path, hashformat }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}${maybeJoin("#", hashformat(path))}`, "browseblobtemplate"),
|
|
3471
|
-
docstemplate: /* @__PURE__ */ __name(({ domain, project, committish }) => `https://${domain}/${project}${maybeJoin("/", maybeEncode(committish))}`, "docstemplate"),
|
|
3472
|
-
httpstemplate: /* @__PURE__ */ __name(({ domain, project, committish }) => `git+https://${domain}/${project}.git${maybeJoin("#", committish)}`, "httpstemplate"),
|
|
3473
|
-
filetemplate: /* @__PURE__ */ __name(({ user, project, committish, path }) => `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin("/", maybeEncode(committish))}/${path}`, "filetemplate"),
|
|
3474
|
-
shortcuttemplate: /* @__PURE__ */ __name(({ type, project, committish }) => `${type}:${project}${maybeJoin("#", committish)}`, "shortcuttemplate"),
|
|
3475
|
-
pathtemplate: /* @__PURE__ */ __name(({ project, committish }) => `${project}${maybeJoin("#", committish)}`, "pathtemplate"),
|
|
3476
|
-
bugstemplate: /* @__PURE__ */ __name(({ domain, project }) => `https://${domain}/${project}`, "bugstemplate"),
|
|
3477
|
-
gittemplate: /* @__PURE__ */ __name(({ domain, project, committish }) => `git://${domain}/${project}.git${maybeJoin("#", committish)}`, "gittemplate"),
|
|
3478
|
-
tarballtemplate: /* @__PURE__ */ __name(({ project, committish }) => `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || "HEAD")}`, "tarballtemplate"),
|
|
3479
|
-
extract: /* @__PURE__ */ __name((url) => {
|
|
3480
|
-
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
3481
|
-
if (aux === "raw") {
|
|
3482
|
-
return;
|
|
3483
|
-
}
|
|
3484
|
-
if (!project) {
|
|
3485
|
-
if (!user) {
|
|
3486
|
-
return;
|
|
3487
|
-
}
|
|
3488
|
-
project = user;
|
|
3489
|
-
user = null;
|
|
3490
|
-
}
|
|
3491
|
-
if (project.endsWith(".git")) {
|
|
3492
|
-
project = project.slice(0, -4);
|
|
3493
|
-
}
|
|
3494
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
3495
|
-
}, "extract"),
|
|
3496
|
-
hashformat: /* @__PURE__ */ __name(function(fragment) {
|
|
3497
|
-
return fragment && "file-" + formatHashFragment(fragment);
|
|
3498
|
-
}, "hashformat")
|
|
3499
|
-
};
|
|
3500
|
-
hosts.sourcehut = {
|
|
3501
|
-
protocols: ["git+ssh:", "https:"],
|
|
3502
|
-
domain: "git.sr.ht",
|
|
3503
|
-
treepath: "tree",
|
|
3504
|
-
blobpath: "tree",
|
|
3505
|
-
filetemplate: /* @__PURE__ */ __name(({ domain, user, project, committish, path }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path}`, "filetemplate"),
|
|
3506
|
-
httpstemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`, "httpstemplate"),
|
|
3507
|
-
tarballtemplate: /* @__PURE__ */ __name(({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`, "tarballtemplate"),
|
|
3508
|
-
bugstemplate: /* @__PURE__ */ __name(() => null, "bugstemplate"),
|
|
3509
|
-
extract: /* @__PURE__ */ __name((url) => {
|
|
3510
|
-
let [, user, project, aux] = url.pathname.split("/", 4);
|
|
3511
|
-
if (["archive"].includes(aux)) {
|
|
3512
|
-
return;
|
|
3513
|
-
}
|
|
3514
|
-
if (project && project.endsWith(".git")) {
|
|
3515
|
-
project = project.slice(0, -4);
|
|
3516
|
-
}
|
|
3517
|
-
if (!user || !project) {
|
|
3518
|
-
return;
|
|
3519
|
-
}
|
|
3520
|
-
return { user, project, committish: url.hash.slice(1) };
|
|
3521
|
-
}, "extract")
|
|
3522
|
-
};
|
|
3523
|
-
for (const [name, host] of Object.entries(hosts)) {
|
|
3524
|
-
hosts[name] = Object.assign({}, defaults, host);
|
|
3525
|
-
}
|
|
3526
|
-
module2.exports = hosts;
|
|
3527
|
-
}
|
|
3528
|
-
});
|
|
3529
|
-
|
|
3530
|
-
// node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/parse-url.js
|
|
3531
|
-
var require_parse_url = __commonJS({
|
|
3532
|
-
"node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/parse-url.js"(exports2, module2) {
|
|
3533
|
-
var url = require("url");
|
|
3534
|
-
var lastIndexOfBefore = /* @__PURE__ */ __name((str, char, beforeChar) => {
|
|
3535
|
-
const startPosition = str.indexOf(beforeChar);
|
|
3536
|
-
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity);
|
|
3537
|
-
}, "lastIndexOfBefore");
|
|
3538
|
-
var safeUrl = /* @__PURE__ */ __name((u) => {
|
|
3539
|
-
try {
|
|
3540
|
-
return new url.URL(u);
|
|
3541
|
-
} catch {
|
|
3542
|
-
}
|
|
3543
|
-
}, "safeUrl");
|
|
3544
|
-
var correctProtocol = /* @__PURE__ */ __name((arg, protocols) => {
|
|
3545
|
-
const firstColon = arg.indexOf(":");
|
|
3546
|
-
const proto = arg.slice(0, firstColon + 1);
|
|
3547
|
-
if (Object.prototype.hasOwnProperty.call(protocols, proto)) {
|
|
3548
|
-
return arg;
|
|
3549
|
-
}
|
|
3550
|
-
if (arg.substr(firstColon, 3) === "://") {
|
|
3551
|
-
return arg;
|
|
3552
|
-
}
|
|
3553
|
-
const firstAt = arg.indexOf("@");
|
|
3554
|
-
if (firstAt > -1) {
|
|
3555
|
-
if (firstAt > firstColon) {
|
|
3556
|
-
return `git+ssh://${arg}`;
|
|
3557
|
-
} else {
|
|
3558
|
-
return arg;
|
|
3559
|
-
}
|
|
3560
|
-
}
|
|
3561
|
-
return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}`;
|
|
3562
|
-
}, "correctProtocol");
|
|
3563
|
-
var correctUrl = /* @__PURE__ */ __name((giturl) => {
|
|
3564
|
-
const firstAt = lastIndexOfBefore(giturl, "@", "#");
|
|
3565
|
-
const lastColonBeforeHash = lastIndexOfBefore(giturl, ":", "#");
|
|
3566
|
-
if (lastColonBeforeHash > firstAt) {
|
|
3567
|
-
giturl = giturl.slice(0, lastColonBeforeHash) + "/" + giturl.slice(lastColonBeforeHash + 1);
|
|
3568
|
-
}
|
|
3569
|
-
if (lastIndexOfBefore(giturl, ":", "#") === -1 && giturl.indexOf("//") === -1) {
|
|
3570
|
-
giturl = `git+ssh://${giturl}`;
|
|
3571
|
-
}
|
|
3572
|
-
return giturl;
|
|
3573
|
-
}, "correctUrl");
|
|
3574
|
-
module2.exports = (giturl, protocols) => {
|
|
3575
|
-
const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl;
|
|
3576
|
-
return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol));
|
|
3577
|
-
};
|
|
3578
|
-
}
|
|
3579
|
-
});
|
|
3580
|
-
|
|
3581
|
-
// node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/from-url.js
|
|
3582
|
-
var require_from_url = __commonJS({
|
|
3583
|
-
"node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/from-url.js"(exports2, module2) {
|
|
3584
|
-
"use strict";
|
|
3585
|
-
var parseUrl = require_parse_url();
|
|
3586
|
-
var isGitHubShorthand = /* @__PURE__ */ __name((arg) => {
|
|
3587
|
-
const firstHash = arg.indexOf("#");
|
|
3588
|
-
const firstSlash = arg.indexOf("/");
|
|
3589
|
-
const secondSlash = arg.indexOf("/", firstSlash + 1);
|
|
3590
|
-
const firstColon = arg.indexOf(":");
|
|
3591
|
-
const firstSpace = /\s/.exec(arg);
|
|
3592
|
-
const firstAt = arg.indexOf("@");
|
|
3593
|
-
const spaceOnlyAfterHash = !firstSpace || firstHash > -1 && firstSpace.index > firstHash;
|
|
3594
|
-
const atOnlyAfterHash = firstAt === -1 || firstHash > -1 && firstAt > firstHash;
|
|
3595
|
-
const colonOnlyAfterHash = firstColon === -1 || firstHash > -1 && firstColon > firstHash;
|
|
3596
|
-
const secondSlashOnlyAfterHash = secondSlash === -1 || firstHash > -1 && secondSlash > firstHash;
|
|
3597
|
-
const hasSlash = firstSlash > 0;
|
|
3598
|
-
const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== "/" : !arg.endsWith("/");
|
|
3599
|
-
const doesNotStartWithDot = !arg.startsWith(".");
|
|
3600
|
-
return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && secondSlashOnlyAfterHash;
|
|
3601
|
-
}, "isGitHubShorthand");
|
|
3602
|
-
module2.exports = (giturl, opts, { gitHosts, protocols }) => {
|
|
3603
|
-
if (!giturl) {
|
|
3604
|
-
return;
|
|
3605
|
-
}
|
|
3606
|
-
const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl;
|
|
3607
|
-
const parsed = parseUrl(correctedUrl, protocols);
|
|
3608
|
-
if (!parsed) {
|
|
3609
|
-
return;
|
|
3610
|
-
}
|
|
3611
|
-
const gitHostShortcut = gitHosts.byShortcut[parsed.protocol];
|
|
3612
|
-
const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith("www.") ? parsed.hostname.slice(4) : parsed.hostname];
|
|
3613
|
-
const gitHostName = gitHostShortcut || gitHostDomain;
|
|
3614
|
-
if (!gitHostName) {
|
|
3615
|
-
return;
|
|
3616
|
-
}
|
|
3617
|
-
const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain];
|
|
3618
|
-
let auth = null;
|
|
3619
|
-
if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) {
|
|
3620
|
-
auth = `${parsed.username}${parsed.password ? ":" + parsed.password : ""}`;
|
|
3621
|
-
}
|
|
3622
|
-
let committish = null;
|
|
3623
|
-
let user = null;
|
|
3624
|
-
let project = null;
|
|
3625
|
-
let defaultRepresentation = null;
|
|
3626
|
-
try {
|
|
3627
|
-
if (gitHostShortcut) {
|
|
3628
|
-
let pathname = parsed.pathname.startsWith("/") ? parsed.pathname.slice(1) : parsed.pathname;
|
|
3629
|
-
const firstAt = pathname.indexOf("@");
|
|
3630
|
-
if (firstAt > -1) {
|
|
3631
|
-
pathname = pathname.slice(firstAt + 1);
|
|
3632
|
-
}
|
|
3633
|
-
const lastSlash = pathname.lastIndexOf("/");
|
|
3634
|
-
if (lastSlash > -1) {
|
|
3635
|
-
user = decodeURIComponent(pathname.slice(0, lastSlash));
|
|
3636
|
-
if (!user) {
|
|
3637
|
-
user = null;
|
|
3638
|
-
}
|
|
3639
|
-
project = decodeURIComponent(pathname.slice(lastSlash + 1));
|
|
3640
|
-
} else {
|
|
3641
|
-
project = decodeURIComponent(pathname);
|
|
3642
|
-
}
|
|
3643
|
-
if (project.endsWith(".git")) {
|
|
3644
|
-
project = project.slice(0, -4);
|
|
3645
|
-
}
|
|
3646
|
-
if (parsed.hash) {
|
|
3647
|
-
committish = decodeURIComponent(parsed.hash.slice(1));
|
|
3648
|
-
}
|
|
3649
|
-
defaultRepresentation = "shortcut";
|
|
3650
|
-
} else {
|
|
3651
|
-
if (!gitHostInfo.protocols.includes(parsed.protocol)) {
|
|
3652
|
-
return;
|
|
3653
|
-
}
|
|
3654
|
-
const segments = gitHostInfo.extract(parsed);
|
|
3655
|
-
if (!segments) {
|
|
3656
|
-
return;
|
|
3657
|
-
}
|
|
3658
|
-
user = segments.user && decodeURIComponent(segments.user);
|
|
3659
|
-
project = decodeURIComponent(segments.project);
|
|
3660
|
-
committish = decodeURIComponent(segments.committish);
|
|
3661
|
-
defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1);
|
|
3662
|
-
}
|
|
3663
|
-
} catch (err) {
|
|
3664
|
-
if (err instanceof URIError) {
|
|
3665
|
-
return;
|
|
3666
|
-
} else {
|
|
3667
|
-
throw err;
|
|
3668
|
-
}
|
|
3669
|
-
}
|
|
3670
|
-
return [gitHostName, user, auth, project, committish, defaultRepresentation, opts];
|
|
3671
|
-
};
|
|
3672
|
-
}
|
|
3673
|
-
});
|
|
3674
|
-
|
|
3675
|
-
// node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/index.js
|
|
3676
|
-
var require_lib = __commonJS({
|
|
3677
|
-
"node_modules/.pnpm/hosted-git-info@9.0.2/node_modules/hosted-git-info/lib/index.js"(exports2, module2) {
|
|
3678
|
-
"use strict";
|
|
3679
|
-
var { LRUCache } = require_commonjs();
|
|
3680
|
-
var hosts = require_hosts();
|
|
3681
|
-
var fromUrl = require_from_url();
|
|
3682
|
-
var parseUrl = require_parse_url();
|
|
3683
|
-
var cache = new LRUCache({ max: 1e3 });
|
|
3684
|
-
function unknownHostedUrl(url) {
|
|
3685
|
-
try {
|
|
3686
|
-
const {
|
|
3687
|
-
protocol,
|
|
3688
|
-
hostname,
|
|
3689
|
-
pathname
|
|
3690
|
-
} = new URL(url);
|
|
3691
|
-
if (!hostname) {
|
|
3692
|
-
return null;
|
|
3693
|
-
}
|
|
3694
|
-
const proto = /(?:git\+)http:$/.test(protocol) ? "http:" : "https:";
|
|
3695
|
-
const path = pathname.replace(/\.git$/, "");
|
|
3696
|
-
return `${proto}//${hostname}${path}`;
|
|
3697
|
-
} catch {
|
|
3698
|
-
return null;
|
|
3699
|
-
}
|
|
3700
|
-
}
|
|
3701
|
-
__name(unknownHostedUrl, "unknownHostedUrl");
|
|
3702
|
-
var GitHost = class _GitHost {
|
|
3703
|
-
static {
|
|
3704
|
-
__name(this, "GitHost");
|
|
3705
|
-
}
|
|
3706
|
-
constructor(type, user, auth, project, committish, defaultRepresentation, opts = {}) {
|
|
3707
|
-
Object.assign(this, _GitHost.#gitHosts[type], {
|
|
3708
|
-
type,
|
|
3709
|
-
user,
|
|
3710
|
-
auth,
|
|
3711
|
-
project,
|
|
3712
|
-
committish,
|
|
3713
|
-
default: defaultRepresentation,
|
|
3714
|
-
opts
|
|
3715
|
-
});
|
|
3716
|
-
}
|
|
3717
|
-
static #gitHosts = { byShortcut: {}, byDomain: {} };
|
|
3718
|
-
static #protocols = {
|
|
3719
|
-
"git+ssh:": { name: "sshurl" },
|
|
3720
|
-
"ssh:": { name: "sshurl" },
|
|
3721
|
-
"git+https:": { name: "https", auth: true },
|
|
3722
|
-
"git:": { auth: true },
|
|
3723
|
-
"http:": { auth: true },
|
|
3724
|
-
"https:": { auth: true },
|
|
3725
|
-
"git+http:": { auth: true }
|
|
3726
|
-
};
|
|
3727
|
-
static addHost(name, host) {
|
|
3728
|
-
_GitHost.#gitHosts[name] = host;
|
|
3729
|
-
_GitHost.#gitHosts.byDomain[host.domain] = name;
|
|
3730
|
-
_GitHost.#gitHosts.byShortcut[`${name}:`] = name;
|
|
3731
|
-
_GitHost.#protocols[`${name}:`] = { name };
|
|
3732
|
-
}
|
|
3733
|
-
static fromUrl(giturl, opts) {
|
|
3734
|
-
if (typeof giturl !== "string") {
|
|
3735
|
-
return;
|
|
3736
|
-
}
|
|
3737
|
-
const key = giturl + JSON.stringify(opts || {});
|
|
3738
|
-
if (!cache.has(key)) {
|
|
3739
|
-
const hostArgs = fromUrl(giturl, opts, {
|
|
3740
|
-
gitHosts: _GitHost.#gitHosts,
|
|
3741
|
-
protocols: _GitHost.#protocols
|
|
3742
|
-
});
|
|
3743
|
-
cache.set(key, hostArgs ? new _GitHost(...hostArgs) : void 0);
|
|
3744
|
-
}
|
|
3745
|
-
return cache.get(key);
|
|
3746
|
-
}
|
|
3747
|
-
static fromManifest(manifest, opts = {}) {
|
|
3748
|
-
if (!manifest || typeof manifest !== "object") {
|
|
3749
|
-
return;
|
|
3750
|
-
}
|
|
3751
|
-
const r = manifest.repository;
|
|
3752
|
-
const rurl = r && (typeof r === "string" ? r : typeof r === "object" && typeof r.url === "string" ? r.url : null);
|
|
3753
|
-
if (!rurl) {
|
|
3754
|
-
throw new Error("no repository");
|
|
3755
|
-
}
|
|
3756
|
-
const info = rurl && _GitHost.fromUrl(rurl.replace(/^git\+/, ""), opts) || null;
|
|
3757
|
-
if (info) {
|
|
3758
|
-
return info;
|
|
3759
|
-
}
|
|
3760
|
-
const unk = unknownHostedUrl(rurl);
|
|
3761
|
-
return _GitHost.fromUrl(unk, opts) || unk;
|
|
3762
|
-
}
|
|
3763
|
-
static parseUrl(url) {
|
|
3764
|
-
return parseUrl(url);
|
|
3765
|
-
}
|
|
3766
|
-
#fill(template, opts) {
|
|
3767
|
-
if (typeof template !== "function") {
|
|
3768
|
-
return null;
|
|
3769
|
-
}
|
|
3770
|
-
const options = { ...this, ...this.opts, ...opts };
|
|
3771
|
-
if (!options.path) {
|
|
3772
|
-
options.path = "";
|
|
3773
|
-
}
|
|
3774
|
-
if (options.path.startsWith("/")) {
|
|
3775
|
-
options.path = options.path.slice(1);
|
|
3776
|
-
}
|
|
3777
|
-
if (options.noCommittish) {
|
|
3778
|
-
options.committish = null;
|
|
3779
|
-
}
|
|
3780
|
-
const result = template(options);
|
|
3781
|
-
return options.noGitPlus && result.startsWith("git+") ? result.slice(4) : result;
|
|
3782
|
-
}
|
|
3783
|
-
hash() {
|
|
3784
|
-
return this.committish ? `#${this.committish}` : "";
|
|
3785
|
-
}
|
|
3786
|
-
ssh(opts) {
|
|
3787
|
-
return this.#fill(this.sshtemplate, opts);
|
|
3788
|
-
}
|
|
3789
|
-
sshurl(opts) {
|
|
3790
|
-
return this.#fill(this.sshurltemplate, opts);
|
|
3791
|
-
}
|
|
3792
|
-
browse(path, ...args) {
|
|
3793
|
-
if (typeof path !== "string") {
|
|
3794
|
-
return this.#fill(this.browsetemplate, path);
|
|
3795
|
-
}
|
|
3796
|
-
if (typeof args[0] !== "string") {
|
|
3797
|
-
return this.#fill(this.browsetreetemplate, { ...args[0], path });
|
|
3798
|
-
}
|
|
3799
|
-
return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path });
|
|
3800
|
-
}
|
|
3801
|
-
// If the path is known to be a file, then browseFile should be used. For some hosts
|
|
3802
|
-
// the url is the same as browse, but for others like GitHub a file can use both `/tree/`
|
|
3803
|
-
// and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/`
|
|
3804
|
-
// path will redirect to a specific commit. Using the `/blob/` path avoids this and
|
|
3805
|
-
// does not redirect to a different commit.
|
|
3806
|
-
browseFile(path, ...args) {
|
|
3807
|
-
if (typeof args[0] !== "string") {
|
|
3808
|
-
return this.#fill(this.browseblobtemplate, { ...args[0], path });
|
|
3809
|
-
}
|
|
3810
|
-
return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path });
|
|
3811
|
-
}
|
|
3812
|
-
docs(opts) {
|
|
3813
|
-
return this.#fill(this.docstemplate, opts);
|
|
3814
|
-
}
|
|
3815
|
-
bugs(opts) {
|
|
3816
|
-
return this.#fill(this.bugstemplate, opts);
|
|
3817
|
-
}
|
|
3818
|
-
https(opts) {
|
|
3819
|
-
return this.#fill(this.httpstemplate, opts);
|
|
3820
|
-
}
|
|
3821
|
-
git(opts) {
|
|
3822
|
-
return this.#fill(this.gittemplate, opts);
|
|
3823
|
-
}
|
|
3824
|
-
shortcut(opts) {
|
|
3825
|
-
return this.#fill(this.shortcuttemplate, opts);
|
|
3826
|
-
}
|
|
3827
|
-
path(opts) {
|
|
3828
|
-
return this.#fill(this.pathtemplate, opts);
|
|
3829
|
-
}
|
|
3830
|
-
tarball(opts) {
|
|
3831
|
-
return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false });
|
|
3832
|
-
}
|
|
3833
|
-
file(path, opts) {
|
|
3834
|
-
return this.#fill(this.filetemplate, { ...opts, path });
|
|
3835
|
-
}
|
|
3836
|
-
edit(path, opts) {
|
|
3837
|
-
return this.#fill(this.edittemplate, { ...opts, path });
|
|
3838
|
-
}
|
|
3839
|
-
getDefaultRepresentation() {
|
|
3840
|
-
return this.default;
|
|
3841
|
-
}
|
|
3842
|
-
toString(opts) {
|
|
3843
|
-
if (this.default && typeof this[this.default] === "function") {
|
|
3844
|
-
return this[this.default](opts);
|
|
3845
|
-
}
|
|
3846
|
-
return this.sshurl(opts);
|
|
3847
|
-
}
|
|
3848
|
-
};
|
|
3849
|
-
for (const [name, host] of Object.entries(hosts)) {
|
|
3850
|
-
GitHost.addHost(name, host);
|
|
3851
|
-
}
|
|
3852
|
-
module2.exports = GitHost;
|
|
3853
|
-
}
|
|
3854
|
-
});
|
|
3855
|
-
|
|
3856
|
-
// node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/extract_description.js
|
|
3857
|
-
var require_extract_description = __commonJS({
|
|
3858
|
-
"node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/extract_description.js"(exports2, module2) {
|
|
3859
|
-
module2.exports = extractDescription;
|
|
3860
|
-
function extractDescription(d) {
|
|
3861
|
-
if (!d) {
|
|
3862
|
-
return;
|
|
3863
|
-
}
|
|
3864
|
-
if (d === "ERROR: No README data found!") {
|
|
3865
|
-
return;
|
|
3866
|
-
}
|
|
3867
|
-
d = d.trim().split("\n");
|
|
3868
|
-
let s = 0;
|
|
3869
|
-
while (d[s] && d[s].trim().match(/^(#|$)/)) {
|
|
3870
|
-
s++;
|
|
3871
|
-
}
|
|
3872
|
-
const l = d.length;
|
|
3873
|
-
let e = s + 1;
|
|
3874
|
-
while (e < l && d[e].trim()) {
|
|
3875
|
-
e++;
|
|
3876
|
-
}
|
|
3877
|
-
return d.slice(s, e).join(" ").trim();
|
|
3878
|
-
}
|
|
3879
|
-
__name(extractDescription, "extractDescription");
|
|
3880
|
-
}
|
|
3881
|
-
});
|
|
3882
|
-
|
|
3883
|
-
// node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/typos.json
|
|
3884
|
-
var require_typos = __commonJS({
|
|
3885
|
-
"node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/typos.json"(exports2, module2) {
|
|
3886
|
-
module2.exports = {
|
|
3887
|
-
topLevel: {
|
|
3888
|
-
dependancies: "dependencies",
|
|
3889
|
-
dependecies: "dependencies",
|
|
3890
|
-
depdenencies: "dependencies",
|
|
3891
|
-
devEependencies: "devDependencies",
|
|
3892
|
-
depends: "dependencies",
|
|
3893
|
-
"dev-dependencies": "devDependencies",
|
|
3894
|
-
devDependences: "devDependencies",
|
|
3895
|
-
devDepenencies: "devDependencies",
|
|
3896
|
-
devdependencies: "devDependencies",
|
|
3897
|
-
repostitory: "repository",
|
|
3898
|
-
repo: "repository",
|
|
3899
|
-
prefereGlobal: "preferGlobal",
|
|
3900
|
-
hompage: "homepage",
|
|
3901
|
-
hampage: "homepage",
|
|
3902
|
-
autohr: "author",
|
|
3903
|
-
autor: "author",
|
|
3904
|
-
contributers: "contributors",
|
|
3905
|
-
publicationConfig: "publishConfig",
|
|
3906
|
-
script: "scripts"
|
|
3907
|
-
},
|
|
3908
|
-
bugs: { web: "url", name: "url" },
|
|
3909
|
-
script: { server: "start", tests: "test" }
|
|
3910
|
-
};
|
|
3911
|
-
}
|
|
3912
|
-
});
|
|
3913
|
-
|
|
3914
|
-
// node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/fixer.js
|
|
3915
|
-
var require_fixer = __commonJS({
|
|
3916
|
-
"node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/fixer.js"(exports2, module2) {
|
|
3917
|
-
var { URL: URL2 } = require("node:url");
|
|
3918
|
-
var isValidSemver = require_valid();
|
|
3919
|
-
var cleanSemver = require_clean();
|
|
3920
|
-
var validateLicense = require_validate_npm_package_license();
|
|
3921
|
-
var hostedGitInfo = require_lib();
|
|
3922
|
-
var { isBuiltin } = require("node:module");
|
|
3923
|
-
var depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
|
3924
|
-
var extractDescription = require_extract_description();
|
|
3925
|
-
var typos = require_typos();
|
|
3926
|
-
var isEmail = /* @__PURE__ */ __name((str) => str.includes("@") && str.indexOf("@") < str.lastIndexOf("."), "isEmail");
|
|
3927
|
-
module2.exports = {
|
|
3928
|
-
// default warning function
|
|
3929
|
-
warn: /* @__PURE__ */ __name(function() {
|
|
3930
|
-
}, "warn"),
|
|
3931
|
-
fixRepositoryField: /* @__PURE__ */ __name(function(data) {
|
|
3932
|
-
if (data.repositories) {
|
|
3933
|
-
this.warn("repositories");
|
|
3934
|
-
data.repository = data.repositories[0];
|
|
3935
|
-
}
|
|
3936
|
-
if (!data.repository) {
|
|
3937
|
-
return this.warn("missingRepository");
|
|
3938
|
-
}
|
|
3939
|
-
if (typeof data.repository === "string") {
|
|
3940
|
-
data.repository = {
|
|
3941
|
-
type: "git",
|
|
3942
|
-
url: data.repository
|
|
3943
|
-
};
|
|
3944
|
-
}
|
|
3945
|
-
var r = data.repository.url || "";
|
|
3946
|
-
if (r) {
|
|
3947
|
-
var hosted = hostedGitInfo.fromUrl(r);
|
|
3948
|
-
if (hosted) {
|
|
3949
|
-
r = data.repository.url = hosted.getDefaultRepresentation() === "shortcut" ? hosted.https() : hosted.toString();
|
|
3950
|
-
}
|
|
3951
|
-
}
|
|
3952
|
-
if (r.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)) {
|
|
3953
|
-
this.warn("brokenGitUrl", r);
|
|
3954
|
-
}
|
|
3955
|
-
}, "fixRepositoryField"),
|
|
3956
|
-
fixTypos: /* @__PURE__ */ __name(function(data) {
|
|
3957
|
-
Object.keys(typos.topLevel).forEach(function(d) {
|
|
3958
|
-
if (Object.prototype.hasOwnProperty.call(data, d)) {
|
|
3959
|
-
this.warn("typo", d, typos.topLevel[d]);
|
|
3960
|
-
}
|
|
3961
|
-
}, this);
|
|
3962
|
-
}, "fixTypos"),
|
|
3963
|
-
fixScriptsField: /* @__PURE__ */ __name(function(data) {
|
|
3964
|
-
if (!data.scripts) {
|
|
3965
|
-
return;
|
|
3966
|
-
}
|
|
3967
|
-
if (typeof data.scripts !== "object") {
|
|
3968
|
-
this.warn("nonObjectScripts");
|
|
3969
|
-
delete data.scripts;
|
|
3970
|
-
return;
|
|
3971
|
-
}
|
|
3972
|
-
Object.keys(data.scripts).forEach(function(k) {
|
|
3973
|
-
if (typeof data.scripts[k] !== "string") {
|
|
3974
|
-
this.warn("nonStringScript");
|
|
3975
|
-
delete data.scripts[k];
|
|
3976
|
-
} else if (typos.script[k] && !data.scripts[typos.script[k]]) {
|
|
3977
|
-
this.warn("typo", k, typos.script[k], "scripts");
|
|
3978
|
-
}
|
|
3979
|
-
}, this);
|
|
3980
|
-
}, "fixScriptsField"),
|
|
3981
|
-
fixFilesField: /* @__PURE__ */ __name(function(data) {
|
|
3982
|
-
var files = data.files;
|
|
3983
|
-
if (files && !Array.isArray(files)) {
|
|
3984
|
-
this.warn("nonArrayFiles");
|
|
3985
|
-
delete data.files;
|
|
3986
|
-
} else if (data.files) {
|
|
3987
|
-
data.files = data.files.filter(function(file) {
|
|
3988
|
-
if (!file || typeof file !== "string") {
|
|
3989
|
-
this.warn("invalidFilename", file);
|
|
3990
|
-
return false;
|
|
3991
|
-
} else {
|
|
3992
|
-
return true;
|
|
3993
|
-
}
|
|
3994
|
-
}, this);
|
|
3995
|
-
}
|
|
3996
|
-
}, "fixFilesField"),
|
|
3997
|
-
fixBinField: /* @__PURE__ */ __name(function(data) {
|
|
3998
|
-
if (!data.bin) {
|
|
3999
|
-
return;
|
|
4000
|
-
}
|
|
4001
|
-
if (typeof data.bin === "string") {
|
|
4002
|
-
var b = {};
|
|
4003
|
-
var match;
|
|
4004
|
-
if (match = data.name.match(/^@[^/]+[/](.*)$/)) {
|
|
4005
|
-
b[match[1]] = data.bin;
|
|
4006
|
-
} else {
|
|
4007
|
-
b[data.name] = data.bin;
|
|
4008
|
-
}
|
|
4009
|
-
data.bin = b;
|
|
4010
|
-
}
|
|
4011
|
-
}, "fixBinField"),
|
|
4012
|
-
fixManField: /* @__PURE__ */ __name(function(data) {
|
|
4013
|
-
if (!data.man) {
|
|
4014
|
-
return;
|
|
4015
|
-
}
|
|
4016
|
-
if (typeof data.man === "string") {
|
|
4017
|
-
data.man = [data.man];
|
|
4018
|
-
}
|
|
4019
|
-
}, "fixManField"),
|
|
4020
|
-
fixBundleDependenciesField: /* @__PURE__ */ __name(function(data) {
|
|
4021
|
-
var bdd = "bundledDependencies";
|
|
4022
|
-
var bd = "bundleDependencies";
|
|
4023
|
-
if (data[bdd] && !data[bd]) {
|
|
4024
|
-
data[bd] = data[bdd];
|
|
4025
|
-
delete data[bdd];
|
|
4026
|
-
}
|
|
4027
|
-
if (data[bd] && !Array.isArray(data[bd])) {
|
|
4028
|
-
this.warn("nonArrayBundleDependencies");
|
|
4029
|
-
delete data[bd];
|
|
4030
|
-
} else if (data[bd]) {
|
|
4031
|
-
data[bd] = data[bd].filter(function(filtered) {
|
|
4032
|
-
if (!filtered || typeof filtered !== "string") {
|
|
4033
|
-
this.warn("nonStringBundleDependency", filtered);
|
|
4034
|
-
return false;
|
|
4035
|
-
} else {
|
|
4036
|
-
if (!data.dependencies) {
|
|
4037
|
-
data.dependencies = {};
|
|
4038
|
-
}
|
|
4039
|
-
if (!Object.prototype.hasOwnProperty.call(data.dependencies, filtered)) {
|
|
4040
|
-
this.warn("nonDependencyBundleDependency", filtered);
|
|
4041
|
-
data.dependencies[filtered] = "*";
|
|
4042
|
-
}
|
|
4043
|
-
return true;
|
|
4044
|
-
}
|
|
4045
|
-
}, this);
|
|
4046
|
-
}
|
|
4047
|
-
}, "fixBundleDependenciesField"),
|
|
4048
|
-
fixDependencies: /* @__PURE__ */ __name(function(data) {
|
|
4049
|
-
objectifyDeps(data, this.warn);
|
|
4050
|
-
addOptionalDepsToDeps(data, this.warn);
|
|
4051
|
-
this.fixBundleDependenciesField(data);
|
|
4052
|
-
["dependencies", "devDependencies"].forEach(function(deps) {
|
|
4053
|
-
if (!(deps in data)) {
|
|
4054
|
-
return;
|
|
4055
|
-
}
|
|
4056
|
-
if (!data[deps] || typeof data[deps] !== "object") {
|
|
4057
|
-
this.warn("nonObjectDependencies", deps);
|
|
4058
|
-
delete data[deps];
|
|
4059
|
-
return;
|
|
4060
|
-
}
|
|
4061
|
-
Object.keys(data[deps]).forEach(function(d) {
|
|
4062
|
-
var r = data[deps][d];
|
|
4063
|
-
if (typeof r !== "string") {
|
|
4064
|
-
this.warn("nonStringDependency", d, JSON.stringify(r));
|
|
4065
|
-
delete data[deps][d];
|
|
4066
|
-
}
|
|
4067
|
-
var hosted = hostedGitInfo.fromUrl(data[deps][d]);
|
|
4068
|
-
if (hosted) {
|
|
4069
|
-
data[deps][d] = hosted.toString();
|
|
4070
|
-
}
|
|
4071
|
-
}, this);
|
|
4072
|
-
}, this);
|
|
4073
|
-
}, "fixDependencies"),
|
|
4074
|
-
fixModulesField: /* @__PURE__ */ __name(function(data) {
|
|
4075
|
-
if (data.modules) {
|
|
4076
|
-
this.warn("deprecatedModules");
|
|
4077
|
-
delete data.modules;
|
|
4078
|
-
}
|
|
4079
|
-
}, "fixModulesField"),
|
|
4080
|
-
fixKeywordsField: /* @__PURE__ */ __name(function(data) {
|
|
4081
|
-
if (typeof data.keywords === "string") {
|
|
4082
|
-
data.keywords = data.keywords.split(/,\s+/);
|
|
4083
|
-
}
|
|
4084
|
-
if (data.keywords && !Array.isArray(data.keywords)) {
|
|
4085
|
-
delete data.keywords;
|
|
4086
|
-
this.warn("nonArrayKeywords");
|
|
4087
|
-
} else if (data.keywords) {
|
|
4088
|
-
data.keywords = data.keywords.filter(function(kw) {
|
|
4089
|
-
if (typeof kw !== "string" || !kw) {
|
|
4090
|
-
this.warn("nonStringKeyword");
|
|
4091
|
-
return false;
|
|
4092
|
-
} else {
|
|
4093
|
-
return true;
|
|
4094
|
-
}
|
|
4095
|
-
}, this);
|
|
4096
|
-
}
|
|
4097
|
-
}, "fixKeywordsField"),
|
|
4098
|
-
fixVersionField: /* @__PURE__ */ __name(function(data, strict) {
|
|
4099
|
-
var loose = !strict;
|
|
4100
|
-
if (!data.version) {
|
|
4101
|
-
data.version = "";
|
|
4102
|
-
return true;
|
|
4103
|
-
}
|
|
4104
|
-
if (!isValidSemver(data.version, loose)) {
|
|
4105
|
-
throw new Error('Invalid version: "' + data.version + '"');
|
|
4106
|
-
}
|
|
4107
|
-
data.version = cleanSemver(data.version, loose);
|
|
4108
|
-
return true;
|
|
4109
|
-
}, "fixVersionField"),
|
|
4110
|
-
fixPeople: /* @__PURE__ */ __name(function(data) {
|
|
4111
|
-
modifyPeople(data, unParsePerson);
|
|
4112
|
-
modifyPeople(data, parsePerson);
|
|
4113
|
-
}, "fixPeople"),
|
|
4114
|
-
fixNameField: /* @__PURE__ */ __name(function(data, options) {
|
|
4115
|
-
if (typeof options === "boolean") {
|
|
4116
|
-
options = { strict: options };
|
|
4117
|
-
} else if (typeof options === "undefined") {
|
|
4118
|
-
options = {};
|
|
4119
|
-
}
|
|
4120
|
-
var strict = options.strict;
|
|
4121
|
-
if (!data.name && !strict) {
|
|
4122
|
-
data.name = "";
|
|
4123
|
-
return;
|
|
4124
|
-
}
|
|
4125
|
-
if (typeof data.name !== "string") {
|
|
4126
|
-
throw new Error("name field must be a string.");
|
|
4127
|
-
}
|
|
4128
|
-
if (!strict) {
|
|
4129
|
-
data.name = data.name.trim();
|
|
4130
|
-
}
|
|
4131
|
-
ensureValidName(data.name, strict, options.allowLegacyCase);
|
|
4132
|
-
if (isBuiltin(data.name)) {
|
|
4133
|
-
this.warn("conflictingName", data.name);
|
|
4134
|
-
}
|
|
4135
|
-
}, "fixNameField"),
|
|
4136
|
-
fixDescriptionField: /* @__PURE__ */ __name(function(data) {
|
|
4137
|
-
if (data.description && typeof data.description !== "string") {
|
|
4138
|
-
this.warn("nonStringDescription");
|
|
4139
|
-
delete data.description;
|
|
4140
|
-
}
|
|
4141
|
-
if (data.readme && !data.description) {
|
|
4142
|
-
data.description = extractDescription(data.readme);
|
|
4143
|
-
}
|
|
4144
|
-
if (data.description === void 0) {
|
|
4145
|
-
delete data.description;
|
|
4146
|
-
}
|
|
4147
|
-
if (!data.description) {
|
|
4148
|
-
this.warn("missingDescription");
|
|
4149
|
-
}
|
|
4150
|
-
}, "fixDescriptionField"),
|
|
4151
|
-
fixReadmeField: /* @__PURE__ */ __name(function(data) {
|
|
4152
|
-
if (!data.readme) {
|
|
4153
|
-
this.warn("missingReadme");
|
|
4154
|
-
data.readme = "ERROR: No README data found!";
|
|
4155
|
-
}
|
|
4156
|
-
}, "fixReadmeField"),
|
|
4157
|
-
fixBugsField: /* @__PURE__ */ __name(function(data) {
|
|
4158
|
-
if (!data.bugs && data.repository && data.repository.url) {
|
|
4159
|
-
var hosted = hostedGitInfo.fromUrl(data.repository.url);
|
|
4160
|
-
if (hosted && hosted.bugs()) {
|
|
4161
|
-
data.bugs = { url: hosted.bugs() };
|
|
4162
|
-
}
|
|
4163
|
-
} else if (data.bugs) {
|
|
4164
|
-
if (typeof data.bugs === "string") {
|
|
4165
|
-
if (isEmail(data.bugs)) {
|
|
4166
|
-
data.bugs = { email: data.bugs };
|
|
4167
|
-
} else if (URL2.canParse(data.bugs)) {
|
|
4168
|
-
data.bugs = { url: data.bugs };
|
|
4169
|
-
} else {
|
|
4170
|
-
this.warn("nonEmailUrlBugsString");
|
|
4171
|
-
}
|
|
4172
|
-
} else {
|
|
4173
|
-
bugsTypos(data.bugs, this.warn);
|
|
4174
|
-
var oldBugs = data.bugs;
|
|
4175
|
-
data.bugs = {};
|
|
4176
|
-
if (oldBugs.url) {
|
|
4177
|
-
if (URL2.canParse(oldBugs.url)) {
|
|
4178
|
-
data.bugs.url = oldBugs.url;
|
|
4179
|
-
} else {
|
|
4180
|
-
this.warn("nonUrlBugsUrlField");
|
|
4181
|
-
}
|
|
4182
|
-
}
|
|
4183
|
-
if (oldBugs.email) {
|
|
4184
|
-
if (typeof oldBugs.email === "string" && isEmail(oldBugs.email)) {
|
|
4185
|
-
data.bugs.email = oldBugs.email;
|
|
4186
|
-
} else {
|
|
4187
|
-
this.warn("nonEmailBugsEmailField");
|
|
4188
|
-
}
|
|
4189
|
-
}
|
|
4190
|
-
}
|
|
4191
|
-
if (!data.bugs.email && !data.bugs.url) {
|
|
4192
|
-
delete data.bugs;
|
|
4193
|
-
this.warn("emptyNormalizedBugs");
|
|
4194
|
-
}
|
|
4195
|
-
}
|
|
4196
|
-
}, "fixBugsField"),
|
|
4197
|
-
fixHomepageField: /* @__PURE__ */ __name(function(data) {
|
|
4198
|
-
if (!data.homepage && data.repository && data.repository.url) {
|
|
4199
|
-
var hosted = hostedGitInfo.fromUrl(data.repository.url);
|
|
4200
|
-
if (hosted && hosted.docs()) {
|
|
4201
|
-
data.homepage = hosted.docs();
|
|
4202
|
-
}
|
|
4203
|
-
}
|
|
4204
|
-
if (!data.homepage) {
|
|
4205
|
-
return;
|
|
4206
|
-
}
|
|
4207
|
-
if (typeof data.homepage !== "string") {
|
|
4208
|
-
this.warn("nonUrlHomepage");
|
|
4209
|
-
return delete data.homepage;
|
|
4210
|
-
}
|
|
4211
|
-
if (!URL2.canParse(data.homepage)) {
|
|
4212
|
-
data.homepage = "http://" + data.homepage;
|
|
4213
|
-
}
|
|
4214
|
-
}, "fixHomepageField"),
|
|
4215
|
-
fixLicenseField: /* @__PURE__ */ __name(function(data) {
|
|
4216
|
-
const license = data.license || data.licence;
|
|
4217
|
-
if (!license) {
|
|
4218
|
-
return this.warn("missingLicense");
|
|
4219
|
-
}
|
|
4220
|
-
if (typeof license !== "string" || license.length < 1 || license.trim() === "") {
|
|
4221
|
-
return this.warn("invalidLicense");
|
|
4222
|
-
}
|
|
4223
|
-
if (!validateLicense(license).validForNewPackages) {
|
|
4224
|
-
return this.warn("invalidLicense");
|
|
4225
|
-
}
|
|
4226
|
-
}, "fixLicenseField")
|
|
4227
|
-
};
|
|
4228
|
-
function isValidScopedPackageName(spec) {
|
|
4229
|
-
if (spec.charAt(0) !== "@") {
|
|
4230
|
-
return false;
|
|
4231
|
-
}
|
|
4232
|
-
var rest = spec.slice(1).split("/");
|
|
4233
|
-
if (rest.length !== 2) {
|
|
4234
|
-
return false;
|
|
4235
|
-
}
|
|
4236
|
-
return rest[0] && rest[1] && rest[0] === encodeURIComponent(rest[0]) && rest[1] === encodeURIComponent(rest[1]);
|
|
4237
|
-
}
|
|
4238
|
-
__name(isValidScopedPackageName, "isValidScopedPackageName");
|
|
4239
|
-
function isCorrectlyEncodedName(spec) {
|
|
4240
|
-
return !spec.match(/[/@\s+%:]/) && spec === encodeURIComponent(spec);
|
|
4241
|
-
}
|
|
4242
|
-
__name(isCorrectlyEncodedName, "isCorrectlyEncodedName");
|
|
4243
|
-
function ensureValidName(name, strict, allowLegacyCase) {
|
|
4244
|
-
if (name.charAt(0) === "." || !(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) || strict && !allowLegacyCase && name !== name.toLowerCase() || name.toLowerCase() === "node_modules" || name.toLowerCase() === "favicon.ico") {
|
|
4245
|
-
throw new Error("Invalid name: " + JSON.stringify(name));
|
|
4246
|
-
}
|
|
4247
|
-
}
|
|
4248
|
-
__name(ensureValidName, "ensureValidName");
|
|
4249
|
-
function modifyPeople(data, fn) {
|
|
4250
|
-
if (data.author) {
|
|
4251
|
-
data.author = fn(data.author);
|
|
4252
|
-
}
|
|
4253
|
-
["maintainers", "contributors"].forEach(function(set) {
|
|
4254
|
-
if (!Array.isArray(data[set])) {
|
|
4255
|
-
return;
|
|
4256
|
-
}
|
|
4257
|
-
data[set] = data[set].map(fn);
|
|
4258
|
-
});
|
|
4259
|
-
return data;
|
|
4260
|
-
}
|
|
4261
|
-
__name(modifyPeople, "modifyPeople");
|
|
4262
|
-
function unParsePerson(person) {
|
|
4263
|
-
if (typeof person === "string") {
|
|
4264
|
-
return person;
|
|
4265
|
-
}
|
|
4266
|
-
var name = person.name || "";
|
|
4267
|
-
var u = person.url || person.web;
|
|
4268
|
-
var wrappedUrl = u ? " (" + u + ")" : "";
|
|
4269
|
-
var e = person.email || person.mail;
|
|
4270
|
-
var wrappedEmail = e ? " <" + e + ">" : "";
|
|
4271
|
-
return name + wrappedEmail + wrappedUrl;
|
|
4272
|
-
}
|
|
4273
|
-
__name(unParsePerson, "unParsePerson");
|
|
4274
|
-
function parsePerson(person) {
|
|
4275
|
-
if (typeof person !== "string") {
|
|
4276
|
-
return person;
|
|
4277
|
-
}
|
|
4278
|
-
var matchedName = person.match(/^([^(<]+)/);
|
|
4279
|
-
var matchedUrl = person.match(/\(([^()]+)\)/);
|
|
4280
|
-
var matchedEmail = person.match(/<([^<>]+)>/);
|
|
4281
|
-
var obj = {};
|
|
4282
|
-
if (matchedName && matchedName[0].trim()) {
|
|
4283
|
-
obj.name = matchedName[0].trim();
|
|
4284
|
-
}
|
|
4285
|
-
if (matchedEmail) {
|
|
4286
|
-
obj.email = matchedEmail[1];
|
|
4287
|
-
}
|
|
4288
|
-
if (matchedUrl) {
|
|
4289
|
-
obj.url = matchedUrl[1];
|
|
4290
|
-
}
|
|
4291
|
-
return obj;
|
|
4292
|
-
}
|
|
4293
|
-
__name(parsePerson, "parsePerson");
|
|
4294
|
-
function addOptionalDepsToDeps(data) {
|
|
4295
|
-
var o = data.optionalDependencies;
|
|
4296
|
-
if (!o) {
|
|
4297
|
-
return;
|
|
4298
|
-
}
|
|
4299
|
-
var d = data.dependencies || {};
|
|
4300
|
-
Object.keys(o).forEach(function(k) {
|
|
4301
|
-
d[k] = o[k];
|
|
4302
|
-
});
|
|
4303
|
-
data.dependencies = d;
|
|
4304
|
-
}
|
|
4305
|
-
__name(addOptionalDepsToDeps, "addOptionalDepsToDeps");
|
|
4306
|
-
function depObjectify(deps, type, warn) {
|
|
4307
|
-
if (!deps) {
|
|
4308
|
-
return {};
|
|
4309
|
-
}
|
|
4310
|
-
if (typeof deps === "string") {
|
|
4311
|
-
deps = deps.trim().split(/[\n\r\s\t ,]+/);
|
|
4312
|
-
}
|
|
4313
|
-
if (!Array.isArray(deps)) {
|
|
4314
|
-
return deps;
|
|
4315
|
-
}
|
|
4316
|
-
warn("deprecatedArrayDependencies", type);
|
|
4317
|
-
var o = {};
|
|
4318
|
-
deps.filter(function(d) {
|
|
4319
|
-
return typeof d === "string";
|
|
4320
|
-
}).forEach(function(d) {
|
|
4321
|
-
d = d.trim().split(/(:?[@\s><=])/);
|
|
4322
|
-
var dn = d.shift();
|
|
4323
|
-
var dv = d.join("");
|
|
4324
|
-
dv = dv.trim();
|
|
4325
|
-
dv = dv.replace(/^@/, "");
|
|
4326
|
-
o[dn] = dv;
|
|
4327
|
-
});
|
|
4328
|
-
return o;
|
|
4329
|
-
}
|
|
4330
|
-
__name(depObjectify, "depObjectify");
|
|
4331
|
-
function objectifyDeps(data, warn) {
|
|
4332
|
-
depTypes.forEach(function(type) {
|
|
4333
|
-
if (!data[type]) {
|
|
4334
|
-
return;
|
|
4335
|
-
}
|
|
4336
|
-
data[type] = depObjectify(data[type], type, warn);
|
|
4337
|
-
});
|
|
4338
|
-
}
|
|
4339
|
-
__name(objectifyDeps, "objectifyDeps");
|
|
4340
|
-
function bugsTypos(bugs, warn) {
|
|
4341
|
-
if (!bugs) {
|
|
4342
|
-
return;
|
|
4343
|
-
}
|
|
4344
|
-
Object.keys(bugs).forEach(function(k) {
|
|
4345
|
-
if (typos.bugs[k]) {
|
|
4346
|
-
warn("typo", k, typos.bugs[k], "bugs");
|
|
4347
|
-
bugs[typos.bugs[k]] = bugs[k];
|
|
4348
|
-
delete bugs[k];
|
|
4349
|
-
}
|
|
4350
|
-
});
|
|
4351
|
-
}
|
|
4352
|
-
__name(bugsTypos, "bugsTypos");
|
|
4353
|
-
}
|
|
4354
|
-
});
|
|
4355
|
-
|
|
4356
|
-
// node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/warning_messages.json
|
|
4357
|
-
var require_warning_messages = __commonJS({
|
|
4358
|
-
"node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/warning_messages.json"(exports2, module2) {
|
|
4359
|
-
module2.exports = {
|
|
4360
|
-
repositories: "'repositories' (plural) Not supported. Please pick one as the 'repository' field",
|
|
4361
|
-
missingRepository: "No repository field.",
|
|
4362
|
-
brokenGitUrl: "Probably broken git url: %s",
|
|
4363
|
-
nonObjectScripts: "scripts must be an object",
|
|
4364
|
-
nonStringScript: "script values must be string commands",
|
|
4365
|
-
nonArrayFiles: "Invalid 'files' member",
|
|
4366
|
-
invalidFilename: "Invalid filename in 'files' list: %s",
|
|
4367
|
-
nonArrayBundleDependencies: "Invalid 'bundleDependencies' list. Must be array of package names",
|
|
4368
|
-
nonStringBundleDependency: "Invalid bundleDependencies member: %s",
|
|
4369
|
-
nonDependencyBundleDependency: "Non-dependency in bundleDependencies: %s",
|
|
4370
|
-
nonObjectDependencies: "%s field must be an object",
|
|
4371
|
-
nonStringDependency: "Invalid dependency: %s %s",
|
|
4372
|
-
deprecatedArrayDependencies: "specifying %s as array is deprecated",
|
|
4373
|
-
deprecatedModules: "modules field is deprecated",
|
|
4374
|
-
nonArrayKeywords: "keywords should be an array of strings",
|
|
4375
|
-
nonStringKeyword: "keywords should be an array of strings",
|
|
4376
|
-
conflictingName: "%s is also the name of a node core module.",
|
|
4377
|
-
nonStringDescription: "'description' field should be a string",
|
|
4378
|
-
missingDescription: "No description",
|
|
4379
|
-
missingReadme: "No README data",
|
|
4380
|
-
missingLicense: "No license field.",
|
|
4381
|
-
nonEmailUrlBugsString: "Bug string field must be url, email, or {email,url}",
|
|
4382
|
-
nonUrlBugsUrlField: "bugs.url field must be a string url. Deleted.",
|
|
4383
|
-
nonEmailBugsEmailField: "bugs.email field must be a string email. Deleted.",
|
|
4384
|
-
emptyNormalizedBugs: "Normalized value of bugs field is an empty object. Deleted.",
|
|
4385
|
-
nonUrlHomepage: "homepage field must be a string url. Deleted.",
|
|
4386
|
-
invalidLicense: "license should be a valid SPDX license expression",
|
|
4387
|
-
typo: "%s should probably be %s."
|
|
4388
|
-
};
|
|
4389
|
-
}
|
|
4390
|
-
});
|
|
4391
|
-
|
|
4392
|
-
// node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/make_warning.js
|
|
4393
|
-
var require_make_warning = __commonJS({
|
|
4394
|
-
"node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/make_warning.js"(exports2, module2) {
|
|
4395
|
-
var util = require("util");
|
|
4396
|
-
var messages = require_warning_messages();
|
|
4397
|
-
module2.exports = function() {
|
|
4398
|
-
var args = Array.prototype.slice.call(arguments, 0);
|
|
4399
|
-
var warningName = args.shift();
|
|
4400
|
-
if (warningName === "typo") {
|
|
4401
|
-
return makeTypoWarning.apply(null, args);
|
|
4402
|
-
} else {
|
|
4403
|
-
var msgTemplate = messages[warningName] ? messages[warningName] : warningName + ": '%s'";
|
|
4404
|
-
args.unshift(msgTemplate);
|
|
4405
|
-
return util.format.apply(null, args);
|
|
4406
|
-
}
|
|
4407
|
-
};
|
|
4408
|
-
function makeTypoWarning(providedName, probableName, field) {
|
|
4409
|
-
if (field) {
|
|
4410
|
-
providedName = field + "['" + providedName + "']";
|
|
4411
|
-
probableName = field + "['" + probableName + "']";
|
|
4412
|
-
}
|
|
4413
|
-
return util.format(messages.typo, providedName, probableName);
|
|
4414
|
-
}
|
|
4415
|
-
__name(makeTypoWarning, "makeTypoWarning");
|
|
4416
|
-
}
|
|
4417
|
-
});
|
|
4418
|
-
|
|
4419
|
-
// node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/normalize.js
|
|
4420
|
-
var require_normalize = __commonJS({
|
|
4421
|
-
"node_modules/.pnpm/normalize-package-data@8.0.0/node_modules/normalize-package-data/lib/normalize.js"(exports2, module2) {
|
|
4422
|
-
module2.exports = normalize;
|
|
4423
|
-
var fixer = require_fixer();
|
|
4424
|
-
normalize.fixer = fixer;
|
|
4425
|
-
var makeWarning = require_make_warning();
|
|
4426
|
-
var fieldsToFix = [
|
|
4427
|
-
"name",
|
|
4428
|
-
"version",
|
|
4429
|
-
"description",
|
|
4430
|
-
"repository",
|
|
4431
|
-
"modules",
|
|
4432
|
-
"scripts",
|
|
4433
|
-
"files",
|
|
4434
|
-
"bin",
|
|
4435
|
-
"man",
|
|
4436
|
-
"bugs",
|
|
4437
|
-
"keywords",
|
|
4438
|
-
"readme",
|
|
4439
|
-
"homepage",
|
|
4440
|
-
"license"
|
|
4441
|
-
];
|
|
4442
|
-
var otherThingsToFix = ["dependencies", "people", "typos"];
|
|
4443
|
-
var thingsToFix = fieldsToFix.map(function(fieldName) {
|
|
4444
|
-
return ucFirst(fieldName) + "Field";
|
|
4445
|
-
});
|
|
4446
|
-
thingsToFix = thingsToFix.concat(otherThingsToFix);
|
|
4447
|
-
function normalize(data, warn, strict) {
|
|
4448
|
-
if (warn === true) {
|
|
4449
|
-
warn = null;
|
|
4450
|
-
strict = true;
|
|
4451
|
-
}
|
|
4452
|
-
if (!strict) {
|
|
4453
|
-
strict = false;
|
|
4454
|
-
}
|
|
4455
|
-
if (!warn || data.private) {
|
|
4456
|
-
warn = /* @__PURE__ */ __name(function() {
|
|
4457
|
-
}, "warn");
|
|
4458
|
-
}
|
|
4459
|
-
if (data.scripts && data.scripts.install === "node-gyp rebuild" && !data.scripts.preinstall) {
|
|
4460
|
-
data.gypfile = true;
|
|
4461
|
-
}
|
|
4462
|
-
fixer.warn = function() {
|
|
4463
|
-
warn(makeWarning.apply(null, arguments));
|
|
4464
|
-
};
|
|
4465
|
-
thingsToFix.forEach(function(thingName) {
|
|
4466
|
-
fixer["fix" + ucFirst(thingName)](data, strict);
|
|
4467
|
-
});
|
|
4468
|
-
data._id = data.name + "@" + data.version;
|
|
4469
|
-
}
|
|
4470
|
-
__name(normalize, "normalize");
|
|
4471
|
-
function ucFirst(string) {
|
|
4472
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
4473
|
-
}
|
|
4474
|
-
__name(ucFirst, "ucFirst");
|
|
4475
|
-
}
|
|
4476
|
-
});
|
|
4477
|
-
|
|
4478
|
-
// src/external/normalize-package-data.js
|
|
4479
|
-
module.exports = require_normalize();
|
|
3
|
+
// Re-export from npm-core bundle for better deduplication
|
|
4
|
+
const { normalizePackageData } = require('./npm-core')
|
|
5
|
+
module.exports = normalizePackageData
|