@zoralabs/protocol-sdk 0.7.3 → 0.7.4
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/.turbo/turbo-build.log +18 -16
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/dist/anvil.d.ts +2 -2
- package/dist/anvil.d.ts.map +1 -1
- package/dist/apis/http-api-base.d.ts.map +1 -1
- package/dist/index.cjs +2264 -318
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2287 -318
- package/dist/index.js.map +1 -1
- package/dist/ipfs/token-metadata.d.ts.map +1 -1
- package/dist/mint/mint-client.d.ts +1 -1
- package/dist/mint/mint-queries.d.ts +1 -1
- package/dist/mint/types.d.ts.map +1 -1
- package/dist/mints/mints-contracts.d.ts +1 -1
- package/dist/mints/mints-contracts.d.ts.map +1 -1
- package/dist/mints/mints-eth-unwrapper-and-caller.d.ts.map +1 -1
- package/dist/mints/mints-queries.d.ts.map +1 -1
- package/dist/mints/mints-relay-example.d.ts +3 -3
- package/dist/mints/mints-relay-example.d.ts.map +1 -1
- package/dist/premint/conversions.d.ts +5 -5
- package/dist/premint/conversions.d.ts.map +1 -1
- package/dist/premint/premint-api-client.d.ts +1 -1
- package/dist/premint/premint-api-client.d.ts.map +1 -1
- package/dist/premint/premint-client.d.ts +4 -4
- package/dist/premint/premint-client.d.ts.map +1 -1
- package/dist/premint/preminter.d.ts +3 -3
- package/dist/premint/preminter.d.ts.map +1 -1
- package/dist/preminter.d.ts +2 -2
- package/dist/preminter.d.ts.map +1 -1
- package/dist/test-utils.d.ts.map +1 -1
- package/package.json +17 -16
- package/tsconfig.build.json +2 -2
- package/tsconfig.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,1922 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from2, except, desc) => {
|
|
12
|
+
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from2))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __publicField = (obj, key, value) => {
|
|
28
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js
|
|
33
|
+
var require_constants = __commonJS({
|
|
34
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js"(exports, module) {
|
|
35
|
+
"use strict";
|
|
36
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
37
|
+
var MAX_LENGTH = 256;
|
|
38
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
39
|
+
9007199254740991;
|
|
40
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
41
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
42
|
+
var RELEASE_TYPES = [
|
|
43
|
+
"major",
|
|
44
|
+
"premajor",
|
|
45
|
+
"minor",
|
|
46
|
+
"preminor",
|
|
47
|
+
"patch",
|
|
48
|
+
"prepatch",
|
|
49
|
+
"prerelease"
|
|
50
|
+
];
|
|
51
|
+
module.exports = {
|
|
52
|
+
MAX_LENGTH,
|
|
53
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
54
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
55
|
+
MAX_SAFE_INTEGER,
|
|
56
|
+
RELEASE_TYPES,
|
|
57
|
+
SEMVER_SPEC_VERSION,
|
|
58
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
59
|
+
FLAG_LOOSE: 2
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js
|
|
65
|
+
var require_debug = __commonJS({
|
|
66
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js"(exports, module) {
|
|
67
|
+
"use strict";
|
|
68
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
69
|
+
};
|
|
70
|
+
module.exports = debug;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js
|
|
75
|
+
var require_re = __commonJS({
|
|
76
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js"(exports, module) {
|
|
77
|
+
"use strict";
|
|
78
|
+
var {
|
|
79
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
80
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
81
|
+
MAX_LENGTH
|
|
82
|
+
} = require_constants();
|
|
83
|
+
var debug = require_debug();
|
|
84
|
+
exports = module.exports = {};
|
|
85
|
+
var re = exports.re = [];
|
|
86
|
+
var safeRe = exports.safeRe = [];
|
|
87
|
+
var src2 = exports.src = [];
|
|
88
|
+
var t = exports.t = {};
|
|
89
|
+
var R = 0;
|
|
90
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
91
|
+
var safeRegexReplacements = [
|
|
92
|
+
["\\s", 1],
|
|
93
|
+
["\\d", MAX_LENGTH],
|
|
94
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
95
|
+
];
|
|
96
|
+
var makeSafeRegex = (value) => {
|
|
97
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
98
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
99
|
+
}
|
|
100
|
+
return value;
|
|
101
|
+
};
|
|
102
|
+
var createToken = (name, value, isGlobal) => {
|
|
103
|
+
const safe = makeSafeRegex(value);
|
|
104
|
+
const index = R++;
|
|
105
|
+
debug(name, index, value);
|
|
106
|
+
t[name] = index;
|
|
107
|
+
src2[index] = value;
|
|
108
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
109
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
110
|
+
};
|
|
111
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
112
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
113
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
114
|
+
createToken("MAINVERSION", `(${src2[t.NUMERICIDENTIFIER]})\\.(${src2[t.NUMERICIDENTIFIER]})\\.(${src2[t.NUMERICIDENTIFIER]})`);
|
|
115
|
+
createToken("MAINVERSIONLOOSE", `(${src2[t.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t.NUMERICIDENTIFIERLOOSE]})\\.(${src2[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
116
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src2[t.NUMERICIDENTIFIER]}|${src2[t.NONNUMERICIDENTIFIER]})`);
|
|
117
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src2[t.NUMERICIDENTIFIERLOOSE]}|${src2[t.NONNUMERICIDENTIFIER]})`);
|
|
118
|
+
createToken("PRERELEASE", `(?:-(${src2[t.PRERELEASEIDENTIFIER]}(?:\\.${src2[t.PRERELEASEIDENTIFIER]})*))`);
|
|
119
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src2[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src2[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
120
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
121
|
+
createToken("BUILD", `(?:\\+(${src2[t.BUILDIDENTIFIER]}(?:\\.${src2[t.BUILDIDENTIFIER]})*))`);
|
|
122
|
+
createToken("FULLPLAIN", `v?${src2[t.MAINVERSION]}${src2[t.PRERELEASE]}?${src2[t.BUILD]}?`);
|
|
123
|
+
createToken("FULL", `^${src2[t.FULLPLAIN]}$`);
|
|
124
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src2[t.MAINVERSIONLOOSE]}${src2[t.PRERELEASELOOSE]}?${src2[t.BUILD]}?`);
|
|
125
|
+
createToken("LOOSE", `^${src2[t.LOOSEPLAIN]}$`);
|
|
126
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
127
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src2[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
128
|
+
createToken("XRANGEIDENTIFIER", `${src2[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
129
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src2[t.XRANGEIDENTIFIER]})(?:\\.(${src2[t.XRANGEIDENTIFIER]})(?:\\.(${src2[t.XRANGEIDENTIFIER]})(?:${src2[t.PRERELEASE]})?${src2[t.BUILD]}?)?)?`);
|
|
130
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src2[t.XRANGEIDENTIFIERLOOSE]})(?:${src2[t.PRERELEASELOOSE]})?${src2[t.BUILD]}?)?)?`);
|
|
131
|
+
createToken("XRANGE", `^${src2[t.GTLT]}\\s*${src2[t.XRANGEPLAIN]}$`);
|
|
132
|
+
createToken("XRANGELOOSE", `^${src2[t.GTLT]}\\s*${src2[t.XRANGEPLAINLOOSE]}$`);
|
|
133
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
134
|
+
createToken("COERCE", `${src2[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
135
|
+
createToken("COERCEFULL", src2[t.COERCEPLAIN] + `(?:${src2[t.PRERELEASE]})?(?:${src2[t.BUILD]})?(?:$|[^\\d])`);
|
|
136
|
+
createToken("COERCERTL", src2[t.COERCE], true);
|
|
137
|
+
createToken("COERCERTLFULL", src2[t.COERCEFULL], true);
|
|
138
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
139
|
+
createToken("TILDETRIM", `(\\s*)${src2[t.LONETILDE]}\\s+`, true);
|
|
140
|
+
exports.tildeTrimReplace = "$1~";
|
|
141
|
+
createToken("TILDE", `^${src2[t.LONETILDE]}${src2[t.XRANGEPLAIN]}$`);
|
|
142
|
+
createToken("TILDELOOSE", `^${src2[t.LONETILDE]}${src2[t.XRANGEPLAINLOOSE]}$`);
|
|
143
|
+
createToken("LONECARET", "(?:\\^)");
|
|
144
|
+
createToken("CARETTRIM", `(\\s*)${src2[t.LONECARET]}\\s+`, true);
|
|
145
|
+
exports.caretTrimReplace = "$1^";
|
|
146
|
+
createToken("CARET", `^${src2[t.LONECARET]}${src2[t.XRANGEPLAIN]}$`);
|
|
147
|
+
createToken("CARETLOOSE", `^${src2[t.LONECARET]}${src2[t.XRANGEPLAINLOOSE]}$`);
|
|
148
|
+
createToken("COMPARATORLOOSE", `^${src2[t.GTLT]}\\s*(${src2[t.LOOSEPLAIN]})$|^$`);
|
|
149
|
+
createToken("COMPARATOR", `^${src2[t.GTLT]}\\s*(${src2[t.FULLPLAIN]})$|^$`);
|
|
150
|
+
createToken("COMPARATORTRIM", `(\\s*)${src2[t.GTLT]}\\s*(${src2[t.LOOSEPLAIN]}|${src2[t.XRANGEPLAIN]})`, true);
|
|
151
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
152
|
+
createToken("HYPHENRANGE", `^\\s*(${src2[t.XRANGEPLAIN]})\\s+-\\s+(${src2[t.XRANGEPLAIN]})\\s*$`);
|
|
153
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src2[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src2[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
154
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
155
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
156
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js
|
|
161
|
+
var require_parse_options = __commonJS({
|
|
162
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
163
|
+
"use strict";
|
|
164
|
+
var looseOption = Object.freeze({ loose: true });
|
|
165
|
+
var emptyOpts = Object.freeze({});
|
|
166
|
+
var parseOptions = (options) => {
|
|
167
|
+
if (!options) {
|
|
168
|
+
return emptyOpts;
|
|
169
|
+
}
|
|
170
|
+
if (typeof options !== "object") {
|
|
171
|
+
return looseOption;
|
|
172
|
+
}
|
|
173
|
+
return options;
|
|
174
|
+
};
|
|
175
|
+
module.exports = parseOptions;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js
|
|
180
|
+
var require_identifiers = __commonJS({
|
|
181
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
182
|
+
"use strict";
|
|
183
|
+
var numeric = /^[0-9]+$/;
|
|
184
|
+
var compareIdentifiers = (a, b) => {
|
|
185
|
+
const anum = numeric.test(a);
|
|
186
|
+
const bnum = numeric.test(b);
|
|
187
|
+
if (anum && bnum) {
|
|
188
|
+
a = +a;
|
|
189
|
+
b = +b;
|
|
190
|
+
}
|
|
191
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
192
|
+
};
|
|
193
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
194
|
+
module.exports = {
|
|
195
|
+
compareIdentifiers,
|
|
196
|
+
rcompareIdentifiers
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js
|
|
202
|
+
var require_semver = __commonJS({
|
|
203
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js"(exports, module) {
|
|
204
|
+
"use strict";
|
|
205
|
+
var debug = require_debug();
|
|
206
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
207
|
+
var { safeRe: re, t } = require_re();
|
|
208
|
+
var parseOptions = require_parse_options();
|
|
209
|
+
var { compareIdentifiers } = require_identifiers();
|
|
210
|
+
var SemVer = class _SemVer {
|
|
211
|
+
constructor(version, options) {
|
|
212
|
+
options = parseOptions(options);
|
|
213
|
+
if (version instanceof _SemVer) {
|
|
214
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
215
|
+
return version;
|
|
216
|
+
} else {
|
|
217
|
+
version = version.version;
|
|
218
|
+
}
|
|
219
|
+
} else if (typeof version !== "string") {
|
|
220
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
221
|
+
}
|
|
222
|
+
if (version.length > MAX_LENGTH) {
|
|
223
|
+
throw new TypeError(
|
|
224
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
debug("SemVer", version, options);
|
|
228
|
+
this.options = options;
|
|
229
|
+
this.loose = !!options.loose;
|
|
230
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
231
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
232
|
+
if (!m) {
|
|
233
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
234
|
+
}
|
|
235
|
+
this.raw = version;
|
|
236
|
+
this.major = +m[1];
|
|
237
|
+
this.minor = +m[2];
|
|
238
|
+
this.patch = +m[3];
|
|
239
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
240
|
+
throw new TypeError("Invalid major version");
|
|
241
|
+
}
|
|
242
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
243
|
+
throw new TypeError("Invalid minor version");
|
|
244
|
+
}
|
|
245
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
246
|
+
throw new TypeError("Invalid patch version");
|
|
247
|
+
}
|
|
248
|
+
if (!m[4]) {
|
|
249
|
+
this.prerelease = [];
|
|
250
|
+
} else {
|
|
251
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
252
|
+
if (/^[0-9]+$/.test(id)) {
|
|
253
|
+
const num = +id;
|
|
254
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
255
|
+
return num;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return id;
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
262
|
+
this.format();
|
|
263
|
+
}
|
|
264
|
+
format() {
|
|
265
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
266
|
+
if (this.prerelease.length) {
|
|
267
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
268
|
+
}
|
|
269
|
+
return this.version;
|
|
270
|
+
}
|
|
271
|
+
toString() {
|
|
272
|
+
return this.version;
|
|
273
|
+
}
|
|
274
|
+
compare(other) {
|
|
275
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
276
|
+
if (!(other instanceof _SemVer)) {
|
|
277
|
+
if (typeof other === "string" && other === this.version) {
|
|
278
|
+
return 0;
|
|
279
|
+
}
|
|
280
|
+
other = new _SemVer(other, this.options);
|
|
281
|
+
}
|
|
282
|
+
if (other.version === this.version) {
|
|
283
|
+
return 0;
|
|
284
|
+
}
|
|
285
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
286
|
+
}
|
|
287
|
+
compareMain(other) {
|
|
288
|
+
if (!(other instanceof _SemVer)) {
|
|
289
|
+
other = new _SemVer(other, this.options);
|
|
290
|
+
}
|
|
291
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
292
|
+
}
|
|
293
|
+
comparePre(other) {
|
|
294
|
+
if (!(other instanceof _SemVer)) {
|
|
295
|
+
other = new _SemVer(other, this.options);
|
|
296
|
+
}
|
|
297
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
298
|
+
return -1;
|
|
299
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
300
|
+
return 1;
|
|
301
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
302
|
+
return 0;
|
|
303
|
+
}
|
|
304
|
+
let i = 0;
|
|
305
|
+
do {
|
|
306
|
+
const a = this.prerelease[i];
|
|
307
|
+
const b = other.prerelease[i];
|
|
308
|
+
debug("prerelease compare", i, a, b);
|
|
309
|
+
if (a === void 0 && b === void 0) {
|
|
310
|
+
return 0;
|
|
311
|
+
} else if (b === void 0) {
|
|
312
|
+
return 1;
|
|
313
|
+
} else if (a === void 0) {
|
|
314
|
+
return -1;
|
|
315
|
+
} else if (a === b) {
|
|
316
|
+
continue;
|
|
317
|
+
} else {
|
|
318
|
+
return compareIdentifiers(a, b);
|
|
319
|
+
}
|
|
320
|
+
} while (++i);
|
|
321
|
+
}
|
|
322
|
+
compareBuild(other) {
|
|
323
|
+
if (!(other instanceof _SemVer)) {
|
|
324
|
+
other = new _SemVer(other, this.options);
|
|
325
|
+
}
|
|
326
|
+
let i = 0;
|
|
327
|
+
do {
|
|
328
|
+
const a = this.build[i];
|
|
329
|
+
const b = other.build[i];
|
|
330
|
+
debug("build compare", i, a, b);
|
|
331
|
+
if (a === void 0 && b === void 0) {
|
|
332
|
+
return 0;
|
|
333
|
+
} else if (b === void 0) {
|
|
334
|
+
return 1;
|
|
335
|
+
} else if (a === void 0) {
|
|
336
|
+
return -1;
|
|
337
|
+
} else if (a === b) {
|
|
338
|
+
continue;
|
|
339
|
+
} else {
|
|
340
|
+
return compareIdentifiers(a, b);
|
|
341
|
+
}
|
|
342
|
+
} while (++i);
|
|
343
|
+
}
|
|
344
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
345
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
346
|
+
inc(release, identifier, identifierBase) {
|
|
347
|
+
switch (release) {
|
|
348
|
+
case "premajor":
|
|
349
|
+
this.prerelease.length = 0;
|
|
350
|
+
this.patch = 0;
|
|
351
|
+
this.minor = 0;
|
|
352
|
+
this.major++;
|
|
353
|
+
this.inc("pre", identifier, identifierBase);
|
|
354
|
+
break;
|
|
355
|
+
case "preminor":
|
|
356
|
+
this.prerelease.length = 0;
|
|
357
|
+
this.patch = 0;
|
|
358
|
+
this.minor++;
|
|
359
|
+
this.inc("pre", identifier, identifierBase);
|
|
360
|
+
break;
|
|
361
|
+
case "prepatch":
|
|
362
|
+
this.prerelease.length = 0;
|
|
363
|
+
this.inc("patch", identifier, identifierBase);
|
|
364
|
+
this.inc("pre", identifier, identifierBase);
|
|
365
|
+
break;
|
|
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 "major":
|
|
373
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
374
|
+
this.major++;
|
|
375
|
+
}
|
|
376
|
+
this.minor = 0;
|
|
377
|
+
this.patch = 0;
|
|
378
|
+
this.prerelease = [];
|
|
379
|
+
break;
|
|
380
|
+
case "minor":
|
|
381
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
382
|
+
this.minor++;
|
|
383
|
+
}
|
|
384
|
+
this.patch = 0;
|
|
385
|
+
this.prerelease = [];
|
|
386
|
+
break;
|
|
387
|
+
case "patch":
|
|
388
|
+
if (this.prerelease.length === 0) {
|
|
389
|
+
this.patch++;
|
|
390
|
+
}
|
|
391
|
+
this.prerelease = [];
|
|
392
|
+
break;
|
|
393
|
+
case "pre": {
|
|
394
|
+
const base3 = Number(identifierBase) ? 1 : 0;
|
|
395
|
+
if (!identifier && identifierBase === false) {
|
|
396
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
397
|
+
}
|
|
398
|
+
if (this.prerelease.length === 0) {
|
|
399
|
+
this.prerelease = [base3];
|
|
400
|
+
} else {
|
|
401
|
+
let i = this.prerelease.length;
|
|
402
|
+
while (--i >= 0) {
|
|
403
|
+
if (typeof this.prerelease[i] === "number") {
|
|
404
|
+
this.prerelease[i]++;
|
|
405
|
+
i = -2;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
if (i === -1) {
|
|
409
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
410
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
411
|
+
}
|
|
412
|
+
this.prerelease.push(base3);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (identifier) {
|
|
416
|
+
let prerelease = [identifier, base3];
|
|
417
|
+
if (identifierBase === false) {
|
|
418
|
+
prerelease = [identifier];
|
|
419
|
+
}
|
|
420
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
421
|
+
if (isNaN(this.prerelease[1])) {
|
|
422
|
+
this.prerelease = prerelease;
|
|
423
|
+
}
|
|
424
|
+
} else {
|
|
425
|
+
this.prerelease = prerelease;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
break;
|
|
429
|
+
}
|
|
430
|
+
default:
|
|
431
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
432
|
+
}
|
|
433
|
+
this.raw = this.format();
|
|
434
|
+
if (this.build.length) {
|
|
435
|
+
this.raw += `+${this.build.join(".")}`;
|
|
436
|
+
}
|
|
437
|
+
return this;
|
|
438
|
+
}
|
|
439
|
+
};
|
|
440
|
+
module.exports = SemVer;
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js
|
|
445
|
+
var require_parse = __commonJS({
|
|
446
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js"(exports, module) {
|
|
447
|
+
"use strict";
|
|
448
|
+
var SemVer = require_semver();
|
|
449
|
+
var parse = (version, options, throwErrors = false) => {
|
|
450
|
+
if (version instanceof SemVer) {
|
|
451
|
+
return version;
|
|
452
|
+
}
|
|
453
|
+
try {
|
|
454
|
+
return new SemVer(version, options);
|
|
455
|
+
} catch (er) {
|
|
456
|
+
if (!throwErrors) {
|
|
457
|
+
return null;
|
|
458
|
+
}
|
|
459
|
+
throw er;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
module.exports = parse;
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/valid.js
|
|
467
|
+
var require_valid = __commonJS({
|
|
468
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/valid.js"(exports, module) {
|
|
469
|
+
"use strict";
|
|
470
|
+
var parse = require_parse();
|
|
471
|
+
var valid = (version, options) => {
|
|
472
|
+
const v = parse(version, options);
|
|
473
|
+
return v ? v.version : null;
|
|
474
|
+
};
|
|
475
|
+
module.exports = valid;
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/clean.js
|
|
480
|
+
var require_clean = __commonJS({
|
|
481
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/clean.js"(exports, module) {
|
|
482
|
+
"use strict";
|
|
483
|
+
var parse = require_parse();
|
|
484
|
+
var clean = (version, options) => {
|
|
485
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
486
|
+
return s ? s.version : null;
|
|
487
|
+
};
|
|
488
|
+
module.exports = clean;
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/inc.js
|
|
493
|
+
var require_inc = __commonJS({
|
|
494
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/inc.js"(exports, module) {
|
|
495
|
+
"use strict";
|
|
496
|
+
var SemVer = require_semver();
|
|
497
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
498
|
+
if (typeof options === "string") {
|
|
499
|
+
identifierBase = identifier;
|
|
500
|
+
identifier = options;
|
|
501
|
+
options = void 0;
|
|
502
|
+
}
|
|
503
|
+
try {
|
|
504
|
+
return new SemVer(
|
|
505
|
+
version instanceof SemVer ? version.version : version,
|
|
506
|
+
options
|
|
507
|
+
).inc(release, identifier, identifierBase).version;
|
|
508
|
+
} catch (er) {
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
module.exports = inc;
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/diff.js
|
|
517
|
+
var require_diff = __commonJS({
|
|
518
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/diff.js"(exports, module) {
|
|
519
|
+
"use strict";
|
|
520
|
+
var parse = require_parse();
|
|
521
|
+
var diff = (version1, version2) => {
|
|
522
|
+
const v1 = parse(version1, null, true);
|
|
523
|
+
const v2 = parse(version2, null, true);
|
|
524
|
+
const comparison = v1.compare(v2);
|
|
525
|
+
if (comparison === 0) {
|
|
526
|
+
return null;
|
|
527
|
+
}
|
|
528
|
+
const v1Higher = comparison > 0;
|
|
529
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
530
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
531
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
532
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
533
|
+
if (lowHasPre && !highHasPre) {
|
|
534
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
535
|
+
return "major";
|
|
536
|
+
}
|
|
537
|
+
if (highVersion.patch) {
|
|
538
|
+
return "patch";
|
|
539
|
+
}
|
|
540
|
+
if (highVersion.minor) {
|
|
541
|
+
return "minor";
|
|
542
|
+
}
|
|
543
|
+
return "major";
|
|
544
|
+
}
|
|
545
|
+
const prefix = highHasPre ? "pre" : "";
|
|
546
|
+
if (v1.major !== v2.major) {
|
|
547
|
+
return prefix + "major";
|
|
548
|
+
}
|
|
549
|
+
if (v1.minor !== v2.minor) {
|
|
550
|
+
return prefix + "minor";
|
|
551
|
+
}
|
|
552
|
+
if (v1.patch !== v2.patch) {
|
|
553
|
+
return prefix + "patch";
|
|
554
|
+
}
|
|
555
|
+
return "prerelease";
|
|
556
|
+
};
|
|
557
|
+
module.exports = diff;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/major.js
|
|
562
|
+
var require_major = __commonJS({
|
|
563
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/major.js"(exports, module) {
|
|
564
|
+
"use strict";
|
|
565
|
+
var SemVer = require_semver();
|
|
566
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
567
|
+
module.exports = major;
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/minor.js
|
|
572
|
+
var require_minor = __commonJS({
|
|
573
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/minor.js"(exports, module) {
|
|
574
|
+
"use strict";
|
|
575
|
+
var SemVer = require_semver();
|
|
576
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
577
|
+
module.exports = minor;
|
|
578
|
+
}
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/patch.js
|
|
582
|
+
var require_patch = __commonJS({
|
|
583
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/patch.js"(exports, module) {
|
|
584
|
+
"use strict";
|
|
585
|
+
var SemVer = require_semver();
|
|
586
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
587
|
+
module.exports = patch;
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/prerelease.js
|
|
592
|
+
var require_prerelease = __commonJS({
|
|
593
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
594
|
+
"use strict";
|
|
595
|
+
var parse = require_parse();
|
|
596
|
+
var prerelease = (version, options) => {
|
|
597
|
+
const parsed = parse(version, options);
|
|
598
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
599
|
+
};
|
|
600
|
+
module.exports = prerelease;
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare.js
|
|
605
|
+
var require_compare = __commonJS({
|
|
606
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare.js"(exports, module) {
|
|
607
|
+
"use strict";
|
|
608
|
+
var SemVer = require_semver();
|
|
609
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
610
|
+
module.exports = compare;
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rcompare.js
|
|
615
|
+
var require_rcompare = __commonJS({
|
|
616
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
617
|
+
"use strict";
|
|
618
|
+
var compare = require_compare();
|
|
619
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
620
|
+
module.exports = rcompare;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-loose.js
|
|
625
|
+
var require_compare_loose = __commonJS({
|
|
626
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
627
|
+
"use strict";
|
|
628
|
+
var compare = require_compare();
|
|
629
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
630
|
+
module.exports = compareLoose;
|
|
631
|
+
}
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-build.js
|
|
635
|
+
var require_compare_build = __commonJS({
|
|
636
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
637
|
+
"use strict";
|
|
638
|
+
var SemVer = require_semver();
|
|
639
|
+
var compareBuild = (a, b, loose) => {
|
|
640
|
+
const versionA = new SemVer(a, loose);
|
|
641
|
+
const versionB = new SemVer(b, loose);
|
|
642
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
643
|
+
};
|
|
644
|
+
module.exports = compareBuild;
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/sort.js
|
|
649
|
+
var require_sort = __commonJS({
|
|
650
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/sort.js"(exports, module) {
|
|
651
|
+
"use strict";
|
|
652
|
+
var compareBuild = require_compare_build();
|
|
653
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
654
|
+
module.exports = sort;
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rsort.js
|
|
659
|
+
var require_rsort = __commonJS({
|
|
660
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
661
|
+
"use strict";
|
|
662
|
+
var compareBuild = require_compare_build();
|
|
663
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
664
|
+
module.exports = rsort;
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gt.js
|
|
669
|
+
var require_gt = __commonJS({
|
|
670
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gt.js"(exports, module) {
|
|
671
|
+
"use strict";
|
|
672
|
+
var compare = require_compare();
|
|
673
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
674
|
+
module.exports = gt;
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lt.js
|
|
679
|
+
var require_lt = __commonJS({
|
|
680
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lt.js"(exports, module) {
|
|
681
|
+
"use strict";
|
|
682
|
+
var compare = require_compare();
|
|
683
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
684
|
+
module.exports = lt;
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/eq.js
|
|
689
|
+
var require_eq = __commonJS({
|
|
690
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/eq.js"(exports, module) {
|
|
691
|
+
"use strict";
|
|
692
|
+
var compare = require_compare();
|
|
693
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
694
|
+
module.exports = eq;
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/neq.js
|
|
699
|
+
var require_neq = __commonJS({
|
|
700
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/neq.js"(exports, module) {
|
|
701
|
+
"use strict";
|
|
702
|
+
var compare = require_compare();
|
|
703
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
704
|
+
module.exports = neq;
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gte.js
|
|
709
|
+
var require_gte = __commonJS({
|
|
710
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gte.js"(exports, module) {
|
|
711
|
+
"use strict";
|
|
712
|
+
var compare = require_compare();
|
|
713
|
+
var gte4 = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
714
|
+
module.exports = gte4;
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lte.js
|
|
719
|
+
var require_lte = __commonJS({
|
|
720
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lte.js"(exports, module) {
|
|
721
|
+
"use strict";
|
|
722
|
+
var compare = require_compare();
|
|
723
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
724
|
+
module.exports = lte;
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
|
|
728
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/cmp.js
|
|
729
|
+
var require_cmp = __commonJS({
|
|
730
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
731
|
+
"use strict";
|
|
732
|
+
var eq = require_eq();
|
|
733
|
+
var neq = require_neq();
|
|
734
|
+
var gt = require_gt();
|
|
735
|
+
var gte4 = require_gte();
|
|
736
|
+
var lt = require_lt();
|
|
737
|
+
var lte = require_lte();
|
|
738
|
+
var cmp = (a, op, b, loose) => {
|
|
739
|
+
switch (op) {
|
|
740
|
+
case "===":
|
|
741
|
+
if (typeof a === "object") {
|
|
742
|
+
a = a.version;
|
|
743
|
+
}
|
|
744
|
+
if (typeof b === "object") {
|
|
745
|
+
b = b.version;
|
|
746
|
+
}
|
|
747
|
+
return a === b;
|
|
748
|
+
case "!==":
|
|
749
|
+
if (typeof a === "object") {
|
|
750
|
+
a = a.version;
|
|
751
|
+
}
|
|
752
|
+
if (typeof b === "object") {
|
|
753
|
+
b = b.version;
|
|
754
|
+
}
|
|
755
|
+
return a !== b;
|
|
756
|
+
case "":
|
|
757
|
+
case "=":
|
|
758
|
+
case "==":
|
|
759
|
+
return eq(a, b, loose);
|
|
760
|
+
case "!=":
|
|
761
|
+
return neq(a, b, loose);
|
|
762
|
+
case ">":
|
|
763
|
+
return gt(a, b, loose);
|
|
764
|
+
case ">=":
|
|
765
|
+
return gte4(a, b, loose);
|
|
766
|
+
case "<":
|
|
767
|
+
return lt(a, b, loose);
|
|
768
|
+
case "<=":
|
|
769
|
+
return lte(a, b, loose);
|
|
770
|
+
default:
|
|
771
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
module.exports = cmp;
|
|
775
|
+
}
|
|
776
|
+
});
|
|
777
|
+
|
|
778
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/coerce.js
|
|
779
|
+
var require_coerce = __commonJS({
|
|
780
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
781
|
+
"use strict";
|
|
782
|
+
var SemVer = require_semver();
|
|
783
|
+
var parse = require_parse();
|
|
784
|
+
var { safeRe: re, t } = require_re();
|
|
785
|
+
var coerce5 = (version, options) => {
|
|
786
|
+
if (version instanceof SemVer) {
|
|
787
|
+
return version;
|
|
788
|
+
}
|
|
789
|
+
if (typeof version === "number") {
|
|
790
|
+
version = String(version);
|
|
791
|
+
}
|
|
792
|
+
if (typeof version !== "string") {
|
|
793
|
+
return null;
|
|
794
|
+
}
|
|
795
|
+
options = options || {};
|
|
796
|
+
let match = null;
|
|
797
|
+
if (!options.rtl) {
|
|
798
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
799
|
+
} else {
|
|
800
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
801
|
+
let next;
|
|
802
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
803
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
804
|
+
match = next;
|
|
805
|
+
}
|
|
806
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
807
|
+
}
|
|
808
|
+
coerceRtlRegex.lastIndex = -1;
|
|
809
|
+
}
|
|
810
|
+
if (match === null) {
|
|
811
|
+
return null;
|
|
812
|
+
}
|
|
813
|
+
const major = match[2];
|
|
814
|
+
const minor = match[3] || "0";
|
|
815
|
+
const patch = match[4] || "0";
|
|
816
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
817
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
818
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
819
|
+
};
|
|
820
|
+
module.exports = coerce5;
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
|
|
824
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/lrucache.js
|
|
825
|
+
var require_lrucache = __commonJS({
|
|
826
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
827
|
+
"use strict";
|
|
828
|
+
var LRUCache = class {
|
|
829
|
+
constructor() {
|
|
830
|
+
this.max = 1e3;
|
|
831
|
+
this.map = /* @__PURE__ */ new Map();
|
|
832
|
+
}
|
|
833
|
+
get(key) {
|
|
834
|
+
const value = this.map.get(key);
|
|
835
|
+
if (value === void 0) {
|
|
836
|
+
return void 0;
|
|
837
|
+
} else {
|
|
838
|
+
this.map.delete(key);
|
|
839
|
+
this.map.set(key, value);
|
|
840
|
+
return value;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
delete(key) {
|
|
844
|
+
return this.map.delete(key);
|
|
845
|
+
}
|
|
846
|
+
set(key, value) {
|
|
847
|
+
const deleted = this.delete(key);
|
|
848
|
+
if (!deleted && value !== void 0) {
|
|
849
|
+
if (this.map.size >= this.max) {
|
|
850
|
+
const firstKey = this.map.keys().next().value;
|
|
851
|
+
this.delete(firstKey);
|
|
852
|
+
}
|
|
853
|
+
this.map.set(key, value);
|
|
854
|
+
}
|
|
855
|
+
return this;
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
module.exports = LRUCache;
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/range.js
|
|
863
|
+
var require_range = __commonJS({
|
|
864
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/range.js"(exports, module) {
|
|
865
|
+
"use strict";
|
|
866
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
867
|
+
var Range = class _Range {
|
|
868
|
+
constructor(range, options) {
|
|
869
|
+
options = parseOptions(options);
|
|
870
|
+
if (range instanceof _Range) {
|
|
871
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
872
|
+
return range;
|
|
873
|
+
} else {
|
|
874
|
+
return new _Range(range.raw, options);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
if (range instanceof Comparator) {
|
|
878
|
+
this.raw = range.value;
|
|
879
|
+
this.set = [[range]];
|
|
880
|
+
this.formatted = void 0;
|
|
881
|
+
return this;
|
|
882
|
+
}
|
|
883
|
+
this.options = options;
|
|
884
|
+
this.loose = !!options.loose;
|
|
885
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
886
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
887
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
888
|
+
if (!this.set.length) {
|
|
889
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
890
|
+
}
|
|
891
|
+
if (this.set.length > 1) {
|
|
892
|
+
const first = this.set[0];
|
|
893
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
894
|
+
if (this.set.length === 0) {
|
|
895
|
+
this.set = [first];
|
|
896
|
+
} else if (this.set.length > 1) {
|
|
897
|
+
for (const c of this.set) {
|
|
898
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
899
|
+
this.set = [c];
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
this.formatted = void 0;
|
|
906
|
+
}
|
|
907
|
+
get range() {
|
|
908
|
+
if (this.formatted === void 0) {
|
|
909
|
+
this.formatted = "";
|
|
910
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
911
|
+
if (i > 0) {
|
|
912
|
+
this.formatted += "||";
|
|
913
|
+
}
|
|
914
|
+
const comps = this.set[i];
|
|
915
|
+
for (let k = 0; k < comps.length; k++) {
|
|
916
|
+
if (k > 0) {
|
|
917
|
+
this.formatted += " ";
|
|
918
|
+
}
|
|
919
|
+
this.formatted += comps[k].toString().trim();
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return this.formatted;
|
|
924
|
+
}
|
|
925
|
+
format() {
|
|
926
|
+
return this.range;
|
|
927
|
+
}
|
|
928
|
+
toString() {
|
|
929
|
+
return this.range;
|
|
930
|
+
}
|
|
931
|
+
parseRange(range) {
|
|
932
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
933
|
+
const memoKey = memoOpts + ":" + range;
|
|
934
|
+
const cached = cache2.get(memoKey);
|
|
935
|
+
if (cached) {
|
|
936
|
+
return cached;
|
|
937
|
+
}
|
|
938
|
+
const loose = this.options.loose;
|
|
939
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
940
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
941
|
+
debug("hyphen replace", range);
|
|
942
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
943
|
+
debug("comparator trim", range);
|
|
944
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
945
|
+
debug("tilde trim", range);
|
|
946
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
947
|
+
debug("caret trim", range);
|
|
948
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
949
|
+
if (loose) {
|
|
950
|
+
rangeList = rangeList.filter((comp) => {
|
|
951
|
+
debug("loose invalid filter", comp, this.options);
|
|
952
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
debug("range list", rangeList);
|
|
956
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
957
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
958
|
+
for (const comp of comparators) {
|
|
959
|
+
if (isNullSet(comp)) {
|
|
960
|
+
return [comp];
|
|
961
|
+
}
|
|
962
|
+
rangeMap.set(comp.value, comp);
|
|
963
|
+
}
|
|
964
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
965
|
+
rangeMap.delete("");
|
|
966
|
+
}
|
|
967
|
+
const result = [...rangeMap.values()];
|
|
968
|
+
cache2.set(memoKey, result);
|
|
969
|
+
return result;
|
|
970
|
+
}
|
|
971
|
+
intersects(range, options) {
|
|
972
|
+
if (!(range instanceof _Range)) {
|
|
973
|
+
throw new TypeError("a Range is required");
|
|
974
|
+
}
|
|
975
|
+
return this.set.some((thisComparators) => {
|
|
976
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
977
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
978
|
+
return rangeComparators.every((rangeComparator) => {
|
|
979
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
980
|
+
});
|
|
981
|
+
});
|
|
982
|
+
});
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
986
|
+
test(version) {
|
|
987
|
+
if (!version) {
|
|
988
|
+
return false;
|
|
989
|
+
}
|
|
990
|
+
if (typeof version === "string") {
|
|
991
|
+
try {
|
|
992
|
+
version = new SemVer(version, this.options);
|
|
993
|
+
} catch (er) {
|
|
994
|
+
return false;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
998
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
999
|
+
return true;
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return false;
|
|
1003
|
+
}
|
|
1004
|
+
};
|
|
1005
|
+
module.exports = Range;
|
|
1006
|
+
var LRU = require_lrucache();
|
|
1007
|
+
var cache2 = new LRU();
|
|
1008
|
+
var parseOptions = require_parse_options();
|
|
1009
|
+
var Comparator = require_comparator();
|
|
1010
|
+
var debug = require_debug();
|
|
1011
|
+
var SemVer = require_semver();
|
|
1012
|
+
var {
|
|
1013
|
+
safeRe: re,
|
|
1014
|
+
t,
|
|
1015
|
+
comparatorTrimReplace,
|
|
1016
|
+
tildeTrimReplace,
|
|
1017
|
+
caretTrimReplace
|
|
1018
|
+
} = require_re();
|
|
1019
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1020
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1021
|
+
var isAny = (c) => c.value === "";
|
|
1022
|
+
var isSatisfiable = (comparators, options) => {
|
|
1023
|
+
let result = true;
|
|
1024
|
+
const remainingComparators = comparators.slice();
|
|
1025
|
+
let testComparator = remainingComparators.pop();
|
|
1026
|
+
while (result && remainingComparators.length) {
|
|
1027
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1028
|
+
return testComparator.intersects(otherComparator, options);
|
|
1029
|
+
});
|
|
1030
|
+
testComparator = remainingComparators.pop();
|
|
1031
|
+
}
|
|
1032
|
+
return result;
|
|
1033
|
+
};
|
|
1034
|
+
var parseComparator = (comp, options) => {
|
|
1035
|
+
debug("comp", comp, options);
|
|
1036
|
+
comp = replaceCarets(comp, options);
|
|
1037
|
+
debug("caret", comp);
|
|
1038
|
+
comp = replaceTildes(comp, options);
|
|
1039
|
+
debug("tildes", comp);
|
|
1040
|
+
comp = replaceXRanges(comp, options);
|
|
1041
|
+
debug("xrange", comp);
|
|
1042
|
+
comp = replaceStars(comp, options);
|
|
1043
|
+
debug("stars", comp);
|
|
1044
|
+
return comp;
|
|
1045
|
+
};
|
|
1046
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1047
|
+
var replaceTildes = (comp, options) => {
|
|
1048
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1049
|
+
};
|
|
1050
|
+
var replaceTilde = (comp, options) => {
|
|
1051
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1052
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1053
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1054
|
+
let ret;
|
|
1055
|
+
if (isX(M)) {
|
|
1056
|
+
ret = "";
|
|
1057
|
+
} else if (isX(m)) {
|
|
1058
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1059
|
+
} else if (isX(p)) {
|
|
1060
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1061
|
+
} else if (pr) {
|
|
1062
|
+
debug("replaceTilde pr", pr);
|
|
1063
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1064
|
+
} else {
|
|
1065
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1066
|
+
}
|
|
1067
|
+
debug("tilde return", ret);
|
|
1068
|
+
return ret;
|
|
1069
|
+
});
|
|
1070
|
+
};
|
|
1071
|
+
var replaceCarets = (comp, options) => {
|
|
1072
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1073
|
+
};
|
|
1074
|
+
var replaceCaret = (comp, options) => {
|
|
1075
|
+
debug("caret", comp, options);
|
|
1076
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1077
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1078
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1079
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1080
|
+
let ret;
|
|
1081
|
+
if (isX(M)) {
|
|
1082
|
+
ret = "";
|
|
1083
|
+
} else if (isX(m)) {
|
|
1084
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1085
|
+
} else if (isX(p)) {
|
|
1086
|
+
if (M === "0") {
|
|
1087
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1088
|
+
} else {
|
|
1089
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1090
|
+
}
|
|
1091
|
+
} else if (pr) {
|
|
1092
|
+
debug("replaceCaret pr", pr);
|
|
1093
|
+
if (M === "0") {
|
|
1094
|
+
if (m === "0") {
|
|
1095
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1096
|
+
} else {
|
|
1097
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1098
|
+
}
|
|
1099
|
+
} else {
|
|
1100
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1101
|
+
}
|
|
1102
|
+
} else {
|
|
1103
|
+
debug("no pr");
|
|
1104
|
+
if (M === "0") {
|
|
1105
|
+
if (m === "0") {
|
|
1106
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1107
|
+
} else {
|
|
1108
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1109
|
+
}
|
|
1110
|
+
} else {
|
|
1111
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
debug("caret return", ret);
|
|
1115
|
+
return ret;
|
|
1116
|
+
});
|
|
1117
|
+
};
|
|
1118
|
+
var replaceXRanges = (comp, options) => {
|
|
1119
|
+
debug("replaceXRanges", comp, options);
|
|
1120
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1121
|
+
};
|
|
1122
|
+
var replaceXRange = (comp, options) => {
|
|
1123
|
+
comp = comp.trim();
|
|
1124
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1125
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1126
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1127
|
+
const xM = isX(M);
|
|
1128
|
+
const xm = xM || isX(m);
|
|
1129
|
+
const xp = xm || isX(p);
|
|
1130
|
+
const anyX = xp;
|
|
1131
|
+
if (gtlt === "=" && anyX) {
|
|
1132
|
+
gtlt = "";
|
|
1133
|
+
}
|
|
1134
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1135
|
+
if (xM) {
|
|
1136
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1137
|
+
ret = "<0.0.0-0";
|
|
1138
|
+
} else {
|
|
1139
|
+
ret = "*";
|
|
1140
|
+
}
|
|
1141
|
+
} else if (gtlt && anyX) {
|
|
1142
|
+
if (xm) {
|
|
1143
|
+
m = 0;
|
|
1144
|
+
}
|
|
1145
|
+
p = 0;
|
|
1146
|
+
if (gtlt === ">") {
|
|
1147
|
+
gtlt = ">=";
|
|
1148
|
+
if (xm) {
|
|
1149
|
+
M = +M + 1;
|
|
1150
|
+
m = 0;
|
|
1151
|
+
p = 0;
|
|
1152
|
+
} else {
|
|
1153
|
+
m = +m + 1;
|
|
1154
|
+
p = 0;
|
|
1155
|
+
}
|
|
1156
|
+
} else if (gtlt === "<=") {
|
|
1157
|
+
gtlt = "<";
|
|
1158
|
+
if (xm) {
|
|
1159
|
+
M = +M + 1;
|
|
1160
|
+
} else {
|
|
1161
|
+
m = +m + 1;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
if (gtlt === "<") {
|
|
1165
|
+
pr = "-0";
|
|
1166
|
+
}
|
|
1167
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1168
|
+
} else if (xm) {
|
|
1169
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1170
|
+
} else if (xp) {
|
|
1171
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1172
|
+
}
|
|
1173
|
+
debug("xRange return", ret);
|
|
1174
|
+
return ret;
|
|
1175
|
+
});
|
|
1176
|
+
};
|
|
1177
|
+
var replaceStars = (comp, options) => {
|
|
1178
|
+
debug("replaceStars", comp, options);
|
|
1179
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1180
|
+
};
|
|
1181
|
+
var replaceGTE0 = (comp, options) => {
|
|
1182
|
+
debug("replaceGTE0", comp, options);
|
|
1183
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1184
|
+
};
|
|
1185
|
+
var hyphenReplace = (incPr) => ($0, from2, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1186
|
+
if (isX(fM)) {
|
|
1187
|
+
from2 = "";
|
|
1188
|
+
} else if (isX(fm)) {
|
|
1189
|
+
from2 = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1190
|
+
} else if (isX(fp)) {
|
|
1191
|
+
from2 = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1192
|
+
} else if (fpr) {
|
|
1193
|
+
from2 = `>=${from2}`;
|
|
1194
|
+
} else {
|
|
1195
|
+
from2 = `>=${from2}${incPr ? "-0" : ""}`;
|
|
1196
|
+
}
|
|
1197
|
+
if (isX(tM)) {
|
|
1198
|
+
to = "";
|
|
1199
|
+
} else if (isX(tm)) {
|
|
1200
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1201
|
+
} else if (isX(tp)) {
|
|
1202
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1203
|
+
} else if (tpr) {
|
|
1204
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1205
|
+
} else if (incPr) {
|
|
1206
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1207
|
+
} else {
|
|
1208
|
+
to = `<=${to}`;
|
|
1209
|
+
}
|
|
1210
|
+
return `${from2} ${to}`.trim();
|
|
1211
|
+
};
|
|
1212
|
+
var testSet = (set, version, options) => {
|
|
1213
|
+
for (let i = 0; i < set.length; i++) {
|
|
1214
|
+
if (!set[i].test(version)) {
|
|
1215
|
+
return false;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1219
|
+
for (let i = 0; i < set.length; i++) {
|
|
1220
|
+
debug(set[i].semver);
|
|
1221
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1222
|
+
continue;
|
|
1223
|
+
}
|
|
1224
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1225
|
+
const allowed = set[i].semver;
|
|
1226
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1227
|
+
return true;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
return false;
|
|
1232
|
+
}
|
|
1233
|
+
return true;
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
});
|
|
1237
|
+
|
|
1238
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/comparator.js
|
|
1239
|
+
var require_comparator = __commonJS({
|
|
1240
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1241
|
+
"use strict";
|
|
1242
|
+
var ANY = Symbol("SemVer ANY");
|
|
1243
|
+
var Comparator = class _Comparator {
|
|
1244
|
+
static get ANY() {
|
|
1245
|
+
return ANY;
|
|
1246
|
+
}
|
|
1247
|
+
constructor(comp, options) {
|
|
1248
|
+
options = parseOptions(options);
|
|
1249
|
+
if (comp instanceof _Comparator) {
|
|
1250
|
+
if (comp.loose === !!options.loose) {
|
|
1251
|
+
return comp;
|
|
1252
|
+
} else {
|
|
1253
|
+
comp = comp.value;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1257
|
+
debug("comparator", comp, options);
|
|
1258
|
+
this.options = options;
|
|
1259
|
+
this.loose = !!options.loose;
|
|
1260
|
+
this.parse(comp);
|
|
1261
|
+
if (this.semver === ANY) {
|
|
1262
|
+
this.value = "";
|
|
1263
|
+
} else {
|
|
1264
|
+
this.value = this.operator + this.semver.version;
|
|
1265
|
+
}
|
|
1266
|
+
debug("comp", this);
|
|
1267
|
+
}
|
|
1268
|
+
parse(comp) {
|
|
1269
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1270
|
+
const m = comp.match(r);
|
|
1271
|
+
if (!m) {
|
|
1272
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1273
|
+
}
|
|
1274
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1275
|
+
if (this.operator === "=") {
|
|
1276
|
+
this.operator = "";
|
|
1277
|
+
}
|
|
1278
|
+
if (!m[2]) {
|
|
1279
|
+
this.semver = ANY;
|
|
1280
|
+
} else {
|
|
1281
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
toString() {
|
|
1285
|
+
return this.value;
|
|
1286
|
+
}
|
|
1287
|
+
test(version) {
|
|
1288
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1289
|
+
if (this.semver === ANY || version === ANY) {
|
|
1290
|
+
return true;
|
|
1291
|
+
}
|
|
1292
|
+
if (typeof version === "string") {
|
|
1293
|
+
try {
|
|
1294
|
+
version = new SemVer(version, this.options);
|
|
1295
|
+
} catch (er) {
|
|
1296
|
+
return false;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1300
|
+
}
|
|
1301
|
+
intersects(comp, options) {
|
|
1302
|
+
if (!(comp instanceof _Comparator)) {
|
|
1303
|
+
throw new TypeError("a Comparator is required");
|
|
1304
|
+
}
|
|
1305
|
+
if (this.operator === "") {
|
|
1306
|
+
if (this.value === "") {
|
|
1307
|
+
return true;
|
|
1308
|
+
}
|
|
1309
|
+
return new Range(comp.value, options).test(this.value);
|
|
1310
|
+
} else if (comp.operator === "") {
|
|
1311
|
+
if (comp.value === "") {
|
|
1312
|
+
return true;
|
|
1313
|
+
}
|
|
1314
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1315
|
+
}
|
|
1316
|
+
options = parseOptions(options);
|
|
1317
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1318
|
+
return false;
|
|
1319
|
+
}
|
|
1320
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1321
|
+
return false;
|
|
1322
|
+
}
|
|
1323
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1324
|
+
return true;
|
|
1325
|
+
}
|
|
1326
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1327
|
+
return true;
|
|
1328
|
+
}
|
|
1329
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1330
|
+
return true;
|
|
1331
|
+
}
|
|
1332
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1333
|
+
return true;
|
|
1334
|
+
}
|
|
1335
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1336
|
+
return true;
|
|
1337
|
+
}
|
|
1338
|
+
return false;
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
module.exports = Comparator;
|
|
1342
|
+
var parseOptions = require_parse_options();
|
|
1343
|
+
var { safeRe: re, t } = require_re();
|
|
1344
|
+
var cmp = require_cmp();
|
|
1345
|
+
var debug = require_debug();
|
|
1346
|
+
var SemVer = require_semver();
|
|
1347
|
+
var Range = require_range();
|
|
1348
|
+
}
|
|
1349
|
+
});
|
|
1350
|
+
|
|
1351
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/satisfies.js
|
|
1352
|
+
var require_satisfies = __commonJS({
|
|
1353
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1354
|
+
"use strict";
|
|
1355
|
+
var Range = require_range();
|
|
1356
|
+
var satisfies = (version, range, options) => {
|
|
1357
|
+
try {
|
|
1358
|
+
range = new Range(range, options);
|
|
1359
|
+
} catch (er) {
|
|
1360
|
+
return false;
|
|
1361
|
+
}
|
|
1362
|
+
return range.test(version);
|
|
1363
|
+
};
|
|
1364
|
+
module.exports = satisfies;
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
|
|
1368
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/to-comparators.js
|
|
1369
|
+
var require_to_comparators = __commonJS({
|
|
1370
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1371
|
+
"use strict";
|
|
1372
|
+
var Range = require_range();
|
|
1373
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1374
|
+
module.exports = toComparators;
|
|
1375
|
+
}
|
|
1376
|
+
});
|
|
1377
|
+
|
|
1378
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/max-satisfying.js
|
|
1379
|
+
var require_max_satisfying = __commonJS({
|
|
1380
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1381
|
+
"use strict";
|
|
1382
|
+
var SemVer = require_semver();
|
|
1383
|
+
var Range = require_range();
|
|
1384
|
+
var maxSatisfying = (versions, range, options) => {
|
|
1385
|
+
let max = null;
|
|
1386
|
+
let maxSV = null;
|
|
1387
|
+
let rangeObj = null;
|
|
1388
|
+
try {
|
|
1389
|
+
rangeObj = new Range(range, options);
|
|
1390
|
+
} catch (er) {
|
|
1391
|
+
return null;
|
|
1392
|
+
}
|
|
1393
|
+
versions.forEach((v) => {
|
|
1394
|
+
if (rangeObj.test(v)) {
|
|
1395
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1396
|
+
max = v;
|
|
1397
|
+
maxSV = new SemVer(max, options);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
});
|
|
1401
|
+
return max;
|
|
1402
|
+
};
|
|
1403
|
+
module.exports = maxSatisfying;
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
|
|
1407
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-satisfying.js
|
|
1408
|
+
var require_min_satisfying = __commonJS({
|
|
1409
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1410
|
+
"use strict";
|
|
1411
|
+
var SemVer = require_semver();
|
|
1412
|
+
var Range = require_range();
|
|
1413
|
+
var minSatisfying = (versions, range, options) => {
|
|
1414
|
+
let min = null;
|
|
1415
|
+
let minSV = null;
|
|
1416
|
+
let rangeObj = null;
|
|
1417
|
+
try {
|
|
1418
|
+
rangeObj = new Range(range, options);
|
|
1419
|
+
} catch (er) {
|
|
1420
|
+
return null;
|
|
1421
|
+
}
|
|
1422
|
+
versions.forEach((v) => {
|
|
1423
|
+
if (rangeObj.test(v)) {
|
|
1424
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1425
|
+
min = v;
|
|
1426
|
+
minSV = new SemVer(min, options);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
return min;
|
|
1431
|
+
};
|
|
1432
|
+
module.exports = minSatisfying;
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
|
|
1436
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-version.js
|
|
1437
|
+
var require_min_version = __commonJS({
|
|
1438
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1439
|
+
"use strict";
|
|
1440
|
+
var SemVer = require_semver();
|
|
1441
|
+
var Range = require_range();
|
|
1442
|
+
var gt = require_gt();
|
|
1443
|
+
var minVersion = (range, loose) => {
|
|
1444
|
+
range = new Range(range, loose);
|
|
1445
|
+
let minver = new SemVer("0.0.0");
|
|
1446
|
+
if (range.test(minver)) {
|
|
1447
|
+
return minver;
|
|
1448
|
+
}
|
|
1449
|
+
minver = new SemVer("0.0.0-0");
|
|
1450
|
+
if (range.test(minver)) {
|
|
1451
|
+
return minver;
|
|
1452
|
+
}
|
|
1453
|
+
minver = null;
|
|
1454
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1455
|
+
const comparators = range.set[i];
|
|
1456
|
+
let setMin = null;
|
|
1457
|
+
comparators.forEach((comparator) => {
|
|
1458
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1459
|
+
switch (comparator.operator) {
|
|
1460
|
+
case ">":
|
|
1461
|
+
if (compver.prerelease.length === 0) {
|
|
1462
|
+
compver.patch++;
|
|
1463
|
+
} else {
|
|
1464
|
+
compver.prerelease.push(0);
|
|
1465
|
+
}
|
|
1466
|
+
compver.raw = compver.format();
|
|
1467
|
+
case "":
|
|
1468
|
+
case ">=":
|
|
1469
|
+
if (!setMin || gt(compver, setMin)) {
|
|
1470
|
+
setMin = compver;
|
|
1471
|
+
}
|
|
1472
|
+
break;
|
|
1473
|
+
case "<":
|
|
1474
|
+
case "<=":
|
|
1475
|
+
break;
|
|
1476
|
+
default:
|
|
1477
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1481
|
+
minver = setMin;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
if (minver && range.test(minver)) {
|
|
1485
|
+
return minver;
|
|
1486
|
+
}
|
|
1487
|
+
return null;
|
|
1488
|
+
};
|
|
1489
|
+
module.exports = minVersion;
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
|
|
1493
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js
|
|
1494
|
+
var require_valid2 = __commonJS({
|
|
1495
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1496
|
+
"use strict";
|
|
1497
|
+
var Range = require_range();
|
|
1498
|
+
var validRange = (range, options) => {
|
|
1499
|
+
try {
|
|
1500
|
+
return new Range(range, options).range || "*";
|
|
1501
|
+
} catch (er) {
|
|
1502
|
+
return null;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
module.exports = validRange;
|
|
1506
|
+
}
|
|
1507
|
+
});
|
|
1508
|
+
|
|
1509
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/outside.js
|
|
1510
|
+
var require_outside = __commonJS({
|
|
1511
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1512
|
+
"use strict";
|
|
1513
|
+
var SemVer = require_semver();
|
|
1514
|
+
var Comparator = require_comparator();
|
|
1515
|
+
var { ANY } = Comparator;
|
|
1516
|
+
var Range = require_range();
|
|
1517
|
+
var satisfies = require_satisfies();
|
|
1518
|
+
var gt = require_gt();
|
|
1519
|
+
var lt = require_lt();
|
|
1520
|
+
var lte = require_lte();
|
|
1521
|
+
var gte4 = require_gte();
|
|
1522
|
+
var outside = (version, range, hilo, options) => {
|
|
1523
|
+
version = new SemVer(version, options);
|
|
1524
|
+
range = new Range(range, options);
|
|
1525
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1526
|
+
switch (hilo) {
|
|
1527
|
+
case ">":
|
|
1528
|
+
gtfn = gt;
|
|
1529
|
+
ltefn = lte;
|
|
1530
|
+
ltfn = lt;
|
|
1531
|
+
comp = ">";
|
|
1532
|
+
ecomp = ">=";
|
|
1533
|
+
break;
|
|
1534
|
+
case "<":
|
|
1535
|
+
gtfn = lt;
|
|
1536
|
+
ltefn = gte4;
|
|
1537
|
+
ltfn = gt;
|
|
1538
|
+
comp = "<";
|
|
1539
|
+
ecomp = "<=";
|
|
1540
|
+
break;
|
|
1541
|
+
default:
|
|
1542
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1543
|
+
}
|
|
1544
|
+
if (satisfies(version, range, options)) {
|
|
1545
|
+
return false;
|
|
1546
|
+
}
|
|
1547
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1548
|
+
const comparators = range.set[i];
|
|
1549
|
+
let high = null;
|
|
1550
|
+
let low = null;
|
|
1551
|
+
comparators.forEach((comparator) => {
|
|
1552
|
+
if (comparator.semver === ANY) {
|
|
1553
|
+
comparator = new Comparator(">=0.0.0");
|
|
1554
|
+
}
|
|
1555
|
+
high = high || comparator;
|
|
1556
|
+
low = low || comparator;
|
|
1557
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
1558
|
+
high = comparator;
|
|
1559
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1560
|
+
low = comparator;
|
|
1561
|
+
}
|
|
1562
|
+
});
|
|
1563
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
1564
|
+
return false;
|
|
1565
|
+
}
|
|
1566
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1567
|
+
return false;
|
|
1568
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1569
|
+
return false;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
return true;
|
|
1573
|
+
};
|
|
1574
|
+
module.exports = outside;
|
|
1575
|
+
}
|
|
1576
|
+
});
|
|
1577
|
+
|
|
1578
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/gtr.js
|
|
1579
|
+
var require_gtr = __commonJS({
|
|
1580
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
1581
|
+
"use strict";
|
|
1582
|
+
var outside = require_outside();
|
|
1583
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1584
|
+
module.exports = gtr;
|
|
1585
|
+
}
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/ltr.js
|
|
1589
|
+
var require_ltr = __commonJS({
|
|
1590
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
1591
|
+
"use strict";
|
|
1592
|
+
var outside = require_outside();
|
|
1593
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1594
|
+
module.exports = ltr;
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
|
|
1598
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/intersects.js
|
|
1599
|
+
var require_intersects = __commonJS({
|
|
1600
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
1601
|
+
"use strict";
|
|
1602
|
+
var Range = require_range();
|
|
1603
|
+
var intersects = (r1, r2, options) => {
|
|
1604
|
+
r1 = new Range(r1, options);
|
|
1605
|
+
r2 = new Range(r2, options);
|
|
1606
|
+
return r1.intersects(r2, options);
|
|
1607
|
+
};
|
|
1608
|
+
module.exports = intersects;
|
|
1609
|
+
}
|
|
1610
|
+
});
|
|
1611
|
+
|
|
1612
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/simplify.js
|
|
1613
|
+
var require_simplify = __commonJS({
|
|
1614
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
1615
|
+
"use strict";
|
|
1616
|
+
var satisfies = require_satisfies();
|
|
1617
|
+
var compare = require_compare();
|
|
1618
|
+
module.exports = (versions, range, options) => {
|
|
1619
|
+
const set = [];
|
|
1620
|
+
let first = null;
|
|
1621
|
+
let prev = null;
|
|
1622
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1623
|
+
for (const version of v) {
|
|
1624
|
+
const included = satisfies(version, range, options);
|
|
1625
|
+
if (included) {
|
|
1626
|
+
prev = version;
|
|
1627
|
+
if (!first) {
|
|
1628
|
+
first = version;
|
|
1629
|
+
}
|
|
1630
|
+
} else {
|
|
1631
|
+
if (prev) {
|
|
1632
|
+
set.push([first, prev]);
|
|
1633
|
+
}
|
|
1634
|
+
prev = null;
|
|
1635
|
+
first = null;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
if (first) {
|
|
1639
|
+
set.push([first, null]);
|
|
1640
|
+
}
|
|
1641
|
+
const ranges = [];
|
|
1642
|
+
for (const [min, max] of set) {
|
|
1643
|
+
if (min === max) {
|
|
1644
|
+
ranges.push(min);
|
|
1645
|
+
} else if (!max && min === v[0]) {
|
|
1646
|
+
ranges.push("*");
|
|
1647
|
+
} else if (!max) {
|
|
1648
|
+
ranges.push(`>=${min}`);
|
|
1649
|
+
} else if (min === v[0]) {
|
|
1650
|
+
ranges.push(`<=${max}`);
|
|
1651
|
+
} else {
|
|
1652
|
+
ranges.push(`${min} - ${max}`);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
const simplified = ranges.join(" || ");
|
|
1656
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1657
|
+
return simplified.length < original.length ? simplified : range;
|
|
1658
|
+
};
|
|
1659
|
+
}
|
|
1660
|
+
});
|
|
1661
|
+
|
|
1662
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/subset.js
|
|
1663
|
+
var require_subset = __commonJS({
|
|
1664
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
1665
|
+
"use strict";
|
|
1666
|
+
var Range = require_range();
|
|
1667
|
+
var Comparator = require_comparator();
|
|
1668
|
+
var { ANY } = Comparator;
|
|
1669
|
+
var satisfies = require_satisfies();
|
|
1670
|
+
var compare = require_compare();
|
|
1671
|
+
var subset = (sub, dom, options = {}) => {
|
|
1672
|
+
if (sub === dom) {
|
|
1673
|
+
return true;
|
|
1674
|
+
}
|
|
1675
|
+
sub = new Range(sub, options);
|
|
1676
|
+
dom = new Range(dom, options);
|
|
1677
|
+
let sawNonNull = false;
|
|
1678
|
+
OUTER:
|
|
1679
|
+
for (const simpleSub of sub.set) {
|
|
1680
|
+
for (const simpleDom of dom.set) {
|
|
1681
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1682
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1683
|
+
if (isSub) {
|
|
1684
|
+
continue OUTER;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
if (sawNonNull) {
|
|
1688
|
+
return false;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
return true;
|
|
1692
|
+
};
|
|
1693
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1694
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
1695
|
+
var simpleSubset = (sub, dom, options) => {
|
|
1696
|
+
if (sub === dom) {
|
|
1697
|
+
return true;
|
|
1698
|
+
}
|
|
1699
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1700
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1701
|
+
return true;
|
|
1702
|
+
} else if (options.includePrerelease) {
|
|
1703
|
+
sub = minimumVersionWithPreRelease;
|
|
1704
|
+
} else {
|
|
1705
|
+
sub = minimumVersion;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1709
|
+
if (options.includePrerelease) {
|
|
1710
|
+
return true;
|
|
1711
|
+
} else {
|
|
1712
|
+
dom = minimumVersion;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1716
|
+
let gt, lt;
|
|
1717
|
+
for (const c of sub) {
|
|
1718
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1719
|
+
gt = higherGT(gt, c, options);
|
|
1720
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1721
|
+
lt = lowerLT(lt, c, options);
|
|
1722
|
+
} else {
|
|
1723
|
+
eqSet.add(c.semver);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
if (eqSet.size > 1) {
|
|
1727
|
+
return null;
|
|
1728
|
+
}
|
|
1729
|
+
let gtltComp;
|
|
1730
|
+
if (gt && lt) {
|
|
1731
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1732
|
+
if (gtltComp > 0) {
|
|
1733
|
+
return null;
|
|
1734
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1735
|
+
return null;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
for (const eq of eqSet) {
|
|
1739
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1740
|
+
return null;
|
|
1741
|
+
}
|
|
1742
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1743
|
+
return null;
|
|
1744
|
+
}
|
|
1745
|
+
for (const c of dom) {
|
|
1746
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1747
|
+
return false;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
return true;
|
|
1751
|
+
}
|
|
1752
|
+
let higher, lower;
|
|
1753
|
+
let hasDomLT, hasDomGT;
|
|
1754
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1755
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1756
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1757
|
+
needDomLTPre = false;
|
|
1758
|
+
}
|
|
1759
|
+
for (const c of dom) {
|
|
1760
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1761
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1762
|
+
if (gt) {
|
|
1763
|
+
if (needDomGTPre) {
|
|
1764
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1765
|
+
needDomGTPre = false;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1769
|
+
higher = higherGT(gt, c, options);
|
|
1770
|
+
if (higher === c && higher !== gt) {
|
|
1771
|
+
return false;
|
|
1772
|
+
}
|
|
1773
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
1774
|
+
return false;
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
if (lt) {
|
|
1778
|
+
if (needDomLTPre) {
|
|
1779
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1780
|
+
needDomLTPre = false;
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1784
|
+
lower = lowerLT(lt, c, options);
|
|
1785
|
+
if (lower === c && lower !== lt) {
|
|
1786
|
+
return false;
|
|
1787
|
+
}
|
|
1788
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
1789
|
+
return false;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1793
|
+
return false;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1797
|
+
return false;
|
|
1798
|
+
}
|
|
1799
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1800
|
+
return false;
|
|
1801
|
+
}
|
|
1802
|
+
if (needDomGTPre || needDomLTPre) {
|
|
1803
|
+
return false;
|
|
1804
|
+
}
|
|
1805
|
+
return true;
|
|
1806
|
+
};
|
|
1807
|
+
var higherGT = (a, b, options) => {
|
|
1808
|
+
if (!a) {
|
|
1809
|
+
return b;
|
|
1810
|
+
}
|
|
1811
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1812
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1813
|
+
};
|
|
1814
|
+
var lowerLT = (a, b, options) => {
|
|
1815
|
+
if (!a) {
|
|
1816
|
+
return b;
|
|
1817
|
+
}
|
|
1818
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1819
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1820
|
+
};
|
|
1821
|
+
module.exports = subset;
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1824
|
+
|
|
1825
|
+
// ../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/index.js
|
|
1826
|
+
var require_semver2 = __commonJS({
|
|
1827
|
+
"../../node_modules/.pnpm/semver@7.6.3/node_modules/semver/index.js"(exports, module) {
|
|
1828
|
+
"use strict";
|
|
1829
|
+
var internalRe = require_re();
|
|
1830
|
+
var constants = require_constants();
|
|
1831
|
+
var SemVer = require_semver();
|
|
1832
|
+
var identifiers = require_identifiers();
|
|
1833
|
+
var parse = require_parse();
|
|
1834
|
+
var valid = require_valid();
|
|
1835
|
+
var clean = require_clean();
|
|
1836
|
+
var inc = require_inc();
|
|
1837
|
+
var diff = require_diff();
|
|
1838
|
+
var major = require_major();
|
|
1839
|
+
var minor = require_minor();
|
|
1840
|
+
var patch = require_patch();
|
|
1841
|
+
var prerelease = require_prerelease();
|
|
1842
|
+
var compare = require_compare();
|
|
1843
|
+
var rcompare = require_rcompare();
|
|
1844
|
+
var compareLoose = require_compare_loose();
|
|
1845
|
+
var compareBuild = require_compare_build();
|
|
1846
|
+
var sort = require_sort();
|
|
1847
|
+
var rsort = require_rsort();
|
|
1848
|
+
var gt = require_gt();
|
|
1849
|
+
var lt = require_lt();
|
|
1850
|
+
var eq = require_eq();
|
|
1851
|
+
var neq = require_neq();
|
|
1852
|
+
var gte4 = require_gte();
|
|
1853
|
+
var lte = require_lte();
|
|
1854
|
+
var cmp = require_cmp();
|
|
1855
|
+
var coerce5 = require_coerce();
|
|
1856
|
+
var Comparator = require_comparator();
|
|
1857
|
+
var Range = require_range();
|
|
1858
|
+
var satisfies = require_satisfies();
|
|
1859
|
+
var toComparators = require_to_comparators();
|
|
1860
|
+
var maxSatisfying = require_max_satisfying();
|
|
1861
|
+
var minSatisfying = require_min_satisfying();
|
|
1862
|
+
var minVersion = require_min_version();
|
|
1863
|
+
var validRange = require_valid2();
|
|
1864
|
+
var outside = require_outside();
|
|
1865
|
+
var gtr = require_gtr();
|
|
1866
|
+
var ltr = require_ltr();
|
|
1867
|
+
var intersects = require_intersects();
|
|
1868
|
+
var simplifyRange = require_simplify();
|
|
1869
|
+
var subset = require_subset();
|
|
1870
|
+
module.exports = {
|
|
1871
|
+
parse,
|
|
1872
|
+
valid,
|
|
1873
|
+
clean,
|
|
1874
|
+
inc,
|
|
1875
|
+
diff,
|
|
1876
|
+
major,
|
|
1877
|
+
minor,
|
|
1878
|
+
patch,
|
|
1879
|
+
prerelease,
|
|
1880
|
+
compare,
|
|
1881
|
+
rcompare,
|
|
1882
|
+
compareLoose,
|
|
1883
|
+
compareBuild,
|
|
1884
|
+
sort,
|
|
1885
|
+
rsort,
|
|
1886
|
+
gt,
|
|
1887
|
+
lt,
|
|
1888
|
+
eq,
|
|
1889
|
+
neq,
|
|
1890
|
+
gte: gte4,
|
|
1891
|
+
lte,
|
|
1892
|
+
cmp,
|
|
1893
|
+
coerce: coerce5,
|
|
1894
|
+
Comparator,
|
|
1895
|
+
Range,
|
|
1896
|
+
satisfies,
|
|
1897
|
+
toComparators,
|
|
1898
|
+
maxSatisfying,
|
|
1899
|
+
minSatisfying,
|
|
1900
|
+
minVersion,
|
|
1901
|
+
validRange,
|
|
1902
|
+
outside,
|
|
1903
|
+
gtr,
|
|
1904
|
+
ltr,
|
|
1905
|
+
intersects,
|
|
1906
|
+
simplifyRange,
|
|
1907
|
+
subset,
|
|
1908
|
+
SemVer,
|
|
1909
|
+
re: internalRe.re,
|
|
1910
|
+
src: internalRe.src,
|
|
1911
|
+
tokens: internalRe.t,
|
|
1912
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1913
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1914
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1915
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1916
|
+
};
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
|
|
1
1920
|
// src/premint/premint-client.ts
|
|
2
1921
|
import { decodeEventLog, zeroAddress as zeroAddress2 } from "viem";
|
|
3
1922
|
import {
|
|
@@ -42,8 +1961,8 @@ import { parseAbi } from "viem";
|
|
|
42
1961
|
var ZORA_API_BASE = "https://api.zora.co/";
|
|
43
1962
|
var OPEN_EDITION_MINT_SIZE = BigInt("18446744073709551615");
|
|
44
1963
|
var SUBGRAPH_CONFIG_BASE = "https://api.goldsky.com/api/public/project_clhk16b61ay9t49vm6ntn4mkz/subgraphs";
|
|
45
|
-
function getSubgraph(name,
|
|
46
|
-
return `${SUBGRAPH_CONFIG_BASE}/${name}/${
|
|
1964
|
+
function getSubgraph(name, version) {
|
|
1965
|
+
return `${SUBGRAPH_CONFIG_BASE}/${name}/${version}/gn`;
|
|
47
1966
|
}
|
|
48
1967
|
var zora721Abi = parseAbi([
|
|
49
1968
|
"function mintWithRewards(address recipient, uint256 quantity, string calldata comment, address mintReferral) external payable",
|
|
@@ -381,7 +2300,7 @@ function migratePremintConfigToV2({
|
|
|
381
2300
|
};
|
|
382
2301
|
}
|
|
383
2302
|
var recoverCreatorFromCreatorAttribution = async ({
|
|
384
|
-
creatorAttribution: { version
|
|
2303
|
+
creatorAttribution: { version, domainName, structHash, signature },
|
|
385
2304
|
chainId,
|
|
386
2305
|
tokenContract
|
|
387
2306
|
}) => {
|
|
@@ -390,7 +2309,7 @@ var recoverCreatorFromCreatorAttribution = async ({
|
|
|
390
2309
|
chainId,
|
|
391
2310
|
name: domainName,
|
|
392
2311
|
verifyingContract: tokenContract,
|
|
393
|
-
version
|
|
2312
|
+
version
|
|
394
2313
|
},
|
|
395
2314
|
types: {
|
|
396
2315
|
EIP712Domain: [
|
|
@@ -426,11 +2345,11 @@ var supportedPremintVersions = async ({
|
|
|
426
2345
|
});
|
|
427
2346
|
};
|
|
428
2347
|
var supportsPremintVersion = async ({
|
|
429
|
-
version
|
|
2348
|
+
version,
|
|
430
2349
|
tokenContract,
|
|
431
2350
|
publicClient
|
|
432
2351
|
}) => {
|
|
433
|
-
return (await supportedPremintVersions({ tokenContract, publicClient })).includes(
|
|
2352
|
+
return (await supportedPremintVersions({ tokenContract, publicClient })).includes(version);
|
|
434
2353
|
};
|
|
435
2354
|
async function getPremintCollectionAddress({
|
|
436
2355
|
publicClient,
|
|
@@ -454,7 +2373,7 @@ async function getPremintCollectionAddress({
|
|
|
454
2373
|
}
|
|
455
2374
|
function applyUpdateToPremint({
|
|
456
2375
|
uid,
|
|
457
|
-
version
|
|
2376
|
+
version,
|
|
458
2377
|
tokenConfig,
|
|
459
2378
|
tokenConfigUpdates
|
|
460
2379
|
}) {
|
|
@@ -465,7 +2384,7 @@ function applyUpdateToPremint({
|
|
|
465
2384
|
const result = {
|
|
466
2385
|
deleted: false,
|
|
467
2386
|
uid,
|
|
468
|
-
version:
|
|
2387
|
+
version: version + 1,
|
|
469
2388
|
tokenConfig: updatedTokenConfig
|
|
470
2389
|
};
|
|
471
2390
|
return result;
|
|
@@ -810,7 +2729,7 @@ function buildPremintsOfContractQuery({
|
|
|
810
2729
|
}
|
|
811
2730
|
|
|
812
2731
|
// src/mint/subgraph-mint-getter.ts
|
|
813
|
-
|
|
2732
|
+
var semver = __toESM(require_semver2(), 1);
|
|
814
2733
|
var getApiNetworkConfigForChain = (chainId) => {
|
|
815
2734
|
if (!networkConfigByChain[chainId]) {
|
|
816
2735
|
throw new Error(`chain id ${chainId} network not configured `);
|
|
@@ -1664,7 +3583,7 @@ import {
|
|
|
1664
3583
|
} from "@zoralabs/protocol-deployments";
|
|
1665
3584
|
|
|
1666
3585
|
// src/mint/utils.ts
|
|
1667
|
-
|
|
3586
|
+
var semver2 = __toESM(require_semver2(), 1);
|
|
1668
3587
|
var contractSupportsNewMintFunction = (contractVersion) => {
|
|
1669
3588
|
if (!contractVersion) {
|
|
1670
3589
|
return false;
|
|
@@ -2228,6 +4147,7 @@ async function getContractInfo({
|
|
|
2228
4147
|
}
|
|
2229
4148
|
|
|
2230
4149
|
// src/create/token-setup.ts
|
|
4150
|
+
var semver3 = __toESM(require_semver2(), 1);
|
|
2231
4151
|
import {
|
|
2232
4152
|
erc20MinterABI as erc20MinterABI2,
|
|
2233
4153
|
erc20MinterAddress as erc20MinterAddresses,
|
|
@@ -2236,7 +4156,6 @@ import {
|
|
|
2236
4156
|
zoraCreatorFixedPriceSaleStrategyAddress as zoraCreatorFixedPriceSaleStrategyAddress2
|
|
2237
4157
|
} from "@zoralabs/protocol-deployments";
|
|
2238
4158
|
import { encodeFunctionData, zeroAddress as zeroAddress5 } from "viem";
|
|
2239
|
-
import * as semver3 from "semver";
|
|
2240
4159
|
var PERMISSION_BITS = {
|
|
2241
4160
|
MINTER: 2n ** 2n
|
|
2242
4161
|
};
|
|
@@ -2996,91 +4915,16 @@ function createCollectorClient(params) {
|
|
|
2996
4915
|
mint: (p) => mintClient.mint(p),
|
|
2997
4916
|
getMintCosts: (p) => mintClient.getMintCosts(p)
|
|
2998
4917
|
};
|
|
2999
|
-
}
|
|
3000
|
-
|
|
3001
|
-
// src/ipfs/arweave.ts
|
|
3002
|
-
function isArweaveURL(url) {
|
|
3003
|
-
return url && typeof url === "string" ? url.startsWith("ar://") : false;
|
|
3004
|
-
}
|
|
3005
|
-
|
|
3006
|
-
// ../../node_modules/multiformats/esm/vendor/varint.js
|
|
3007
|
-
var encode_1 = encode;
|
|
3008
|
-
var MSB = 128;
|
|
3009
|
-
var REST = 127;
|
|
3010
|
-
var MSBALL = ~REST;
|
|
3011
|
-
var INT = Math.pow(2, 31);
|
|
3012
|
-
function encode(num, out, offset) {
|
|
3013
|
-
out = out || [];
|
|
3014
|
-
offset = offset || 0;
|
|
3015
|
-
var oldOffset = offset;
|
|
3016
|
-
while (num >= INT) {
|
|
3017
|
-
out[offset++] = num & 255 | MSB;
|
|
3018
|
-
num /= 128;
|
|
3019
|
-
}
|
|
3020
|
-
while (num & MSBALL) {
|
|
3021
|
-
out[offset++] = num & 255 | MSB;
|
|
3022
|
-
num >>>= 7;
|
|
3023
|
-
}
|
|
3024
|
-
out[offset] = num | 0;
|
|
3025
|
-
encode.bytes = offset - oldOffset + 1;
|
|
3026
|
-
return out;
|
|
3027
|
-
}
|
|
3028
|
-
var decode = read;
|
|
3029
|
-
var MSB$1 = 128;
|
|
3030
|
-
var REST$1 = 127;
|
|
3031
|
-
function read(buf, offset) {
|
|
3032
|
-
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;
|
|
3033
|
-
do {
|
|
3034
|
-
if (counter >= l) {
|
|
3035
|
-
read.bytes = 0;
|
|
3036
|
-
throw new RangeError("Could not decode varint");
|
|
3037
|
-
}
|
|
3038
|
-
b = buf[counter++];
|
|
3039
|
-
res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift);
|
|
3040
|
-
shift += 7;
|
|
3041
|
-
} while (b >= MSB$1);
|
|
3042
|
-
read.bytes = counter - offset;
|
|
3043
|
-
return res;
|
|
3044
|
-
}
|
|
3045
|
-
var N1 = Math.pow(2, 7);
|
|
3046
|
-
var N2 = Math.pow(2, 14);
|
|
3047
|
-
var N3 = Math.pow(2, 21);
|
|
3048
|
-
var N4 = Math.pow(2, 28);
|
|
3049
|
-
var N5 = Math.pow(2, 35);
|
|
3050
|
-
var N6 = Math.pow(2, 42);
|
|
3051
|
-
var N7 = Math.pow(2, 49);
|
|
3052
|
-
var N8 = Math.pow(2, 56);
|
|
3053
|
-
var N9 = Math.pow(2, 63);
|
|
3054
|
-
var length = function(value) {
|
|
3055
|
-
return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;
|
|
3056
|
-
};
|
|
3057
|
-
var varint = {
|
|
3058
|
-
encode: encode_1,
|
|
3059
|
-
decode,
|
|
3060
|
-
encodingLength: length
|
|
3061
|
-
};
|
|
3062
|
-
var _brrp_varint = varint;
|
|
3063
|
-
var varint_default = _brrp_varint;
|
|
4918
|
+
}
|
|
3064
4919
|
|
|
3065
|
-
//
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
code,
|
|
3070
|
-
varint_default.decode.bytes
|
|
3071
|
-
];
|
|
3072
|
-
};
|
|
3073
|
-
var encodeTo = (int, target, offset = 0) => {
|
|
3074
|
-
varint_default.encode(int, target, offset);
|
|
3075
|
-
return target;
|
|
3076
|
-
};
|
|
3077
|
-
var encodingLength = (int) => {
|
|
3078
|
-
return varint_default.encodingLength(int);
|
|
3079
|
-
};
|
|
4920
|
+
// src/ipfs/arweave.ts
|
|
4921
|
+
function isArweaveURL(url) {
|
|
4922
|
+
return url && typeof url === "string" ? url.startsWith("ar://") : false;
|
|
4923
|
+
}
|
|
3080
4924
|
|
|
3081
|
-
// ../../node_modules/multiformats/
|
|
4925
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/bytes.js
|
|
3082
4926
|
var empty = new Uint8Array(0);
|
|
3083
|
-
|
|
4927
|
+
function equals(aa, bb) {
|
|
3084
4928
|
if (aa === bb)
|
|
3085
4929
|
return true;
|
|
3086
4930
|
if (aa.byteLength !== bb.byteLength) {
|
|
@@ -3092,8 +4936,8 @@ var equals = (aa, bb) => {
|
|
|
3092
4936
|
}
|
|
3093
4937
|
}
|
|
3094
4938
|
return true;
|
|
3095
|
-
}
|
|
3096
|
-
|
|
4939
|
+
}
|
|
4940
|
+
function coerce4(o) {
|
|
3097
4941
|
if (o instanceof Uint8Array && o.constructor.name === "Uint8Array")
|
|
3098
4942
|
return o;
|
|
3099
4943
|
if (o instanceof ArrayBuffer)
|
|
@@ -3102,46 +4946,9 @@ var coerce4 = (o) => {
|
|
|
3102
4946
|
return new Uint8Array(o.buffer, o.byteOffset, o.byteLength);
|
|
3103
4947
|
}
|
|
3104
4948
|
throw new Error("Unknown type, must be binary type");
|
|
3105
|
-
}
|
|
3106
|
-
|
|
3107
|
-
// ../../node_modules/multiformats/esm/src/hashes/digest.js
|
|
3108
|
-
var create = (code, digest) => {
|
|
3109
|
-
const size = digest.byteLength;
|
|
3110
|
-
const sizeOffset = encodingLength(code);
|
|
3111
|
-
const digestOffset = sizeOffset + encodingLength(size);
|
|
3112
|
-
const bytes = new Uint8Array(digestOffset + size);
|
|
3113
|
-
encodeTo(code, bytes, 0);
|
|
3114
|
-
encodeTo(size, bytes, sizeOffset);
|
|
3115
|
-
bytes.set(digest, digestOffset);
|
|
3116
|
-
return new Digest(code, size, digest, bytes);
|
|
3117
|
-
};
|
|
3118
|
-
var decode3 = (multihash) => {
|
|
3119
|
-
const bytes = coerce4(multihash);
|
|
3120
|
-
const [code, sizeOffset] = decode2(bytes);
|
|
3121
|
-
const [size, digestOffset] = decode2(bytes.subarray(sizeOffset));
|
|
3122
|
-
const digest = bytes.subarray(sizeOffset + digestOffset);
|
|
3123
|
-
if (digest.byteLength !== size) {
|
|
3124
|
-
throw new Error("Incorrect length");
|
|
3125
|
-
}
|
|
3126
|
-
return new Digest(code, size, digest, bytes);
|
|
3127
|
-
};
|
|
3128
|
-
var equals2 = (a, b) => {
|
|
3129
|
-
if (a === b) {
|
|
3130
|
-
return true;
|
|
3131
|
-
} else {
|
|
3132
|
-
return a.code === b.code && a.size === b.size && equals(a.bytes, b.bytes);
|
|
3133
|
-
}
|
|
3134
|
-
};
|
|
3135
|
-
var Digest = class {
|
|
3136
|
-
constructor(code, size, digest, bytes) {
|
|
3137
|
-
this.code = code;
|
|
3138
|
-
this.size = size;
|
|
3139
|
-
this.digest = digest;
|
|
3140
|
-
this.bytes = bytes;
|
|
3141
|
-
}
|
|
3142
|
-
};
|
|
4949
|
+
}
|
|
3143
4950
|
|
|
3144
|
-
// ../../node_modules/multiformats/
|
|
4951
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/vendor/base-x.js
|
|
3145
4952
|
function base2(ALPHABET, name) {
|
|
3146
4953
|
if (ALPHABET.length >= 255) {
|
|
3147
4954
|
throw new TypeError("Alphabet too long");
|
|
@@ -3277,9 +5084,12 @@ var src = base2;
|
|
|
3277
5084
|
var _brrp__multiformats_scope_baseX = src;
|
|
3278
5085
|
var base_x_default = _brrp__multiformats_scope_baseX;
|
|
3279
5086
|
|
|
3280
|
-
// ../../node_modules/multiformats/
|
|
5087
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/bases/base.js
|
|
3281
5088
|
var Encoder = class {
|
|
3282
5089
|
constructor(name, prefix, baseEncode) {
|
|
5090
|
+
__publicField(this, "name");
|
|
5091
|
+
__publicField(this, "prefix");
|
|
5092
|
+
__publicField(this, "baseEncode");
|
|
3283
5093
|
this.name = name;
|
|
3284
5094
|
this.prefix = prefix;
|
|
3285
5095
|
this.baseEncode = baseEncode;
|
|
@@ -3294,6 +5104,10 @@ var Encoder = class {
|
|
|
3294
5104
|
};
|
|
3295
5105
|
var Decoder = class {
|
|
3296
5106
|
constructor(name, prefix, baseDecode) {
|
|
5107
|
+
__publicField(this, "name");
|
|
5108
|
+
__publicField(this, "prefix");
|
|
5109
|
+
__publicField(this, "baseDecode");
|
|
5110
|
+
__publicField(this, "prefixCodePoint");
|
|
3297
5111
|
this.name = name;
|
|
3298
5112
|
this.prefix = prefix;
|
|
3299
5113
|
if (prefix.codePointAt(0) === void 0) {
|
|
@@ -3318,6 +5132,7 @@ var Decoder = class {
|
|
|
3318
5132
|
};
|
|
3319
5133
|
var ComposedDecoder = class {
|
|
3320
5134
|
constructor(decoders) {
|
|
5135
|
+
__publicField(this, "decoders");
|
|
3321
5136
|
this.decoders = decoders;
|
|
3322
5137
|
}
|
|
3323
5138
|
or(decoder) {
|
|
@@ -3326,19 +5141,27 @@ var ComposedDecoder = class {
|
|
|
3326
5141
|
decode(input) {
|
|
3327
5142
|
const prefix = input[0];
|
|
3328
5143
|
const decoder = this.decoders[prefix];
|
|
3329
|
-
if (decoder) {
|
|
5144
|
+
if (decoder != null) {
|
|
3330
5145
|
return decoder.decode(input);
|
|
3331
5146
|
} else {
|
|
3332
5147
|
throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`);
|
|
3333
5148
|
}
|
|
3334
5149
|
}
|
|
3335
5150
|
};
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
}
|
|
5151
|
+
function or(left, right) {
|
|
5152
|
+
return new ComposedDecoder({
|
|
5153
|
+
...left.decoders ?? { [left.prefix]: left },
|
|
5154
|
+
...right.decoders ?? { [right.prefix]: right }
|
|
5155
|
+
});
|
|
5156
|
+
}
|
|
3340
5157
|
var Codec = class {
|
|
3341
5158
|
constructor(name, prefix, baseEncode, baseDecode) {
|
|
5159
|
+
__publicField(this, "name");
|
|
5160
|
+
__publicField(this, "prefix");
|
|
5161
|
+
__publicField(this, "baseEncode");
|
|
5162
|
+
__publicField(this, "baseDecode");
|
|
5163
|
+
__publicField(this, "encoder");
|
|
5164
|
+
__publicField(this, "decoder");
|
|
3342
5165
|
this.name = name;
|
|
3343
5166
|
this.prefix = prefix;
|
|
3344
5167
|
this.baseEncode = baseEncode;
|
|
@@ -3353,8 +5176,10 @@ var Codec = class {
|
|
|
3353
5176
|
return this.decoder.decode(input);
|
|
3354
5177
|
}
|
|
3355
5178
|
};
|
|
3356
|
-
|
|
3357
|
-
|
|
5179
|
+
function from({ name, prefix, encode: encode3, decode: decode5 }) {
|
|
5180
|
+
return new Codec(name, prefix, encode3, decode5);
|
|
5181
|
+
}
|
|
5182
|
+
function baseX({ name, prefix, alphabet }) {
|
|
3358
5183
|
const { encode: encode3, decode: decode5 } = base_x_default(alphabet, name);
|
|
3359
5184
|
return from({
|
|
3360
5185
|
prefix,
|
|
@@ -3362,8 +5187,8 @@ var baseX = ({ prefix, name, alphabet }) => {
|
|
|
3362
5187
|
encode: encode3,
|
|
3363
5188
|
decode: (text) => coerce4(decode5(text))
|
|
3364
5189
|
});
|
|
3365
|
-
}
|
|
3366
|
-
|
|
5190
|
+
}
|
|
5191
|
+
function decode(string, alphabet, bitsPerChar, name) {
|
|
3367
5192
|
const codes = {};
|
|
3368
5193
|
for (let i = 0; i < alphabet.length; ++i) {
|
|
3369
5194
|
codes[alphabet[i]] = i;
|
|
@@ -3388,12 +5213,12 @@ var decode4 = (string, alphabet, bitsPerChar, name) => {
|
|
|
3388
5213
|
out[written++] = 255 & buffer >> bits;
|
|
3389
5214
|
}
|
|
3390
5215
|
}
|
|
3391
|
-
if (bits >= bitsPerChar || 255 & buffer << 8 - bits) {
|
|
5216
|
+
if (bits >= bitsPerChar || (255 & buffer << 8 - bits) !== 0) {
|
|
3392
5217
|
throw new SyntaxError("Unexpected end of data");
|
|
3393
5218
|
}
|
|
3394
5219
|
return out;
|
|
3395
|
-
}
|
|
3396
|
-
|
|
5220
|
+
}
|
|
5221
|
+
function encode(data, alphabet, bitsPerChar) {
|
|
3397
5222
|
const pad = alphabet[alphabet.length - 1] === "=";
|
|
3398
5223
|
const mask = (1 << bitsPerChar) - 1;
|
|
3399
5224
|
let out = "";
|
|
@@ -3407,42 +5232,30 @@ var encode2 = (data, alphabet, bitsPerChar) => {
|
|
|
3407
5232
|
out += alphabet[mask & buffer >> bits];
|
|
3408
5233
|
}
|
|
3409
5234
|
}
|
|
3410
|
-
if (bits) {
|
|
5235
|
+
if (bits !== 0) {
|
|
3411
5236
|
out += alphabet[mask & buffer << bitsPerChar - bits];
|
|
3412
5237
|
}
|
|
3413
5238
|
if (pad) {
|
|
3414
|
-
while (out.length * bitsPerChar & 7) {
|
|
5239
|
+
while ((out.length * bitsPerChar & 7) !== 0) {
|
|
3415
5240
|
out += "=";
|
|
3416
5241
|
}
|
|
3417
5242
|
}
|
|
3418
5243
|
return out;
|
|
3419
|
-
}
|
|
3420
|
-
|
|
5244
|
+
}
|
|
5245
|
+
function rfc4648({ name, prefix, bitsPerChar, alphabet }) {
|
|
3421
5246
|
return from({
|
|
3422
5247
|
prefix,
|
|
3423
5248
|
name,
|
|
3424
5249
|
encode(input) {
|
|
3425
|
-
return
|
|
5250
|
+
return encode(input, alphabet, bitsPerChar);
|
|
3426
5251
|
},
|
|
3427
5252
|
decode(input) {
|
|
3428
|
-
return
|
|
5253
|
+
return decode(input, alphabet, bitsPerChar, name);
|
|
3429
5254
|
}
|
|
3430
5255
|
});
|
|
3431
|
-
}
|
|
3432
|
-
|
|
3433
|
-
// ../../node_modules/multiformats/esm/src/bases/base58.js
|
|
3434
|
-
var base58btc = baseX({
|
|
3435
|
-
name: "base58btc",
|
|
3436
|
-
prefix: "z",
|
|
3437
|
-
alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
|
3438
|
-
});
|
|
3439
|
-
var base58flickr = baseX({
|
|
3440
|
-
name: "base58flickr",
|
|
3441
|
-
prefix: "Z",
|
|
3442
|
-
alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
|
|
3443
|
-
});
|
|
5256
|
+
}
|
|
3444
5257
|
|
|
3445
|
-
// ../../node_modules/multiformats/
|
|
5258
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/bases/base32.js
|
|
3446
5259
|
var base32 = rfc4648({
|
|
3447
5260
|
prefix: "b",
|
|
3448
5261
|
name: "base32",
|
|
@@ -3498,34 +5311,198 @@ var base32z = rfc4648({
|
|
|
3498
5311
|
bitsPerChar: 5
|
|
3499
5312
|
});
|
|
3500
5313
|
|
|
3501
|
-
// ../../node_modules/multiformats/
|
|
5314
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/bases/base58.js
|
|
5315
|
+
var base58btc = baseX({
|
|
5316
|
+
name: "base58btc",
|
|
5317
|
+
prefix: "z",
|
|
5318
|
+
alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
|
5319
|
+
});
|
|
5320
|
+
var base58flickr = baseX({
|
|
5321
|
+
name: "base58flickr",
|
|
5322
|
+
prefix: "Z",
|
|
5323
|
+
alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
|
|
5324
|
+
});
|
|
5325
|
+
|
|
5326
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/vendor/varint.js
|
|
5327
|
+
var encode_1 = encode2;
|
|
5328
|
+
var MSB = 128;
|
|
5329
|
+
var REST = 127;
|
|
5330
|
+
var MSBALL = ~REST;
|
|
5331
|
+
var INT = Math.pow(2, 31);
|
|
5332
|
+
function encode2(num, out, offset) {
|
|
5333
|
+
out = out || [];
|
|
5334
|
+
offset = offset || 0;
|
|
5335
|
+
var oldOffset = offset;
|
|
5336
|
+
while (num >= INT) {
|
|
5337
|
+
out[offset++] = num & 255 | MSB;
|
|
5338
|
+
num /= 128;
|
|
5339
|
+
}
|
|
5340
|
+
while (num & MSBALL) {
|
|
5341
|
+
out[offset++] = num & 255 | MSB;
|
|
5342
|
+
num >>>= 7;
|
|
5343
|
+
}
|
|
5344
|
+
out[offset] = num | 0;
|
|
5345
|
+
encode2.bytes = offset - oldOffset + 1;
|
|
5346
|
+
return out;
|
|
5347
|
+
}
|
|
5348
|
+
var decode2 = read;
|
|
5349
|
+
var MSB$1 = 128;
|
|
5350
|
+
var REST$1 = 127;
|
|
5351
|
+
function read(buf, offset) {
|
|
5352
|
+
var res = 0, offset = offset || 0, shift = 0, counter = offset, b, l = buf.length;
|
|
5353
|
+
do {
|
|
5354
|
+
if (counter >= l) {
|
|
5355
|
+
read.bytes = 0;
|
|
5356
|
+
throw new RangeError("Could not decode varint");
|
|
5357
|
+
}
|
|
5358
|
+
b = buf[counter++];
|
|
5359
|
+
res += shift < 28 ? (b & REST$1) << shift : (b & REST$1) * Math.pow(2, shift);
|
|
5360
|
+
shift += 7;
|
|
5361
|
+
} while (b >= MSB$1);
|
|
5362
|
+
read.bytes = counter - offset;
|
|
5363
|
+
return res;
|
|
5364
|
+
}
|
|
5365
|
+
var N1 = Math.pow(2, 7);
|
|
5366
|
+
var N2 = Math.pow(2, 14);
|
|
5367
|
+
var N3 = Math.pow(2, 21);
|
|
5368
|
+
var N4 = Math.pow(2, 28);
|
|
5369
|
+
var N5 = Math.pow(2, 35);
|
|
5370
|
+
var N6 = Math.pow(2, 42);
|
|
5371
|
+
var N7 = Math.pow(2, 49);
|
|
5372
|
+
var N8 = Math.pow(2, 56);
|
|
5373
|
+
var N9 = Math.pow(2, 63);
|
|
5374
|
+
var length = function(value) {
|
|
5375
|
+
return value < N1 ? 1 : value < N2 ? 2 : value < N3 ? 3 : value < N4 ? 4 : value < N5 ? 5 : value < N6 ? 6 : value < N7 ? 7 : value < N8 ? 8 : value < N9 ? 9 : 10;
|
|
5376
|
+
};
|
|
5377
|
+
var varint = {
|
|
5378
|
+
encode: encode_1,
|
|
5379
|
+
decode: decode2,
|
|
5380
|
+
encodingLength: length
|
|
5381
|
+
};
|
|
5382
|
+
var _brrp_varint = varint;
|
|
5383
|
+
var varint_default = _brrp_varint;
|
|
5384
|
+
|
|
5385
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/varint.js
|
|
5386
|
+
function decode3(data, offset = 0) {
|
|
5387
|
+
const code = varint_default.decode(data, offset);
|
|
5388
|
+
return [code, varint_default.decode.bytes];
|
|
5389
|
+
}
|
|
5390
|
+
function encodeTo(int, target, offset = 0) {
|
|
5391
|
+
varint_default.encode(int, target, offset);
|
|
5392
|
+
return target;
|
|
5393
|
+
}
|
|
5394
|
+
function encodingLength(int) {
|
|
5395
|
+
return varint_default.encodingLength(int);
|
|
5396
|
+
}
|
|
5397
|
+
|
|
5398
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/hashes/digest.js
|
|
5399
|
+
function create(code, digest) {
|
|
5400
|
+
const size = digest.byteLength;
|
|
5401
|
+
const sizeOffset = encodingLength(code);
|
|
5402
|
+
const digestOffset = sizeOffset + encodingLength(size);
|
|
5403
|
+
const bytes = new Uint8Array(digestOffset + size);
|
|
5404
|
+
encodeTo(code, bytes, 0);
|
|
5405
|
+
encodeTo(size, bytes, sizeOffset);
|
|
5406
|
+
bytes.set(digest, digestOffset);
|
|
5407
|
+
return new Digest(code, size, digest, bytes);
|
|
5408
|
+
}
|
|
5409
|
+
function decode4(multihash) {
|
|
5410
|
+
const bytes = coerce4(multihash);
|
|
5411
|
+
const [code, sizeOffset] = decode3(bytes);
|
|
5412
|
+
const [size, digestOffset] = decode3(bytes.subarray(sizeOffset));
|
|
5413
|
+
const digest = bytes.subarray(sizeOffset + digestOffset);
|
|
5414
|
+
if (digest.byteLength !== size) {
|
|
5415
|
+
throw new Error("Incorrect length");
|
|
5416
|
+
}
|
|
5417
|
+
return new Digest(code, size, digest, bytes);
|
|
5418
|
+
}
|
|
5419
|
+
function equals2(a, b) {
|
|
5420
|
+
if (a === b) {
|
|
5421
|
+
return true;
|
|
5422
|
+
} else {
|
|
5423
|
+
const data = b;
|
|
5424
|
+
return a.code === data.code && a.size === data.size && data.bytes instanceof Uint8Array && equals(a.bytes, data.bytes);
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
var Digest = class {
|
|
5428
|
+
/**
|
|
5429
|
+
* Creates a multihash digest.
|
|
5430
|
+
*/
|
|
5431
|
+
constructor(code, size, digest, bytes) {
|
|
5432
|
+
__publicField(this, "code");
|
|
5433
|
+
__publicField(this, "size");
|
|
5434
|
+
__publicField(this, "digest");
|
|
5435
|
+
__publicField(this, "bytes");
|
|
5436
|
+
this.code = code;
|
|
5437
|
+
this.size = size;
|
|
5438
|
+
this.digest = digest;
|
|
5439
|
+
this.bytes = bytes;
|
|
5440
|
+
}
|
|
5441
|
+
};
|
|
5442
|
+
|
|
5443
|
+
// ../../node_modules/.pnpm/multiformats@13.2.0/node_modules/multiformats/dist/src/cid.js
|
|
5444
|
+
function format(link, base3) {
|
|
5445
|
+
const { bytes, version } = link;
|
|
5446
|
+
switch (version) {
|
|
5447
|
+
case 0:
|
|
5448
|
+
return toStringV0(bytes, baseCache(link), base3 ?? base58btc.encoder);
|
|
5449
|
+
default:
|
|
5450
|
+
return toStringV1(bytes, baseCache(link), base3 ?? base32.encoder);
|
|
5451
|
+
}
|
|
5452
|
+
}
|
|
5453
|
+
var cache = /* @__PURE__ */ new WeakMap();
|
|
5454
|
+
function baseCache(cid) {
|
|
5455
|
+
const baseCache2 = cache.get(cid);
|
|
5456
|
+
if (baseCache2 == null) {
|
|
5457
|
+
const baseCache3 = /* @__PURE__ */ new Map();
|
|
5458
|
+
cache.set(cid, baseCache3);
|
|
5459
|
+
return baseCache3;
|
|
5460
|
+
}
|
|
5461
|
+
return baseCache2;
|
|
5462
|
+
}
|
|
5463
|
+
var _a;
|
|
3502
5464
|
var CID = class _CID {
|
|
3503
|
-
|
|
5465
|
+
/**
|
|
5466
|
+
* @param version - Version of the CID
|
|
5467
|
+
* @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
|
|
5468
|
+
* @param multihash - (Multi)hash of the of the content.
|
|
5469
|
+
*/
|
|
5470
|
+
constructor(version, code, multihash, bytes) {
|
|
5471
|
+
__publicField(this, "code");
|
|
5472
|
+
__publicField(this, "version");
|
|
5473
|
+
__publicField(this, "multihash");
|
|
5474
|
+
__publicField(this, "bytes");
|
|
5475
|
+
__publicField(this, "/");
|
|
5476
|
+
__publicField(this, _a, "CID");
|
|
3504
5477
|
this.code = code;
|
|
3505
|
-
this.version =
|
|
5478
|
+
this.version = version;
|
|
3506
5479
|
this.multihash = multihash;
|
|
3507
5480
|
this.bytes = bytes;
|
|
3508
|
-
this
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
5481
|
+
this["/"] = bytes;
|
|
5482
|
+
}
|
|
5483
|
+
/**
|
|
5484
|
+
* Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`
|
|
5485
|
+
* please either use `CID.asCID(cid)` or switch to new signalling mechanism
|
|
5486
|
+
*
|
|
5487
|
+
* @deprecated
|
|
5488
|
+
*/
|
|
5489
|
+
get asCID() {
|
|
5490
|
+
return this;
|
|
5491
|
+
}
|
|
5492
|
+
// ArrayBufferView
|
|
5493
|
+
get byteOffset() {
|
|
5494
|
+
return this.bytes.byteOffset;
|
|
5495
|
+
}
|
|
5496
|
+
// ArrayBufferView
|
|
5497
|
+
get byteLength() {
|
|
5498
|
+
return this.bytes.byteLength;
|
|
3522
5499
|
}
|
|
3523
5500
|
toV0() {
|
|
3524
5501
|
switch (this.version) {
|
|
3525
5502
|
case 0: {
|
|
3526
5503
|
return this;
|
|
3527
5504
|
}
|
|
3528
|
-
|
|
5505
|
+
case 1: {
|
|
3529
5506
|
const { code, multihash } = this;
|
|
3530
5507
|
if (code !== DAG_PB_CODE) {
|
|
3531
5508
|
throw new Error("Cannot convert a non dag-pb CID to CIDv0");
|
|
@@ -3535,6 +5512,9 @@ var CID = class _CID {
|
|
|
3535
5512
|
}
|
|
3536
5513
|
return _CID.createV0(multihash);
|
|
3537
5514
|
}
|
|
5515
|
+
default: {
|
|
5516
|
+
throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`);
|
|
5517
|
+
}
|
|
3538
5518
|
}
|
|
3539
5519
|
}
|
|
3540
5520
|
toV1() {
|
|
@@ -3548,102 +5528,125 @@ var CID = class _CID {
|
|
|
3548
5528
|
return this;
|
|
3549
5529
|
}
|
|
3550
5530
|
default: {
|
|
3551
|
-
throw Error(`Can not convert CID version ${this.version} to version
|
|
5531
|
+
throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`);
|
|
3552
5532
|
}
|
|
3553
5533
|
}
|
|
3554
5534
|
}
|
|
3555
5535
|
equals(other) {
|
|
3556
|
-
return
|
|
5536
|
+
return _CID.equals(this, other);
|
|
5537
|
+
}
|
|
5538
|
+
static equals(self, other) {
|
|
5539
|
+
const unknown = other;
|
|
5540
|
+
return unknown != null && self.code === unknown.code && self.version === unknown.version && equals2(self.multihash, unknown.multihash);
|
|
3557
5541
|
}
|
|
3558
5542
|
toString(base3) {
|
|
3559
|
-
|
|
3560
|
-
switch (version2) {
|
|
3561
|
-
case 0:
|
|
3562
|
-
return toStringV0(bytes, _baseCache, base3 || base58btc.encoder);
|
|
3563
|
-
default:
|
|
3564
|
-
return toStringV1(bytes, _baseCache, base3 || base32.encoder);
|
|
3565
|
-
}
|
|
5543
|
+
return format(this, base3);
|
|
3566
5544
|
}
|
|
3567
5545
|
toJSON() {
|
|
3568
|
-
return {
|
|
3569
|
-
code: this.code,
|
|
3570
|
-
version: this.version,
|
|
3571
|
-
hash: this.multihash.bytes
|
|
3572
|
-
};
|
|
3573
|
-
}
|
|
3574
|
-
get [Symbol.toStringTag]() {
|
|
3575
|
-
return "CID";
|
|
3576
|
-
}
|
|
3577
|
-
[Symbol.for("nodejs.util.inspect.custom")]() {
|
|
3578
|
-
return "CID(" + this.toString() + ")";
|
|
3579
|
-
}
|
|
3580
|
-
static isCID(value) {
|
|
3581
|
-
deprecate(/^0\.0/, IS_CID_DEPRECATION);
|
|
3582
|
-
return !!(value && (value[cidSymbol] || value.asCID === value));
|
|
3583
|
-
}
|
|
3584
|
-
get toBaseEncodedString() {
|
|
3585
|
-
throw new Error("Deprecated, use .toString()");
|
|
3586
|
-
}
|
|
3587
|
-
get codec() {
|
|
3588
|
-
throw new Error('"codec" property is deprecated, use integer "code" property instead');
|
|
5546
|
+
return { "/": format(this) };
|
|
3589
5547
|
}
|
|
3590
|
-
|
|
3591
|
-
|
|
5548
|
+
link() {
|
|
5549
|
+
return this;
|
|
3592
5550
|
}
|
|
3593
|
-
|
|
3594
|
-
|
|
5551
|
+
// Legacy
|
|
5552
|
+
[(_a = Symbol.toStringTag, Symbol.for("nodejs.util.inspect.custom"))]() {
|
|
5553
|
+
return `CID(${this.toString()})`;
|
|
3595
5554
|
}
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
5555
|
+
/**
|
|
5556
|
+
* Takes any input `value` and returns a `CID` instance if it was
|
|
5557
|
+
* a `CID` otherwise returns `null`. If `value` is instanceof `CID`
|
|
5558
|
+
* it will return value back. If `value` is not instance of this CID
|
|
5559
|
+
* class, but is compatible CID it will return new instance of this
|
|
5560
|
+
* `CID` class. Otherwise returns null.
|
|
5561
|
+
*
|
|
5562
|
+
* This allows two different incompatible versions of CID library to
|
|
5563
|
+
* co-exist and interop as long as binary interface is compatible.
|
|
5564
|
+
*/
|
|
5565
|
+
static asCID(input) {
|
|
5566
|
+
if (input == null) {
|
|
5567
|
+
return null;
|
|
5568
|
+
}
|
|
5569
|
+
const value = input;
|
|
3600
5570
|
if (value instanceof _CID) {
|
|
3601
5571
|
return value;
|
|
3602
|
-
} else if (value != null && value.asCID === value) {
|
|
3603
|
-
const { version
|
|
3604
|
-
return new _CID(
|
|
3605
|
-
} else if (value
|
|
3606
|
-
const { version
|
|
3607
|
-
const digest =
|
|
3608
|
-
return _CID.create(
|
|
5572
|
+
} else if (value["/"] != null && value["/"] === value.bytes || value.asCID === value) {
|
|
5573
|
+
const { version, code, multihash, bytes } = value;
|
|
5574
|
+
return new _CID(version, code, multihash, bytes ?? encodeCID(version, code, multihash.bytes));
|
|
5575
|
+
} else if (value[cidSymbol] === true) {
|
|
5576
|
+
const { version, multihash, code } = value;
|
|
5577
|
+
const digest = decode4(multihash);
|
|
5578
|
+
return _CID.create(version, code, digest);
|
|
3609
5579
|
} else {
|
|
3610
5580
|
return null;
|
|
3611
5581
|
}
|
|
3612
5582
|
}
|
|
3613
|
-
|
|
5583
|
+
/**
|
|
5584
|
+
* @param version - Version of the CID
|
|
5585
|
+
* @param code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv
|
|
5586
|
+
* @param digest - (Multi)hash of the of the content.
|
|
5587
|
+
*/
|
|
5588
|
+
static create(version, code, digest) {
|
|
3614
5589
|
if (typeof code !== "number") {
|
|
3615
5590
|
throw new Error("String codecs are no longer supported");
|
|
3616
5591
|
}
|
|
3617
|
-
|
|
5592
|
+
if (!(digest.bytes instanceof Uint8Array)) {
|
|
5593
|
+
throw new Error("Invalid digest");
|
|
5594
|
+
}
|
|
5595
|
+
switch (version) {
|
|
3618
5596
|
case 0: {
|
|
3619
5597
|
if (code !== DAG_PB_CODE) {
|
|
3620
5598
|
throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);
|
|
3621
5599
|
} else {
|
|
3622
|
-
return new _CID(
|
|
5600
|
+
return new _CID(version, code, digest, digest.bytes);
|
|
3623
5601
|
}
|
|
3624
5602
|
}
|
|
3625
5603
|
case 1: {
|
|
3626
|
-
const bytes = encodeCID(
|
|
3627
|
-
return new _CID(
|
|
5604
|
+
const bytes = encodeCID(version, code, digest.bytes);
|
|
5605
|
+
return new _CID(version, code, digest, bytes);
|
|
3628
5606
|
}
|
|
3629
5607
|
default: {
|
|
3630
5608
|
throw new Error("Invalid version");
|
|
3631
5609
|
}
|
|
3632
5610
|
}
|
|
3633
5611
|
}
|
|
5612
|
+
/**
|
|
5613
|
+
* Simplified version of `create` for CIDv0.
|
|
5614
|
+
*/
|
|
3634
5615
|
static createV0(digest) {
|
|
3635
5616
|
return _CID.create(0, DAG_PB_CODE, digest);
|
|
3636
5617
|
}
|
|
5618
|
+
/**
|
|
5619
|
+
* Simplified version of `create` for CIDv1.
|
|
5620
|
+
*
|
|
5621
|
+
* @param code - Content encoding format code.
|
|
5622
|
+
* @param digest - Multihash of the content.
|
|
5623
|
+
*/
|
|
3637
5624
|
static createV1(code, digest) {
|
|
3638
5625
|
return _CID.create(1, code, digest);
|
|
3639
5626
|
}
|
|
5627
|
+
/**
|
|
5628
|
+
* Decoded a CID from its binary representation. The byte array must contain
|
|
5629
|
+
* only the CID with no additional bytes.
|
|
5630
|
+
*
|
|
5631
|
+
* An error will be thrown if the bytes provided do not contain a valid
|
|
5632
|
+
* binary representation of a CID.
|
|
5633
|
+
*/
|
|
3640
5634
|
static decode(bytes) {
|
|
3641
5635
|
const [cid, remainder] = _CID.decodeFirst(bytes);
|
|
3642
|
-
if (remainder.length) {
|
|
5636
|
+
if (remainder.length !== 0) {
|
|
3643
5637
|
throw new Error("Incorrect length");
|
|
3644
5638
|
}
|
|
3645
5639
|
return cid;
|
|
3646
5640
|
}
|
|
5641
|
+
/**
|
|
5642
|
+
* Decoded a CID from its binary representation at the beginning of a byte
|
|
5643
|
+
* array.
|
|
5644
|
+
*
|
|
5645
|
+
* Returns an array with the first element containing the CID and the second
|
|
5646
|
+
* element containing the remainder of the original byte array. The remainder
|
|
5647
|
+
* will be a zero-length byte array if the provided bytes only contained a
|
|
5648
|
+
* binary CID representation.
|
|
5649
|
+
*/
|
|
3647
5650
|
static decodeFirst(bytes) {
|
|
3648
5651
|
const specs = _CID.inspectBytes(bytes);
|
|
3649
5652
|
const prefixSize = specs.size - specs.multihashSize;
|
|
@@ -3654,154 +5657,120 @@ var CID = class _CID {
|
|
|
3654
5657
|
const digestBytes = multihashBytes.subarray(specs.multihashSize - specs.digestSize);
|
|
3655
5658
|
const digest = new Digest(specs.multihashCode, specs.digestSize, digestBytes, multihashBytes);
|
|
3656
5659
|
const cid = specs.version === 0 ? _CID.createV0(digest) : _CID.createV1(specs.codec, digest);
|
|
3657
|
-
return [
|
|
3658
|
-
cid,
|
|
3659
|
-
bytes.subarray(specs.size)
|
|
3660
|
-
];
|
|
5660
|
+
return [cid, bytes.subarray(specs.size)];
|
|
3661
5661
|
}
|
|
5662
|
+
/**
|
|
5663
|
+
* Inspect the initial bytes of a CID to determine its properties.
|
|
5664
|
+
*
|
|
5665
|
+
* Involves decoding up to 4 varints. Typically this will require only 4 to 6
|
|
5666
|
+
* bytes but for larger multicodec code values and larger multihash digest
|
|
5667
|
+
* lengths these varints can be quite large. It is recommended that at least
|
|
5668
|
+
* 10 bytes be made available in the `initialBytes` argument for a complete
|
|
5669
|
+
* inspection.
|
|
5670
|
+
*/
|
|
3662
5671
|
static inspectBytes(initialBytes) {
|
|
3663
5672
|
let offset = 0;
|
|
3664
5673
|
const next = () => {
|
|
3665
|
-
const [i, length2] =
|
|
5674
|
+
const [i, length2] = decode3(initialBytes.subarray(offset));
|
|
3666
5675
|
offset += length2;
|
|
3667
5676
|
return i;
|
|
3668
5677
|
};
|
|
3669
|
-
let
|
|
5678
|
+
let version = next();
|
|
3670
5679
|
let codec = DAG_PB_CODE;
|
|
3671
|
-
if (
|
|
3672
|
-
|
|
5680
|
+
if (version === 18) {
|
|
5681
|
+
version = 0;
|
|
3673
5682
|
offset = 0;
|
|
3674
|
-
} else
|
|
5683
|
+
} else {
|
|
3675
5684
|
codec = next();
|
|
3676
5685
|
}
|
|
3677
|
-
if (
|
|
3678
|
-
throw new RangeError(`Invalid CID version ${
|
|
5686
|
+
if (version !== 0 && version !== 1) {
|
|
5687
|
+
throw new RangeError(`Invalid CID version ${version}`);
|
|
3679
5688
|
}
|
|
3680
5689
|
const prefixSize = offset;
|
|
3681
5690
|
const multihashCode = next();
|
|
3682
5691
|
const digestSize = next();
|
|
3683
5692
|
const size = offset + digestSize;
|
|
3684
5693
|
const multihashSize = size - prefixSize;
|
|
3685
|
-
return {
|
|
3686
|
-
version: version2,
|
|
3687
|
-
codec,
|
|
3688
|
-
multihashCode,
|
|
3689
|
-
digestSize,
|
|
3690
|
-
multihashSize,
|
|
3691
|
-
size
|
|
3692
|
-
};
|
|
5694
|
+
return { version, codec, multihashCode, digestSize, multihashSize, size };
|
|
3693
5695
|
}
|
|
5696
|
+
/**
|
|
5697
|
+
* Takes cid in a string representation and creates an instance. If `base`
|
|
5698
|
+
* decoder is not provided will use a default from the configuration. It will
|
|
5699
|
+
* throw an error if encoding of the CID is not compatible with supplied (or
|
|
5700
|
+
* a default decoder).
|
|
5701
|
+
*/
|
|
3694
5702
|
static parse(source, base3) {
|
|
3695
5703
|
const [prefix, bytes] = parseCIDtoBytes(source, base3);
|
|
3696
5704
|
const cid = _CID.decode(bytes);
|
|
3697
|
-
cid.
|
|
5705
|
+
if (cid.version === 0 && source[0] !== "Q") {
|
|
5706
|
+
throw Error("Version 0 CID string must not include multibase prefix");
|
|
5707
|
+
}
|
|
5708
|
+
baseCache(cid).set(prefix, source);
|
|
3698
5709
|
return cid;
|
|
3699
5710
|
}
|
|
3700
5711
|
};
|
|
3701
|
-
|
|
5712
|
+
function parseCIDtoBytes(source, base3) {
|
|
3702
5713
|
switch (source[0]) {
|
|
3703
5714
|
case "Q": {
|
|
3704
|
-
const decoder = base3
|
|
5715
|
+
const decoder = base3 ?? base58btc;
|
|
3705
5716
|
return [
|
|
3706
5717
|
base58btc.prefix,
|
|
3707
5718
|
decoder.decode(`${base58btc.prefix}${source}`)
|
|
3708
5719
|
];
|
|
3709
5720
|
}
|
|
3710
5721
|
case base58btc.prefix: {
|
|
3711
|
-
const decoder = base3
|
|
3712
|
-
return [
|
|
3713
|
-
base58btc.prefix,
|
|
3714
|
-
decoder.decode(source)
|
|
3715
|
-
];
|
|
5722
|
+
const decoder = base3 ?? base58btc;
|
|
5723
|
+
return [base58btc.prefix, decoder.decode(source)];
|
|
3716
5724
|
}
|
|
3717
5725
|
case base32.prefix: {
|
|
3718
|
-
const decoder = base3
|
|
3719
|
-
return [
|
|
3720
|
-
base32.prefix,
|
|
3721
|
-
decoder.decode(source)
|
|
3722
|
-
];
|
|
5726
|
+
const decoder = base3 ?? base32;
|
|
5727
|
+
return [base32.prefix, decoder.decode(source)];
|
|
3723
5728
|
}
|
|
3724
5729
|
default: {
|
|
3725
5730
|
if (base3 == null) {
|
|
3726
5731
|
throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");
|
|
3727
5732
|
}
|
|
3728
|
-
return [
|
|
3729
|
-
source[0],
|
|
3730
|
-
base3.decode(source)
|
|
3731
|
-
];
|
|
5733
|
+
return [source[0], base3.decode(source)];
|
|
3732
5734
|
}
|
|
3733
5735
|
}
|
|
3734
|
-
}
|
|
3735
|
-
|
|
5736
|
+
}
|
|
5737
|
+
function toStringV0(bytes, cache2, base3) {
|
|
3736
5738
|
const { prefix } = base3;
|
|
3737
5739
|
if (prefix !== base58btc.prefix) {
|
|
3738
5740
|
throw Error(`Cannot string encode V0 in ${base3.name} encoding`);
|
|
3739
5741
|
}
|
|
3740
|
-
const cid =
|
|
5742
|
+
const cid = cache2.get(prefix);
|
|
3741
5743
|
if (cid == null) {
|
|
3742
5744
|
const cid2 = base3.encode(bytes).slice(1);
|
|
3743
|
-
|
|
5745
|
+
cache2.set(prefix, cid2);
|
|
3744
5746
|
return cid2;
|
|
3745
5747
|
} else {
|
|
3746
5748
|
return cid;
|
|
3747
5749
|
}
|
|
3748
|
-
}
|
|
3749
|
-
|
|
5750
|
+
}
|
|
5751
|
+
function toStringV1(bytes, cache2, base3) {
|
|
3750
5752
|
const { prefix } = base3;
|
|
3751
|
-
const cid =
|
|
5753
|
+
const cid = cache2.get(prefix);
|
|
3752
5754
|
if (cid == null) {
|
|
3753
5755
|
const cid2 = base3.encode(bytes);
|
|
3754
|
-
|
|
5756
|
+
cache2.set(prefix, cid2);
|
|
3755
5757
|
return cid2;
|
|
3756
5758
|
} else {
|
|
3757
5759
|
return cid;
|
|
3758
5760
|
}
|
|
3759
|
-
}
|
|
5761
|
+
}
|
|
3760
5762
|
var DAG_PB_CODE = 112;
|
|
3761
5763
|
var SHA_256_CODE = 18;
|
|
3762
|
-
|
|
3763
|
-
const codeOffset = encodingLength(
|
|
5764
|
+
function encodeCID(version, code, multihash) {
|
|
5765
|
+
const codeOffset = encodingLength(version);
|
|
3764
5766
|
const hashOffset = codeOffset + encodingLength(code);
|
|
3765
5767
|
const bytes = new Uint8Array(hashOffset + multihash.byteLength);
|
|
3766
|
-
encodeTo(
|
|
5768
|
+
encodeTo(version, bytes, 0);
|
|
3767
5769
|
encodeTo(code, bytes, codeOffset);
|
|
3768
5770
|
bytes.set(multihash, hashOffset);
|
|
3769
5771
|
return bytes;
|
|
3770
|
-
};
|
|
3771
|
-
var cidSymbol = Symbol.for("@ipld/js-cid/CID");
|
|
3772
|
-
var readonly = {
|
|
3773
|
-
writable: false,
|
|
3774
|
-
configurable: false,
|
|
3775
|
-
enumerable: true
|
|
3776
|
-
};
|
|
3777
|
-
var hidden = {
|
|
3778
|
-
writable: false,
|
|
3779
|
-
enumerable: false,
|
|
3780
|
-
configurable: false
|
|
3781
|
-
};
|
|
3782
|
-
var version = "0.0.0-dev";
|
|
3783
|
-
var deprecate = (range, message) => {
|
|
3784
|
-
if (range.test(version)) {
|
|
3785
|
-
console.warn(message);
|
|
3786
|
-
} else {
|
|
3787
|
-
throw new Error(message);
|
|
3788
|
-
}
|
|
3789
|
-
};
|
|
3790
|
-
var IS_CID_DEPRECATION = `CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
3791
|
-
Following code pattern:
|
|
3792
|
-
|
|
3793
|
-
if (CID.isCID(value)) {
|
|
3794
|
-
doSomethingWithCID(value)
|
|
3795
|
-
}
|
|
3796
|
-
|
|
3797
|
-
Is replaced with:
|
|
3798
|
-
|
|
3799
|
-
const cid = CID.asCID(value)
|
|
3800
|
-
if (cid) {
|
|
3801
|
-
// Make sure to use cid instead of value
|
|
3802
|
-
doSomethingWithCID(cid)
|
|
3803
5772
|
}
|
|
3804
|
-
|
|
5773
|
+
var cidSymbol = Symbol.for("@ipld/js-cid/CID");
|
|
3805
5774
|
|
|
3806
5775
|
// src/ipfs/ipfs.ts
|
|
3807
5776
|
function isCID(str) {
|