drizzle-kit 0.20.17-9f0ea64 → 0.20.17-a2979a1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +64169 -35166
- package/cli/commands/migrate.d.ts +39 -39
- package/cli/commands/mysqlIntrospect.d.ts +8 -13
- package/cli/commands/pgIntrospect.d.ts +7 -7
- package/cli/commands/sqliteIntrospect.d.ts +12 -13
- package/cli/commands/sqlitePushUtils.d.ts +2 -2
- package/cli/connections.d.ts +13 -0
- package/cli/validations/cli.d.ts +31 -31
- package/cli/validations/common.d.ts +29 -29
- package/cli/validations/mysql.d.ts +7 -13
- package/cli/validations/outputs.d.ts +1 -0
- package/cli/validations/pg.d.ts +22 -7
- package/cli/validations/sqlite.d.ts +0 -12
- package/index.d.mts +5 -5
- package/index.d.ts +5 -5
- package/package.json +4 -1
- package/payload.js +2244 -20023
- package/payload.mjs +2065 -19844
- package/schemaValidator.d.ts +215 -215
- package/serializer/mysqlSchema.d.ts +892 -892
- package/serializer/pgSchema.d.ts +734 -734
- package/serializer/sqliteSchema.d.ts +457 -457
- package/serializer/studio.d.ts +51 -0
- package/snapshotsDiffer.d.ts +314 -314
- package/utils-studio.js +1016 -3346
- package/utils-studio.mjs +989 -3319
- package/utils.d.ts +6 -0
- package/utils.js +839 -214
- package/utils.mjs +814 -189
package/utils-studio.mjs
CHANGED
@@ -34,516 +34,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
34
34
|
mod
|
35
35
|
));
|
36
36
|
|
37
|
-
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
38
|
-
function assembleStyles() {
|
39
|
-
const codes = /* @__PURE__ */ new Map();
|
40
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
41
|
-
for (const [styleName, style] of Object.entries(group)) {
|
42
|
-
styles[styleName] = {
|
43
|
-
open: `\x1B[${style[0]}m`,
|
44
|
-
close: `\x1B[${style[1]}m`
|
45
|
-
};
|
46
|
-
group[styleName] = styles[styleName];
|
47
|
-
codes.set(style[0], style[1]);
|
48
|
-
}
|
49
|
-
Object.defineProperty(styles, groupName, {
|
50
|
-
value: group,
|
51
|
-
enumerable: false
|
52
|
-
});
|
53
|
-
}
|
54
|
-
Object.defineProperty(styles, "codes", {
|
55
|
-
value: codes,
|
56
|
-
enumerable: false
|
57
|
-
});
|
58
|
-
styles.color.close = "\x1B[39m";
|
59
|
-
styles.bgColor.close = "\x1B[49m";
|
60
|
-
styles.color.ansi = wrapAnsi16();
|
61
|
-
styles.color.ansi256 = wrapAnsi256();
|
62
|
-
styles.color.ansi16m = wrapAnsi16m();
|
63
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
64
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
65
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
66
|
-
Object.defineProperties(styles, {
|
67
|
-
rgbToAnsi256: {
|
68
|
-
value(red, green, blue) {
|
69
|
-
if (red === green && green === blue) {
|
70
|
-
if (red < 8) {
|
71
|
-
return 16;
|
72
|
-
}
|
73
|
-
if (red > 248) {
|
74
|
-
return 231;
|
75
|
-
}
|
76
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
77
|
-
}
|
78
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
79
|
-
},
|
80
|
-
enumerable: false
|
81
|
-
},
|
82
|
-
hexToRgb: {
|
83
|
-
value(hex) {
|
84
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
85
|
-
if (!matches) {
|
86
|
-
return [0, 0, 0];
|
87
|
-
}
|
88
|
-
let [colorString] = matches;
|
89
|
-
if (colorString.length === 3) {
|
90
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
91
|
-
}
|
92
|
-
const integer = Number.parseInt(colorString, 16);
|
93
|
-
return [
|
94
|
-
/* eslint-disable no-bitwise */
|
95
|
-
integer >> 16 & 255,
|
96
|
-
integer >> 8 & 255,
|
97
|
-
integer & 255
|
98
|
-
/* eslint-enable no-bitwise */
|
99
|
-
];
|
100
|
-
},
|
101
|
-
enumerable: false
|
102
|
-
},
|
103
|
-
hexToAnsi256: {
|
104
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
105
|
-
enumerable: false
|
106
|
-
},
|
107
|
-
ansi256ToAnsi: {
|
108
|
-
value(code) {
|
109
|
-
if (code < 8) {
|
110
|
-
return 30 + code;
|
111
|
-
}
|
112
|
-
if (code < 16) {
|
113
|
-
return 90 + (code - 8);
|
114
|
-
}
|
115
|
-
let red;
|
116
|
-
let green;
|
117
|
-
let blue;
|
118
|
-
if (code >= 232) {
|
119
|
-
red = ((code - 232) * 10 + 8) / 255;
|
120
|
-
green = red;
|
121
|
-
blue = red;
|
122
|
-
} else {
|
123
|
-
code -= 16;
|
124
|
-
const remainder = code % 36;
|
125
|
-
red = Math.floor(code / 36) / 5;
|
126
|
-
green = Math.floor(remainder / 6) / 5;
|
127
|
-
blue = remainder % 6 / 5;
|
128
|
-
}
|
129
|
-
const value = Math.max(red, green, blue) * 2;
|
130
|
-
if (value === 0) {
|
131
|
-
return 30;
|
132
|
-
}
|
133
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
134
|
-
if (value === 2) {
|
135
|
-
result += 60;
|
136
|
-
}
|
137
|
-
return result;
|
138
|
-
},
|
139
|
-
enumerable: false
|
140
|
-
},
|
141
|
-
rgbToAnsi: {
|
142
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
143
|
-
enumerable: false
|
144
|
-
},
|
145
|
-
hexToAnsi: {
|
146
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
147
|
-
enumerable: false
|
148
|
-
}
|
149
|
-
});
|
150
|
-
return styles;
|
151
|
-
}
|
152
|
-
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
153
|
-
var init_ansi_styles = __esm({
|
154
|
-
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
155
|
-
ANSI_BACKGROUND_OFFSET = 10;
|
156
|
-
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
157
|
-
wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
158
|
-
wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
159
|
-
styles = {
|
160
|
-
modifier: {
|
161
|
-
reset: [0, 0],
|
162
|
-
// 21 isn't widely supported and 22 does the same thing
|
163
|
-
bold: [1, 22],
|
164
|
-
dim: [2, 22],
|
165
|
-
italic: [3, 23],
|
166
|
-
underline: [4, 24],
|
167
|
-
overline: [53, 55],
|
168
|
-
inverse: [7, 27],
|
169
|
-
hidden: [8, 28],
|
170
|
-
strikethrough: [9, 29]
|
171
|
-
},
|
172
|
-
color: {
|
173
|
-
black: [30, 39],
|
174
|
-
red: [31, 39],
|
175
|
-
green: [32, 39],
|
176
|
-
yellow: [33, 39],
|
177
|
-
blue: [34, 39],
|
178
|
-
magenta: [35, 39],
|
179
|
-
cyan: [36, 39],
|
180
|
-
white: [37, 39],
|
181
|
-
// Bright color
|
182
|
-
blackBright: [90, 39],
|
183
|
-
gray: [90, 39],
|
184
|
-
// Alias of `blackBright`
|
185
|
-
grey: [90, 39],
|
186
|
-
// Alias of `blackBright`
|
187
|
-
redBright: [91, 39],
|
188
|
-
greenBright: [92, 39],
|
189
|
-
yellowBright: [93, 39],
|
190
|
-
blueBright: [94, 39],
|
191
|
-
magentaBright: [95, 39],
|
192
|
-
cyanBright: [96, 39],
|
193
|
-
whiteBright: [97, 39]
|
194
|
-
},
|
195
|
-
bgColor: {
|
196
|
-
bgBlack: [40, 49],
|
197
|
-
bgRed: [41, 49],
|
198
|
-
bgGreen: [42, 49],
|
199
|
-
bgYellow: [43, 49],
|
200
|
-
bgBlue: [44, 49],
|
201
|
-
bgMagenta: [45, 49],
|
202
|
-
bgCyan: [46, 49],
|
203
|
-
bgWhite: [47, 49],
|
204
|
-
// Bright color
|
205
|
-
bgBlackBright: [100, 49],
|
206
|
-
bgGray: [100, 49],
|
207
|
-
// Alias of `bgBlackBright`
|
208
|
-
bgGrey: [100, 49],
|
209
|
-
// Alias of `bgBlackBright`
|
210
|
-
bgRedBright: [101, 49],
|
211
|
-
bgGreenBright: [102, 49],
|
212
|
-
bgYellowBright: [103, 49],
|
213
|
-
bgBlueBright: [104, 49],
|
214
|
-
bgMagentaBright: [105, 49],
|
215
|
-
bgCyanBright: [106, 49],
|
216
|
-
bgWhiteBright: [107, 49]
|
217
|
-
}
|
218
|
-
};
|
219
|
-
modifierNames = Object.keys(styles.modifier);
|
220
|
-
foregroundColorNames = Object.keys(styles.color);
|
221
|
-
backgroundColorNames = Object.keys(styles.bgColor);
|
222
|
-
colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
223
|
-
ansiStyles = assembleStyles();
|
224
|
-
ansi_styles_default = ansiStyles;
|
225
|
-
}
|
226
|
-
});
|
227
|
-
|
228
|
-
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js
|
229
|
-
import process2 from "node:process";
|
230
|
-
import os from "node:os";
|
231
|
-
import tty from "node:tty";
|
232
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
233
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
234
|
-
const position = argv.indexOf(prefix + flag);
|
235
|
-
const terminatorPosition = argv.indexOf("--");
|
236
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
237
|
-
}
|
238
|
-
function envForceColor() {
|
239
|
-
if ("FORCE_COLOR" in env) {
|
240
|
-
if (env.FORCE_COLOR === "true") {
|
241
|
-
return 1;
|
242
|
-
}
|
243
|
-
if (env.FORCE_COLOR === "false") {
|
244
|
-
return 0;
|
245
|
-
}
|
246
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
247
|
-
}
|
248
|
-
}
|
249
|
-
function translateLevel(level) {
|
250
|
-
if (level === 0) {
|
251
|
-
return false;
|
252
|
-
}
|
253
|
-
return {
|
254
|
-
level,
|
255
|
-
hasBasic: true,
|
256
|
-
has256: level >= 2,
|
257
|
-
has16m: level >= 3
|
258
|
-
};
|
259
|
-
}
|
260
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
261
|
-
const noFlagForceColor = envForceColor();
|
262
|
-
if (noFlagForceColor !== void 0) {
|
263
|
-
flagForceColor = noFlagForceColor;
|
264
|
-
}
|
265
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
266
|
-
if (forceColor === 0) {
|
267
|
-
return 0;
|
268
|
-
}
|
269
|
-
if (sniffFlags) {
|
270
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
271
|
-
return 3;
|
272
|
-
}
|
273
|
-
if (hasFlag("color=256")) {
|
274
|
-
return 2;
|
275
|
-
}
|
276
|
-
}
|
277
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
278
|
-
return 1;
|
279
|
-
}
|
280
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
281
|
-
return 0;
|
282
|
-
}
|
283
|
-
const min = forceColor || 0;
|
284
|
-
if (env.TERM === "dumb") {
|
285
|
-
return min;
|
286
|
-
}
|
287
|
-
if (process2.platform === "win32") {
|
288
|
-
const osRelease = os.release().split(".");
|
289
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
290
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
291
|
-
}
|
292
|
-
return 1;
|
293
|
-
}
|
294
|
-
if ("CI" in env) {
|
295
|
-
if ("GITHUB_ACTIONS" in env) {
|
296
|
-
return 3;
|
297
|
-
}
|
298
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
299
|
-
return 1;
|
300
|
-
}
|
301
|
-
return min;
|
302
|
-
}
|
303
|
-
if ("TEAMCITY_VERSION" in env) {
|
304
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
305
|
-
}
|
306
|
-
if (env.COLORTERM === "truecolor") {
|
307
|
-
return 3;
|
308
|
-
}
|
309
|
-
if (env.TERM === "xterm-kitty") {
|
310
|
-
return 3;
|
311
|
-
}
|
312
|
-
if ("TERM_PROGRAM" in env) {
|
313
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
314
|
-
switch (env.TERM_PROGRAM) {
|
315
|
-
case "iTerm.app": {
|
316
|
-
return version >= 3 ? 3 : 2;
|
317
|
-
}
|
318
|
-
case "Apple_Terminal": {
|
319
|
-
return 2;
|
320
|
-
}
|
321
|
-
}
|
322
|
-
}
|
323
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
324
|
-
return 2;
|
325
|
-
}
|
326
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
327
|
-
return 1;
|
328
|
-
}
|
329
|
-
if ("COLORTERM" in env) {
|
330
|
-
return 1;
|
331
|
-
}
|
332
|
-
return min;
|
333
|
-
}
|
334
|
-
function createSupportsColor(stream, options = {}) {
|
335
|
-
const level = _supportsColor(stream, {
|
336
|
-
streamIsTTY: stream && stream.isTTY,
|
337
|
-
...options
|
338
|
-
});
|
339
|
-
return translateLevel(level);
|
340
|
-
}
|
341
|
-
var env, flagForceColor, supportsColor, supports_color_default;
|
342
|
-
var init_supports_color = __esm({
|
343
|
-
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
344
|
-
({ env } = process2);
|
345
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
346
|
-
flagForceColor = 0;
|
347
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
348
|
-
flagForceColor = 1;
|
349
|
-
}
|
350
|
-
supportsColor = {
|
351
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
352
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
353
|
-
};
|
354
|
-
supports_color_default = supportsColor;
|
355
|
-
}
|
356
|
-
});
|
357
|
-
|
358
|
-
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js
|
359
|
-
function stringReplaceAll(string, substring, replacer) {
|
360
|
-
let index4 = string.indexOf(substring);
|
361
|
-
if (index4 === -1) {
|
362
|
-
return string;
|
363
|
-
}
|
364
|
-
const substringLength = substring.length;
|
365
|
-
let endIndex = 0;
|
366
|
-
let returnValue = "";
|
367
|
-
do {
|
368
|
-
returnValue += string.slice(endIndex, index4) + substring + replacer;
|
369
|
-
endIndex = index4 + substringLength;
|
370
|
-
index4 = string.indexOf(substring, endIndex);
|
371
|
-
} while (index4 !== -1);
|
372
|
-
returnValue += string.slice(endIndex);
|
373
|
-
return returnValue;
|
374
|
-
}
|
375
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
|
376
|
-
let endIndex = 0;
|
377
|
-
let returnValue = "";
|
378
|
-
do {
|
379
|
-
const gotCR = string[index4 - 1] === "\r";
|
380
|
-
returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
381
|
-
endIndex = index4 + 1;
|
382
|
-
index4 = string.indexOf("\n", endIndex);
|
383
|
-
} while (index4 !== -1);
|
384
|
-
returnValue += string.slice(endIndex);
|
385
|
-
return returnValue;
|
386
|
-
}
|
387
|
-
var init_utilities = __esm({
|
388
|
-
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js"() {
|
389
|
-
}
|
390
|
-
});
|
391
|
-
|
392
|
-
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js
|
393
|
-
function createChalk(options) {
|
394
|
-
return chalkFactory(options);
|
395
|
-
}
|
396
|
-
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr;
|
397
|
-
var init_source = __esm({
|
398
|
-
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js"() {
|
399
|
-
init_ansi_styles();
|
400
|
-
init_supports_color();
|
401
|
-
init_utilities();
|
402
|
-
init_ansi_styles();
|
403
|
-
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
404
|
-
GENERATOR = Symbol("GENERATOR");
|
405
|
-
STYLER = Symbol("STYLER");
|
406
|
-
IS_EMPTY = Symbol("IS_EMPTY");
|
407
|
-
levelMapping = [
|
408
|
-
"ansi",
|
409
|
-
"ansi",
|
410
|
-
"ansi256",
|
411
|
-
"ansi16m"
|
412
|
-
];
|
413
|
-
styles2 = /* @__PURE__ */ Object.create(null);
|
414
|
-
applyOptions = (object, options = {}) => {
|
415
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
416
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
417
|
-
}
|
418
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
419
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
420
|
-
};
|
421
|
-
chalkFactory = (options) => {
|
422
|
-
const chalk2 = (...strings) => strings.join(" ");
|
423
|
-
applyOptions(chalk2, options);
|
424
|
-
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
425
|
-
return chalk2;
|
426
|
-
};
|
427
|
-
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
428
|
-
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
429
|
-
styles2[styleName] = {
|
430
|
-
get() {
|
431
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
432
|
-
Object.defineProperty(this, styleName, { value: builder });
|
433
|
-
return builder;
|
434
|
-
}
|
435
|
-
};
|
436
|
-
}
|
437
|
-
styles2.visible = {
|
438
|
-
get() {
|
439
|
-
const builder = createBuilder(this, this[STYLER], true);
|
440
|
-
Object.defineProperty(this, "visible", { value: builder });
|
441
|
-
return builder;
|
442
|
-
}
|
443
|
-
};
|
444
|
-
getModelAnsi = (model, level, type, ...arguments_) => {
|
445
|
-
if (model === "rgb") {
|
446
|
-
if (level === "ansi16m") {
|
447
|
-
return ansi_styles_default[type].ansi16m(...arguments_);
|
448
|
-
}
|
449
|
-
if (level === "ansi256") {
|
450
|
-
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
451
|
-
}
|
452
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
453
|
-
}
|
454
|
-
if (model === "hex") {
|
455
|
-
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
456
|
-
}
|
457
|
-
return ansi_styles_default[type][model](...arguments_);
|
458
|
-
};
|
459
|
-
usedModels = ["rgb", "hex", "ansi256"];
|
460
|
-
for (const model of usedModels) {
|
461
|
-
styles2[model] = {
|
462
|
-
get() {
|
463
|
-
const { level } = this;
|
464
|
-
return function(...arguments_) {
|
465
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
466
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
467
|
-
};
|
468
|
-
}
|
469
|
-
};
|
470
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
471
|
-
styles2[bgModel] = {
|
472
|
-
get() {
|
473
|
-
const { level } = this;
|
474
|
-
return function(...arguments_) {
|
475
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
476
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
477
|
-
};
|
478
|
-
}
|
479
|
-
};
|
480
|
-
}
|
481
|
-
proto = Object.defineProperties(() => {
|
482
|
-
}, {
|
483
|
-
...styles2,
|
484
|
-
level: {
|
485
|
-
enumerable: true,
|
486
|
-
get() {
|
487
|
-
return this[GENERATOR].level;
|
488
|
-
},
|
489
|
-
set(level) {
|
490
|
-
this[GENERATOR].level = level;
|
491
|
-
}
|
492
|
-
}
|
493
|
-
});
|
494
|
-
createStyler = (open, close, parent) => {
|
495
|
-
let openAll;
|
496
|
-
let closeAll;
|
497
|
-
if (parent === void 0) {
|
498
|
-
openAll = open;
|
499
|
-
closeAll = close;
|
500
|
-
} else {
|
501
|
-
openAll = parent.openAll + open;
|
502
|
-
closeAll = close + parent.closeAll;
|
503
|
-
}
|
504
|
-
return {
|
505
|
-
open,
|
506
|
-
close,
|
507
|
-
openAll,
|
508
|
-
closeAll,
|
509
|
-
parent
|
510
|
-
};
|
511
|
-
};
|
512
|
-
createBuilder = (self2, _styler, _isEmpty) => {
|
513
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
514
|
-
Object.setPrototypeOf(builder, proto);
|
515
|
-
builder[GENERATOR] = self2;
|
516
|
-
builder[STYLER] = _styler;
|
517
|
-
builder[IS_EMPTY] = _isEmpty;
|
518
|
-
return builder;
|
519
|
-
};
|
520
|
-
applyStyle = (self2, string) => {
|
521
|
-
if (self2.level <= 0 || !string) {
|
522
|
-
return self2[IS_EMPTY] ? "" : string;
|
523
|
-
}
|
524
|
-
let styler = self2[STYLER];
|
525
|
-
if (styler === void 0) {
|
526
|
-
return string;
|
527
|
-
}
|
528
|
-
const { openAll, closeAll } = styler;
|
529
|
-
if (string.includes("\x1B")) {
|
530
|
-
while (styler !== void 0) {
|
531
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
532
|
-
styler = styler.parent;
|
533
|
-
}
|
534
|
-
}
|
535
|
-
const lfIndex = string.indexOf("\n");
|
536
|
-
if (lfIndex !== -1) {
|
537
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
538
|
-
}
|
539
|
-
return openAll + string + closeAll;
|
540
|
-
};
|
541
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
542
|
-
chalk = createChalk();
|
543
|
-
chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
544
|
-
}
|
545
|
-
});
|
546
|
-
|
547
37
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js
|
548
38
|
var require_readline = __commonJS({
|
549
39
|
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(exports) {
|
@@ -1084,11 +574,12 @@ var init_global = __esm({
|
|
1084
574
|
}
|
1085
575
|
});
|
1086
576
|
|
1087
|
-
// node_modules/.pnpm/zod@3.
|
577
|
+
// node_modules/.pnpm/zod@3.23.4/node_modules/zod/lib/index.mjs
|
1088
578
|
function getErrorMap() {
|
1089
579
|
return overrideErrorMap;
|
1090
580
|
}
|
1091
581
|
function addIssueToContext(ctx, issueData) {
|
582
|
+
const overrideMap = getErrorMap();
|
1092
583
|
const issue = makeIssue({
|
1093
584
|
issueData,
|
1094
585
|
data: ctx.data,
|
@@ -1096,13 +587,29 @@ function addIssueToContext(ctx, issueData) {
|
|
1096
587
|
errorMaps: [
|
1097
588
|
ctx.common.contextualErrorMap,
|
1098
589
|
ctx.schemaErrorMap,
|
1099
|
-
|
1100
|
-
errorMap
|
590
|
+
overrideMap,
|
591
|
+
overrideMap === errorMap ? void 0 : errorMap
|
1101
592
|
// then global default map
|
1102
593
|
].filter((x) => !!x)
|
1103
594
|
});
|
1104
595
|
ctx.common.issues.push(issue);
|
1105
596
|
}
|
597
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
598
|
+
if (kind === "a" && !f)
|
599
|
+
throw new TypeError("Private accessor was defined without a getter");
|
600
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
601
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
602
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
603
|
+
}
|
604
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
605
|
+
if (kind === "m")
|
606
|
+
throw new TypeError("Private method is not writable");
|
607
|
+
if (kind === "a" && !f)
|
608
|
+
throw new TypeError("Private accessor was defined without a setter");
|
609
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
610
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
611
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
612
|
+
}
|
1106
613
|
function processCreateParams(params) {
|
1107
614
|
if (!params)
|
1108
615
|
return {};
|
@@ -1113,15 +620,50 @@ function processCreateParams(params) {
|
|
1113
620
|
if (errorMap2)
|
1114
621
|
return { errorMap: errorMap2, description };
|
1115
622
|
const customMap = (iss, ctx) => {
|
1116
|
-
|
1117
|
-
|
623
|
+
var _a, _b;
|
624
|
+
const { message } = params;
|
625
|
+
if (iss.code === "invalid_enum_value") {
|
626
|
+
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
627
|
+
}
|
1118
628
|
if (typeof ctx.data === "undefined") {
|
1119
|
-
return { message:
|
629
|
+
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
1120
630
|
}
|
1121
|
-
|
631
|
+
if (iss.code !== "invalid_type")
|
632
|
+
return { message: ctx.defaultError };
|
633
|
+
return { message: (_b = message !== null && message !== void 0 ? message : invalid_type_error) !== null && _b !== void 0 ? _b : ctx.defaultError };
|
1122
634
|
};
|
1123
635
|
return { errorMap: customMap, description };
|
1124
636
|
}
|
637
|
+
function timeRegexSource(args) {
|
638
|
+
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
639
|
+
if (args.precision) {
|
640
|
+
regex = `${regex}\\.\\d{${args.precision}}`;
|
641
|
+
} else if (args.precision == null) {
|
642
|
+
regex = `${regex}(\\.\\d+)?`;
|
643
|
+
}
|
644
|
+
return regex;
|
645
|
+
}
|
646
|
+
function timeRegex(args) {
|
647
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
648
|
+
}
|
649
|
+
function datetimeRegex(args) {
|
650
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
651
|
+
const opts = [];
|
652
|
+
opts.push(args.local ? `Z?` : `Z`);
|
653
|
+
if (args.offset)
|
654
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
655
|
+
regex = `${regex}(${opts.join("|")})`;
|
656
|
+
return new RegExp(`^${regex}$`);
|
657
|
+
}
|
658
|
+
function isValidIP(ip, version) {
|
659
|
+
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
660
|
+
return true;
|
661
|
+
}
|
662
|
+
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
|
663
|
+
return true;
|
664
|
+
}
|
665
|
+
return false;
|
666
|
+
}
|
1125
667
|
function floatSafeRemainder(val, step) {
|
1126
668
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
1127
669
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
@@ -1142,7 +684,10 @@ function deepPartialify(schema3) {
|
|
1142
684
|
shape: () => newShape
|
1143
685
|
});
|
1144
686
|
} else if (schema3 instanceof ZodArray) {
|
1145
|
-
return ZodArray
|
687
|
+
return new ZodArray({
|
688
|
+
...schema3._def,
|
689
|
+
type: deepPartialify(schema3.element)
|
690
|
+
});
|
1146
691
|
} else if (schema3 instanceof ZodOptional) {
|
1147
692
|
return ZodOptional.create(deepPartialify(schema3.unwrap()));
|
1148
693
|
} else if (schema3 instanceof ZodNullable) {
|
@@ -1198,9 +743,9 @@ function createZodEnum(values, params) {
|
|
1198
743
|
...processCreateParams(params)
|
1199
744
|
});
|
1200
745
|
}
|
1201
|
-
var util, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, uuidRegex, emailRegex,
|
746
|
+
var util, objectUtil, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, _ZodEnum_cache, _ZodNativeEnum_cache, ParseInputLazyPath, handleResult, ZodType, cuidRegex, cuid2Regex, ulidRegex, uuidRegex, nanoidRegex, durationRegex, emailRegex, _emojiRegex, emojiRegex, ipv4Regex, ipv6Regex, base64Regex, dateRegexSource, dateRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, ZodReadonly, late, ZodFirstPartyTypeKind, stringType, numberType, nanType, bigIntType, booleanType, dateType, symbolType, undefinedType, nullType, anyType, unknownType, neverType, voidType, arrayType, objectType, strictObjectType, unionType, discriminatedUnionType, intersectionType, tupleType, recordType, mapType, setType, functionType, lazyType, literalType, enumType, nativeEnumType, promiseType, effectsType, optionalType, nullableType, preprocessType, pipelineType;
|
1202
747
|
var init_lib = __esm({
|
1203
|
-
"node_modules/.pnpm/zod@3.
|
748
|
+
"node_modules/.pnpm/zod@3.23.4/node_modules/zod/lib/index.mjs"() {
|
1204
749
|
(function(util2) {
|
1205
750
|
util2.assertEqual = (val) => val;
|
1206
751
|
function assertIs(_arg) {
|
@@ -1258,6 +803,15 @@ var init_lib = __esm({
|
|
1258
803
|
return value;
|
1259
804
|
};
|
1260
805
|
})(util || (util = {}));
|
806
|
+
(function(objectUtil2) {
|
807
|
+
objectUtil2.mergeShapes = (first, second) => {
|
808
|
+
return {
|
809
|
+
...first,
|
810
|
+
...second
|
811
|
+
// second overwrites first
|
812
|
+
};
|
813
|
+
};
|
814
|
+
})(objectUtil || (objectUtil = {}));
|
1261
815
|
ZodParsedType = util.arrayToEnum([
|
1262
816
|
"string",
|
1263
817
|
"nan",
|
@@ -1339,7 +893,7 @@ var init_lib = __esm({
|
|
1339
893
|
"not_multiple_of",
|
1340
894
|
"not_finite"
|
1341
895
|
]);
|
1342
|
-
ZodError = class extends Error {
|
896
|
+
ZodError = class _ZodError extends Error {
|
1343
897
|
constructor(issues) {
|
1344
898
|
super();
|
1345
899
|
this.issues = [];
|
@@ -1397,6 +951,11 @@ var init_lib = __esm({
|
|
1397
951
|
processError(this);
|
1398
952
|
return fieldErrors;
|
1399
953
|
}
|
954
|
+
static assert(value) {
|
955
|
+
if (!(value instanceof _ZodError)) {
|
956
|
+
throw new Error(`Not a ZodError: ${value}`);
|
957
|
+
}
|
958
|
+
}
|
1400
959
|
toString() {
|
1401
960
|
return this.message;
|
1402
961
|
}
|
@@ -1463,7 +1022,12 @@ var init_lib = __esm({
|
|
1463
1022
|
break;
|
1464
1023
|
case ZodIssueCode.invalid_string:
|
1465
1024
|
if (typeof issue.validation === "object") {
|
1466
|
-
if ("
|
1025
|
+
if ("includes" in issue.validation) {
|
1026
|
+
message = `Invalid input: must include "${issue.validation.includes}"`;
|
1027
|
+
if (typeof issue.validation.position === "number") {
|
1028
|
+
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
1029
|
+
}
|
1030
|
+
} else if ("startsWith" in issue.validation) {
|
1467
1031
|
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
1468
1032
|
} else if ("endsWith" in issue.validation) {
|
1469
1033
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
@@ -1484,7 +1048,7 @@ var init_lib = __esm({
|
|
1484
1048
|
else if (issue.type === "number")
|
1485
1049
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
1486
1050
|
else if (issue.type === "date")
|
1487
|
-
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
|
1051
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
|
1488
1052
|
else
|
1489
1053
|
message = "Invalid input";
|
1490
1054
|
break;
|
@@ -1495,8 +1059,10 @@ var init_lib = __esm({
|
|
1495
1059
|
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
1496
1060
|
else if (issue.type === "number")
|
1497
1061
|
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
1062
|
+
else if (issue.type === "bigint")
|
1063
|
+
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
1498
1064
|
else if (issue.type === "date")
|
1499
|
-
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
|
1065
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
|
1500
1066
|
else
|
1501
1067
|
message = "Invalid input";
|
1502
1068
|
break;
|
@@ -1526,6 +1092,13 @@ var init_lib = __esm({
|
|
1526
1092
|
...issueData,
|
1527
1093
|
path: fullPath
|
1528
1094
|
};
|
1095
|
+
if (issueData.message !== void 0) {
|
1096
|
+
return {
|
1097
|
+
...issueData,
|
1098
|
+
path: fullPath,
|
1099
|
+
message: issueData.message
|
1100
|
+
};
|
1101
|
+
}
|
1529
1102
|
let errorMessage = "";
|
1530
1103
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
1531
1104
|
for (const map of maps) {
|
@@ -1534,7 +1107,7 @@ var init_lib = __esm({
|
|
1534
1107
|
return {
|
1535
1108
|
...issueData,
|
1536
1109
|
path: fullPath,
|
1537
|
-
message:
|
1110
|
+
message: errorMessage
|
1538
1111
|
};
|
1539
1112
|
};
|
1540
1113
|
ParseStatus = class _ParseStatus {
|
@@ -1563,9 +1136,11 @@ var init_lib = __esm({
|
|
1563
1136
|
static async mergeObjectAsync(status, pairs) {
|
1564
1137
|
const syncPairs = [];
|
1565
1138
|
for (const pair of pairs) {
|
1139
|
+
const key = await pair.key;
|
1140
|
+
const value = await pair.value;
|
1566
1141
|
syncPairs.push({
|
1567
|
-
key
|
1568
|
-
value
|
1142
|
+
key,
|
1143
|
+
value
|
1569
1144
|
});
|
1570
1145
|
}
|
1571
1146
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
@@ -1582,7 +1157,7 @@ var init_lib = __esm({
|
|
1582
1157
|
status.dirty();
|
1583
1158
|
if (value.status === "dirty")
|
1584
1159
|
status.dirty();
|
1585
|
-
if (typeof value.value !== "undefined" || pair.alwaysSet) {
|
1160
|
+
if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
1586
1161
|
finalObject[key.value] = value.value;
|
1587
1162
|
}
|
1588
1163
|
}
|
@@ -1597,20 +1172,28 @@ var init_lib = __esm({
|
|
1597
1172
|
isAborted = (x) => x.status === "aborted";
|
1598
1173
|
isDirty = (x) => x.status === "dirty";
|
1599
1174
|
isValid = (x) => x.status === "valid";
|
1600
|
-
isAsync = (x) => typeof Promise !==
|
1175
|
+
isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
1601
1176
|
(function(errorUtil2) {
|
1602
1177
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
1603
1178
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
1604
1179
|
})(errorUtil || (errorUtil = {}));
|
1605
1180
|
ParseInputLazyPath = class {
|
1606
1181
|
constructor(parent, value, path2, key) {
|
1182
|
+
this._cachedPath = [];
|
1607
1183
|
this.parent = parent;
|
1608
1184
|
this.data = value;
|
1609
1185
|
this._path = path2;
|
1610
1186
|
this._key = key;
|
1611
1187
|
}
|
1612
1188
|
get path() {
|
1613
|
-
|
1189
|
+
if (!this._cachedPath.length) {
|
1190
|
+
if (this._key instanceof Array) {
|
1191
|
+
this._cachedPath.push(...this._path, ...this._key);
|
1192
|
+
} else {
|
1193
|
+
this._cachedPath.push(...this._path, this._key);
|
1194
|
+
}
|
1195
|
+
}
|
1196
|
+
return this._cachedPath;
|
1614
1197
|
}
|
1615
1198
|
};
|
1616
1199
|
handleResult = (ctx, result) => {
|
@@ -1620,8 +1203,16 @@ var init_lib = __esm({
|
|
1620
1203
|
if (!ctx.common.issues.length) {
|
1621
1204
|
throw new Error("Validation failed but no issues detected.");
|
1622
1205
|
}
|
1623
|
-
|
1624
|
-
|
1206
|
+
return {
|
1207
|
+
success: false,
|
1208
|
+
get error() {
|
1209
|
+
if (this._error)
|
1210
|
+
return this._error;
|
1211
|
+
const error2 = new ZodError(ctx.common.issues);
|
1212
|
+
this._error = error2;
|
1213
|
+
return this._error;
|
1214
|
+
}
|
1215
|
+
};
|
1625
1216
|
}
|
1626
1217
|
};
|
1627
1218
|
ZodType = class {
|
@@ -1649,6 +1240,7 @@ var init_lib = __esm({
|
|
1649
1240
|
this.catch = this.catch.bind(this);
|
1650
1241
|
this.describe = this.describe.bind(this);
|
1651
1242
|
this.pipe = this.pipe.bind(this);
|
1243
|
+
this.readonly = this.readonly.bind(this);
|
1652
1244
|
this.isNullable = this.isNullable.bind(this);
|
1653
1245
|
this.isOptional = this.isOptional.bind(this);
|
1654
1246
|
}
|
@@ -1793,28 +1385,29 @@ var init_lib = __esm({
|
|
1793
1385
|
return this._refinement(refinement);
|
1794
1386
|
}
|
1795
1387
|
optional() {
|
1796
|
-
return ZodOptional.create(this);
|
1388
|
+
return ZodOptional.create(this, this._def);
|
1797
1389
|
}
|
1798
1390
|
nullable() {
|
1799
|
-
return ZodNullable.create(this);
|
1391
|
+
return ZodNullable.create(this, this._def);
|
1800
1392
|
}
|
1801
1393
|
nullish() {
|
1802
|
-
return this.
|
1394
|
+
return this.nullable().optional();
|
1803
1395
|
}
|
1804
1396
|
array() {
|
1805
|
-
return ZodArray.create(this);
|
1397
|
+
return ZodArray.create(this, this._def);
|
1806
1398
|
}
|
1807
1399
|
promise() {
|
1808
|
-
return ZodPromise.create(this);
|
1400
|
+
return ZodPromise.create(this, this._def);
|
1809
1401
|
}
|
1810
1402
|
or(option) {
|
1811
|
-
return ZodUnion.create([this, option]);
|
1403
|
+
return ZodUnion.create([this, option], this._def);
|
1812
1404
|
}
|
1813
1405
|
and(incoming) {
|
1814
|
-
return ZodIntersection.create(this, incoming);
|
1406
|
+
return ZodIntersection.create(this, incoming, this._def);
|
1815
1407
|
}
|
1816
1408
|
transform(transform) {
|
1817
1409
|
return new ZodEffects({
|
1410
|
+
...processCreateParams(this._def),
|
1818
1411
|
schema: this,
|
1819
1412
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
1820
1413
|
effect: { type: "transform", transform }
|
@@ -1823,6 +1416,7 @@ var init_lib = __esm({
|
|
1823
1416
|
default(def) {
|
1824
1417
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
1825
1418
|
return new ZodDefault({
|
1419
|
+
...processCreateParams(this._def),
|
1826
1420
|
innerType: this,
|
1827
1421
|
defaultValue: defaultValueFunc,
|
1828
1422
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
@@ -1832,14 +1426,15 @@ var init_lib = __esm({
|
|
1832
1426
|
return new ZodBranded({
|
1833
1427
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
1834
1428
|
type: this,
|
1835
|
-
...processCreateParams(
|
1429
|
+
...processCreateParams(this._def)
|
1836
1430
|
});
|
1837
1431
|
}
|
1838
1432
|
catch(def) {
|
1839
|
-
const
|
1433
|
+
const catchValueFunc = typeof def === "function" ? def : () => def;
|
1840
1434
|
return new ZodCatch({
|
1435
|
+
...processCreateParams(this._def),
|
1841
1436
|
innerType: this,
|
1842
|
-
|
1437
|
+
catchValue: catchValueFunc,
|
1843
1438
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
1844
1439
|
});
|
1845
1440
|
}
|
@@ -1853,6 +1448,9 @@ var init_lib = __esm({
|
|
1853
1448
|
pipe(target) {
|
1854
1449
|
return ZodPipeline.create(this, target);
|
1855
1450
|
}
|
1451
|
+
readonly() {
|
1452
|
+
return ZodReadonly.create(this);
|
1453
|
+
}
|
1856
1454
|
isOptional() {
|
1857
1455
|
return this.safeParse(void 0).success;
|
1858
1456
|
}
|
@@ -1861,43 +1459,19 @@ var init_lib = __esm({
|
|
1861
1459
|
}
|
1862
1460
|
};
|
1863
1461
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
} else {
|
1877
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
1878
|
-
}
|
1879
|
-
} else {
|
1880
|
-
if (args.offset) {
|
1881
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
1882
|
-
} else {
|
1883
|
-
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
1884
|
-
}
|
1885
|
-
}
|
1886
|
-
};
|
1462
|
+
cuid2Regex = /^[0-9a-z]+$/;
|
1463
|
+
ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/;
|
1464
|
+
uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
1465
|
+
nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
1466
|
+
durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
1467
|
+
emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
1468
|
+
_emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
1469
|
+
ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
1470
|
+
ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
|
1471
|
+
base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
1472
|
+
dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
1473
|
+
dateRegex = new RegExp(`^${dateRegexSource}$`);
|
1887
1474
|
ZodString = class _ZodString extends ZodType {
|
1888
|
-
constructor() {
|
1889
|
-
super(...arguments);
|
1890
|
-
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
1891
|
-
validation,
|
1892
|
-
code: ZodIssueCode.invalid_string,
|
1893
|
-
...errorUtil.errToObj(message)
|
1894
|
-
});
|
1895
|
-
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
1896
|
-
this.trim = () => new _ZodString({
|
1897
|
-
...this._def,
|
1898
|
-
checks: [...this._def.checks, { kind: "trim" }]
|
1899
|
-
});
|
1900
|
-
}
|
1901
1475
|
_parse(input) {
|
1902
1476
|
if (this._def.coerce) {
|
1903
1477
|
input.data = String(input.data);
|
@@ -1905,15 +1479,11 @@ var init_lib = __esm({
|
|
1905
1479
|
const parsedType = this._getType(input);
|
1906
1480
|
if (parsedType !== ZodParsedType.string) {
|
1907
1481
|
const ctx2 = this._getOrReturnCtx(input);
|
1908
|
-
addIssueToContext(
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1913
|
-
received: ctx2.parsedType
|
1914
|
-
}
|
1915
|
-
//
|
1916
|
-
);
|
1482
|
+
addIssueToContext(ctx2, {
|
1483
|
+
code: ZodIssueCode.invalid_type,
|
1484
|
+
expected: ZodParsedType.string,
|
1485
|
+
received: ctx2.parsedType
|
1486
|
+
});
|
1917
1487
|
return INVALID;
|
1918
1488
|
}
|
1919
1489
|
const status = new ParseStatus();
|
@@ -1981,6 +1551,19 @@ var init_lib = __esm({
|
|
1981
1551
|
});
|
1982
1552
|
status.dirty();
|
1983
1553
|
}
|
1554
|
+
} else if (check.kind === "emoji") {
|
1555
|
+
if (!emojiRegex) {
|
1556
|
+
emojiRegex = new RegExp(_emojiRegex, "u");
|
1557
|
+
}
|
1558
|
+
if (!emojiRegex.test(input.data)) {
|
1559
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1560
|
+
addIssueToContext(ctx, {
|
1561
|
+
validation: "emoji",
|
1562
|
+
code: ZodIssueCode.invalid_string,
|
1563
|
+
message: check.message
|
1564
|
+
});
|
1565
|
+
status.dirty();
|
1566
|
+
}
|
1984
1567
|
} else if (check.kind === "uuid") {
|
1985
1568
|
if (!uuidRegex.test(input.data)) {
|
1986
1569
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1991,6 +1574,16 @@ var init_lib = __esm({
|
|
1991
1574
|
});
|
1992
1575
|
status.dirty();
|
1993
1576
|
}
|
1577
|
+
} else if (check.kind === "nanoid") {
|
1578
|
+
if (!nanoidRegex.test(input.data)) {
|
1579
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1580
|
+
addIssueToContext(ctx, {
|
1581
|
+
validation: "nanoid",
|
1582
|
+
code: ZodIssueCode.invalid_string,
|
1583
|
+
message: check.message
|
1584
|
+
});
|
1585
|
+
status.dirty();
|
1586
|
+
}
|
1994
1587
|
} else if (check.kind === "cuid") {
|
1995
1588
|
if (!cuidRegex.test(input.data)) {
|
1996
1589
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -2001,6 +1594,26 @@ var init_lib = __esm({
|
|
2001
1594
|
});
|
2002
1595
|
status.dirty();
|
2003
1596
|
}
|
1597
|
+
} else if (check.kind === "cuid2") {
|
1598
|
+
if (!cuid2Regex.test(input.data)) {
|
1599
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1600
|
+
addIssueToContext(ctx, {
|
1601
|
+
validation: "cuid2",
|
1602
|
+
code: ZodIssueCode.invalid_string,
|
1603
|
+
message: check.message
|
1604
|
+
});
|
1605
|
+
status.dirty();
|
1606
|
+
}
|
1607
|
+
} else if (check.kind === "ulid") {
|
1608
|
+
if (!ulidRegex.test(input.data)) {
|
1609
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1610
|
+
addIssueToContext(ctx, {
|
1611
|
+
validation: "ulid",
|
1612
|
+
code: ZodIssueCode.invalid_string,
|
1613
|
+
message: check.message
|
1614
|
+
});
|
1615
|
+
status.dirty();
|
1616
|
+
}
|
2004
1617
|
} else if (check.kind === "url") {
|
2005
1618
|
try {
|
2006
1619
|
new URL(input.data);
|
@@ -2027,6 +1640,20 @@ var init_lib = __esm({
|
|
2027
1640
|
}
|
2028
1641
|
} else if (check.kind === "trim") {
|
2029
1642
|
input.data = input.data.trim();
|
1643
|
+
} else if (check.kind === "includes") {
|
1644
|
+
if (!input.data.includes(check.value, check.position)) {
|
1645
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1646
|
+
addIssueToContext(ctx, {
|
1647
|
+
code: ZodIssueCode.invalid_string,
|
1648
|
+
validation: { includes: check.value, position: check.position },
|
1649
|
+
message: check.message
|
1650
|
+
});
|
1651
|
+
status.dirty();
|
1652
|
+
}
|
1653
|
+
} else if (check.kind === "toLowerCase") {
|
1654
|
+
input.data = input.data.toLowerCase();
|
1655
|
+
} else if (check.kind === "toUpperCase") {
|
1656
|
+
input.data = input.data.toUpperCase();
|
2030
1657
|
} else if (check.kind === "startsWith") {
|
2031
1658
|
if (!input.data.startsWith(check.value)) {
|
2032
1659
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -2058,13 +1685,72 @@ var init_lib = __esm({
|
|
2058
1685
|
});
|
2059
1686
|
status.dirty();
|
2060
1687
|
}
|
1688
|
+
} else if (check.kind === "date") {
|
1689
|
+
const regex = dateRegex;
|
1690
|
+
if (!regex.test(input.data)) {
|
1691
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1692
|
+
addIssueToContext(ctx, {
|
1693
|
+
code: ZodIssueCode.invalid_string,
|
1694
|
+
validation: "date",
|
1695
|
+
message: check.message
|
1696
|
+
});
|
1697
|
+
status.dirty();
|
1698
|
+
}
|
1699
|
+
} else if (check.kind === "time") {
|
1700
|
+
const regex = timeRegex(check);
|
1701
|
+
if (!regex.test(input.data)) {
|
1702
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1703
|
+
addIssueToContext(ctx, {
|
1704
|
+
code: ZodIssueCode.invalid_string,
|
1705
|
+
validation: "time",
|
1706
|
+
message: check.message
|
1707
|
+
});
|
1708
|
+
status.dirty();
|
1709
|
+
}
|
1710
|
+
} else if (check.kind === "duration") {
|
1711
|
+
if (!durationRegex.test(input.data)) {
|
1712
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1713
|
+
addIssueToContext(ctx, {
|
1714
|
+
validation: "duration",
|
1715
|
+
code: ZodIssueCode.invalid_string,
|
1716
|
+
message: check.message
|
1717
|
+
});
|
1718
|
+
status.dirty();
|
1719
|
+
}
|
1720
|
+
} else if (check.kind === "ip") {
|
1721
|
+
if (!isValidIP(input.data, check.version)) {
|
1722
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1723
|
+
addIssueToContext(ctx, {
|
1724
|
+
validation: "ip",
|
1725
|
+
code: ZodIssueCode.invalid_string,
|
1726
|
+
message: check.message
|
1727
|
+
});
|
1728
|
+
status.dirty();
|
1729
|
+
}
|
1730
|
+
} else if (check.kind === "base64") {
|
1731
|
+
if (!base64Regex.test(input.data)) {
|
1732
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
1733
|
+
addIssueToContext(ctx, {
|
1734
|
+
validation: "base64",
|
1735
|
+
code: ZodIssueCode.invalid_string,
|
1736
|
+
message: check.message
|
1737
|
+
});
|
1738
|
+
status.dirty();
|
1739
|
+
}
|
2061
1740
|
} else {
|
2062
1741
|
util.assertNever(check);
|
2063
1742
|
}
|
2064
1743
|
}
|
2065
1744
|
return { status: status.value, value: input.data };
|
2066
1745
|
}
|
2067
|
-
|
1746
|
+
_regex(regex, validation, message) {
|
1747
|
+
return this.refinement((data) => regex.test(data), {
|
1748
|
+
validation,
|
1749
|
+
code: ZodIssueCode.invalid_string,
|
1750
|
+
...errorUtil.errToObj(message)
|
1751
|
+
});
|
1752
|
+
}
|
1753
|
+
_addCheck(check) {
|
2068
1754
|
return new _ZodString({
|
2069
1755
|
...this._def,
|
2070
1756
|
checks: [...this._def.checks, check]
|
@@ -2076,19 +1762,38 @@ var init_lib = __esm({
|
|
2076
1762
|
url(message) {
|
2077
1763
|
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
|
2078
1764
|
}
|
1765
|
+
emoji(message) {
|
1766
|
+
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
|
1767
|
+
}
|
2079
1768
|
uuid(message) {
|
2080
1769
|
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
2081
1770
|
}
|
1771
|
+
nanoid(message) {
|
1772
|
+
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
1773
|
+
}
|
2082
1774
|
cuid(message) {
|
2083
1775
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
2084
1776
|
}
|
1777
|
+
cuid2(message) {
|
1778
|
+
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
1779
|
+
}
|
1780
|
+
ulid(message) {
|
1781
|
+
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
1782
|
+
}
|
1783
|
+
base64(message) {
|
1784
|
+
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
1785
|
+
}
|
1786
|
+
ip(options) {
|
1787
|
+
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
1788
|
+
}
|
2085
1789
|
datetime(options) {
|
2086
|
-
var _a;
|
1790
|
+
var _a, _b;
|
2087
1791
|
if (typeof options === "string") {
|
2088
1792
|
return this._addCheck({
|
2089
1793
|
kind: "datetime",
|
2090
1794
|
precision: null,
|
2091
1795
|
offset: false,
|
1796
|
+
local: false,
|
2092
1797
|
message: options
|
2093
1798
|
});
|
2094
1799
|
}
|
@@ -2096,9 +1801,30 @@ var init_lib = __esm({
|
|
2096
1801
|
kind: "datetime",
|
2097
1802
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
2098
1803
|
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
1804
|
+
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
1805
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1806
|
+
});
|
1807
|
+
}
|
1808
|
+
date(message) {
|
1809
|
+
return this._addCheck({ kind: "date", message });
|
1810
|
+
}
|
1811
|
+
time(options) {
|
1812
|
+
if (typeof options === "string") {
|
1813
|
+
return this._addCheck({
|
1814
|
+
kind: "time",
|
1815
|
+
precision: null,
|
1816
|
+
message: options
|
1817
|
+
});
|
1818
|
+
}
|
1819
|
+
return this._addCheck({
|
1820
|
+
kind: "time",
|
1821
|
+
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
2099
1822
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
2100
1823
|
});
|
2101
1824
|
}
|
1825
|
+
duration(message) {
|
1826
|
+
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
1827
|
+
}
|
2102
1828
|
regex(regex, message) {
|
2103
1829
|
return this._addCheck({
|
2104
1830
|
kind: "regex",
|
@@ -2106,6 +1832,14 @@ var init_lib = __esm({
|
|
2106
1832
|
...errorUtil.errToObj(message)
|
2107
1833
|
});
|
2108
1834
|
}
|
1835
|
+
includes(value, options) {
|
1836
|
+
return this._addCheck({
|
1837
|
+
kind: "includes",
|
1838
|
+
value,
|
1839
|
+
position: options === null || options === void 0 ? void 0 : options.position,
|
1840
|
+
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1841
|
+
});
|
1842
|
+
}
|
2109
1843
|
startsWith(value, message) {
|
2110
1844
|
return this._addCheck({
|
2111
1845
|
kind: "startsWith",
|
@@ -2141,21 +1875,73 @@ var init_lib = __esm({
|
|
2141
1875
|
...errorUtil.errToObj(message)
|
2142
1876
|
});
|
2143
1877
|
}
|
1878
|
+
/**
|
1879
|
+
* @deprecated Use z.string().min(1) instead.
|
1880
|
+
* @see {@link ZodString.min}
|
1881
|
+
*/
|
1882
|
+
nonempty(message) {
|
1883
|
+
return this.min(1, errorUtil.errToObj(message));
|
1884
|
+
}
|
1885
|
+
trim() {
|
1886
|
+
return new _ZodString({
|
1887
|
+
...this._def,
|
1888
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
1889
|
+
});
|
1890
|
+
}
|
1891
|
+
toLowerCase() {
|
1892
|
+
return new _ZodString({
|
1893
|
+
...this._def,
|
1894
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
1895
|
+
});
|
1896
|
+
}
|
1897
|
+
toUpperCase() {
|
1898
|
+
return new _ZodString({
|
1899
|
+
...this._def,
|
1900
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
1901
|
+
});
|
1902
|
+
}
|
2144
1903
|
get isDatetime() {
|
2145
1904
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
2146
1905
|
}
|
1906
|
+
get isDate() {
|
1907
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
1908
|
+
}
|
1909
|
+
get isTime() {
|
1910
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
1911
|
+
}
|
1912
|
+
get isDuration() {
|
1913
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
1914
|
+
}
|
2147
1915
|
get isEmail() {
|
2148
1916
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
2149
1917
|
}
|
2150
1918
|
get isURL() {
|
2151
1919
|
return !!this._def.checks.find((ch) => ch.kind === "url");
|
2152
1920
|
}
|
1921
|
+
get isEmoji() {
|
1922
|
+
return !!this._def.checks.find((ch) => ch.kind === "emoji");
|
1923
|
+
}
|
2153
1924
|
get isUUID() {
|
2154
1925
|
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
2155
1926
|
}
|
1927
|
+
get isNANOID() {
|
1928
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
1929
|
+
}
|
2156
1930
|
get isCUID() {
|
2157
1931
|
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
2158
1932
|
}
|
1933
|
+
get isCUID2() {
|
1934
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
1935
|
+
}
|
1936
|
+
get isULID() {
|
1937
|
+
return !!this._def.checks.find((ch) => ch.kind === "ulid");
|
1938
|
+
}
|
1939
|
+
get isIP() {
|
1940
|
+
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
1941
|
+
}
|
1942
|
+
get isBase64() {
|
1943
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
1944
|
+
}
|
2159
1945
|
get minLength() {
|
2160
1946
|
let min = null;
|
2161
1947
|
for (const ch of this._def.checks) {
|
@@ -2357,6 +2143,19 @@ var init_lib = __esm({
|
|
2357
2143
|
message: errorUtil.toString(message)
|
2358
2144
|
});
|
2359
2145
|
}
|
2146
|
+
safe(message) {
|
2147
|
+
return this._addCheck({
|
2148
|
+
kind: "min",
|
2149
|
+
inclusive: true,
|
2150
|
+
value: Number.MIN_SAFE_INTEGER,
|
2151
|
+
message: errorUtil.toString(message)
|
2152
|
+
})._addCheck({
|
2153
|
+
kind: "max",
|
2154
|
+
inclusive: true,
|
2155
|
+
value: Number.MAX_SAFE_INTEGER,
|
2156
|
+
message: errorUtil.toString(message)
|
2157
|
+
});
|
2158
|
+
}
|
2360
2159
|
get minValue() {
|
2361
2160
|
let min = null;
|
2362
2161
|
for (const ch of this._def.checks) {
|
@@ -2378,7 +2177,22 @@ var init_lib = __esm({
|
|
2378
2177
|
return max;
|
2379
2178
|
}
|
2380
2179
|
get isInt() {
|
2381
|
-
return !!this._def.checks.find((ch) => ch.kind === "int");
|
2180
|
+
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
2181
|
+
}
|
2182
|
+
get isFinite() {
|
2183
|
+
let max = null, min = null;
|
2184
|
+
for (const ch of this._def.checks) {
|
2185
|
+
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
2186
|
+
return true;
|
2187
|
+
} else if (ch.kind === "min") {
|
2188
|
+
if (min === null || ch.value > min)
|
2189
|
+
min = ch.value;
|
2190
|
+
} else if (ch.kind === "max") {
|
2191
|
+
if (max === null || ch.value < max)
|
2192
|
+
max = ch.value;
|
2193
|
+
}
|
2194
|
+
}
|
2195
|
+
return Number.isFinite(min) && Number.isFinite(max);
|
2382
2196
|
}
|
2383
2197
|
};
|
2384
2198
|
ZodNumber.create = (params) => {
|
@@ -2389,27 +2203,167 @@ var init_lib = __esm({
|
|
2389
2203
|
...processCreateParams(params)
|
2390
2204
|
});
|
2391
2205
|
};
|
2392
|
-
ZodBigInt = class extends ZodType {
|
2206
|
+
ZodBigInt = class _ZodBigInt extends ZodType {
|
2207
|
+
constructor() {
|
2208
|
+
super(...arguments);
|
2209
|
+
this.min = this.gte;
|
2210
|
+
this.max = this.lte;
|
2211
|
+
}
|
2393
2212
|
_parse(input) {
|
2394
2213
|
if (this._def.coerce) {
|
2395
2214
|
input.data = BigInt(input.data);
|
2396
2215
|
}
|
2397
2216
|
const parsedType = this._getType(input);
|
2398
2217
|
if (parsedType !== ZodParsedType.bigint) {
|
2399
|
-
const
|
2400
|
-
addIssueToContext(
|
2218
|
+
const ctx2 = this._getOrReturnCtx(input);
|
2219
|
+
addIssueToContext(ctx2, {
|
2401
2220
|
code: ZodIssueCode.invalid_type,
|
2402
2221
|
expected: ZodParsedType.bigint,
|
2403
|
-
received:
|
2222
|
+
received: ctx2.parsedType
|
2404
2223
|
});
|
2405
2224
|
return INVALID;
|
2406
2225
|
}
|
2407
|
-
|
2226
|
+
let ctx = void 0;
|
2227
|
+
const status = new ParseStatus();
|
2228
|
+
for (const check of this._def.checks) {
|
2229
|
+
if (check.kind === "min") {
|
2230
|
+
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
2231
|
+
if (tooSmall) {
|
2232
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2233
|
+
addIssueToContext(ctx, {
|
2234
|
+
code: ZodIssueCode.too_small,
|
2235
|
+
type: "bigint",
|
2236
|
+
minimum: check.value,
|
2237
|
+
inclusive: check.inclusive,
|
2238
|
+
message: check.message
|
2239
|
+
});
|
2240
|
+
status.dirty();
|
2241
|
+
}
|
2242
|
+
} else if (check.kind === "max") {
|
2243
|
+
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
2244
|
+
if (tooBig) {
|
2245
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2246
|
+
addIssueToContext(ctx, {
|
2247
|
+
code: ZodIssueCode.too_big,
|
2248
|
+
type: "bigint",
|
2249
|
+
maximum: check.value,
|
2250
|
+
inclusive: check.inclusive,
|
2251
|
+
message: check.message
|
2252
|
+
});
|
2253
|
+
status.dirty();
|
2254
|
+
}
|
2255
|
+
} else if (check.kind === "multipleOf") {
|
2256
|
+
if (input.data % check.value !== BigInt(0)) {
|
2257
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2258
|
+
addIssueToContext(ctx, {
|
2259
|
+
code: ZodIssueCode.not_multiple_of,
|
2260
|
+
multipleOf: check.value,
|
2261
|
+
message: check.message
|
2262
|
+
});
|
2263
|
+
status.dirty();
|
2264
|
+
}
|
2265
|
+
} else {
|
2266
|
+
util.assertNever(check);
|
2267
|
+
}
|
2268
|
+
}
|
2269
|
+
return { status: status.value, value: input.data };
|
2270
|
+
}
|
2271
|
+
gte(value, message) {
|
2272
|
+
return this.setLimit("min", value, true, errorUtil.toString(message));
|
2273
|
+
}
|
2274
|
+
gt(value, message) {
|
2275
|
+
return this.setLimit("min", value, false, errorUtil.toString(message));
|
2276
|
+
}
|
2277
|
+
lte(value, message) {
|
2278
|
+
return this.setLimit("max", value, true, errorUtil.toString(message));
|
2279
|
+
}
|
2280
|
+
lt(value, message) {
|
2281
|
+
return this.setLimit("max", value, false, errorUtil.toString(message));
|
2282
|
+
}
|
2283
|
+
setLimit(kind, value, inclusive, message) {
|
2284
|
+
return new _ZodBigInt({
|
2285
|
+
...this._def,
|
2286
|
+
checks: [
|
2287
|
+
...this._def.checks,
|
2288
|
+
{
|
2289
|
+
kind,
|
2290
|
+
value,
|
2291
|
+
inclusive,
|
2292
|
+
message: errorUtil.toString(message)
|
2293
|
+
}
|
2294
|
+
]
|
2295
|
+
});
|
2296
|
+
}
|
2297
|
+
_addCheck(check) {
|
2298
|
+
return new _ZodBigInt({
|
2299
|
+
...this._def,
|
2300
|
+
checks: [...this._def.checks, check]
|
2301
|
+
});
|
2302
|
+
}
|
2303
|
+
positive(message) {
|
2304
|
+
return this._addCheck({
|
2305
|
+
kind: "min",
|
2306
|
+
value: BigInt(0),
|
2307
|
+
inclusive: false,
|
2308
|
+
message: errorUtil.toString(message)
|
2309
|
+
});
|
2310
|
+
}
|
2311
|
+
negative(message) {
|
2312
|
+
return this._addCheck({
|
2313
|
+
kind: "max",
|
2314
|
+
value: BigInt(0),
|
2315
|
+
inclusive: false,
|
2316
|
+
message: errorUtil.toString(message)
|
2317
|
+
});
|
2318
|
+
}
|
2319
|
+
nonpositive(message) {
|
2320
|
+
return this._addCheck({
|
2321
|
+
kind: "max",
|
2322
|
+
value: BigInt(0),
|
2323
|
+
inclusive: true,
|
2324
|
+
message: errorUtil.toString(message)
|
2325
|
+
});
|
2326
|
+
}
|
2327
|
+
nonnegative(message) {
|
2328
|
+
return this._addCheck({
|
2329
|
+
kind: "min",
|
2330
|
+
value: BigInt(0),
|
2331
|
+
inclusive: true,
|
2332
|
+
message: errorUtil.toString(message)
|
2333
|
+
});
|
2334
|
+
}
|
2335
|
+
multipleOf(value, message) {
|
2336
|
+
return this._addCheck({
|
2337
|
+
kind: "multipleOf",
|
2338
|
+
value,
|
2339
|
+
message: errorUtil.toString(message)
|
2340
|
+
});
|
2341
|
+
}
|
2342
|
+
get minValue() {
|
2343
|
+
let min = null;
|
2344
|
+
for (const ch of this._def.checks) {
|
2345
|
+
if (ch.kind === "min") {
|
2346
|
+
if (min === null || ch.value > min)
|
2347
|
+
min = ch.value;
|
2348
|
+
}
|
2349
|
+
}
|
2350
|
+
return min;
|
2351
|
+
}
|
2352
|
+
get maxValue() {
|
2353
|
+
let max = null;
|
2354
|
+
for (const ch of this._def.checks) {
|
2355
|
+
if (ch.kind === "max") {
|
2356
|
+
if (max === null || ch.value < max)
|
2357
|
+
max = ch.value;
|
2358
|
+
}
|
2359
|
+
}
|
2360
|
+
return max;
|
2408
2361
|
}
|
2409
2362
|
};
|
2410
2363
|
ZodBigInt.create = (params) => {
|
2411
2364
|
var _a;
|
2412
2365
|
return new ZodBigInt({
|
2366
|
+
checks: [],
|
2413
2367
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
2414
2368
|
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
2415
2369
|
...processCreateParams(params)
|
@@ -2735,13 +2689,13 @@ var init_lib = __esm({
|
|
2735
2689
|
}
|
2736
2690
|
}
|
2737
2691
|
if (ctx.common.async) {
|
2738
|
-
return Promise.all(ctx.data.map((item, i) => {
|
2692
|
+
return Promise.all([...ctx.data].map((item, i) => {
|
2739
2693
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
2740
2694
|
})).then((result2) => {
|
2741
2695
|
return ParseStatus.mergeArray(status, result2);
|
2742
2696
|
});
|
2743
2697
|
}
|
2744
|
-
const result = ctx.data.map((item, i) => {
|
2698
|
+
const result = [...ctx.data].map((item, i) => {
|
2745
2699
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
2746
2700
|
});
|
2747
2701
|
return ParseStatus.mergeArray(status, result);
|
@@ -2781,31 +2735,12 @@ var init_lib = __esm({
|
|
2781
2735
|
...processCreateParams(params)
|
2782
2736
|
});
|
2783
2737
|
};
|
2784
|
-
(function(objectUtil2) {
|
2785
|
-
objectUtil2.mergeShapes = (first, second) => {
|
2786
|
-
return {
|
2787
|
-
...first,
|
2788
|
-
...second
|
2789
|
-
// second overwrites first
|
2790
|
-
};
|
2791
|
-
};
|
2792
|
-
})(objectUtil || (objectUtil = {}));
|
2793
|
-
AugmentFactory = (def) => (augmentation) => {
|
2794
|
-
return new ZodObject({
|
2795
|
-
...def,
|
2796
|
-
shape: () => ({
|
2797
|
-
...def.shape(),
|
2798
|
-
...augmentation
|
2799
|
-
})
|
2800
|
-
});
|
2801
|
-
};
|
2802
2738
|
ZodObject = class _ZodObject extends ZodType {
|
2803
2739
|
constructor() {
|
2804
2740
|
super(...arguments);
|
2805
2741
|
this._cached = null;
|
2806
2742
|
this.nonstrict = this.passthrough;
|
2807
|
-
this.augment =
|
2808
|
-
this.extend = AugmentFactory(this._def);
|
2743
|
+
this.augment = this.extend;
|
2809
2744
|
}
|
2810
2745
|
_getCached() {
|
2811
2746
|
if (this._cached !== null)
|
@@ -2886,9 +2821,10 @@ var init_lib = __esm({
|
|
2886
2821
|
const syncPairs = [];
|
2887
2822
|
for (const pair of pairs) {
|
2888
2823
|
const key = await pair.key;
|
2824
|
+
const value = await pair.value;
|
2889
2825
|
syncPairs.push({
|
2890
2826
|
key,
|
2891
|
-
value
|
2827
|
+
value,
|
2892
2828
|
alwaysSet: pair.alwaysSet
|
2893
2829
|
});
|
2894
2830
|
}
|
@@ -2935,8 +2871,31 @@ var init_lib = __esm({
|
|
2935
2871
|
unknownKeys: "passthrough"
|
2936
2872
|
});
|
2937
2873
|
}
|
2938
|
-
|
2939
|
-
|
2874
|
+
// const AugmentFactory =
|
2875
|
+
// <Def extends ZodObjectDef>(def: Def) =>
|
2876
|
+
// <Augmentation extends ZodRawShape>(
|
2877
|
+
// augmentation: Augmentation
|
2878
|
+
// ): ZodObject<
|
2879
|
+
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
2880
|
+
// Def["unknownKeys"],
|
2881
|
+
// Def["catchall"]
|
2882
|
+
// > => {
|
2883
|
+
// return new ZodObject({
|
2884
|
+
// ...def,
|
2885
|
+
// shape: () => ({
|
2886
|
+
// ...def.shape(),
|
2887
|
+
// ...augmentation,
|
2888
|
+
// }),
|
2889
|
+
// }) as any;
|
2890
|
+
// };
|
2891
|
+
extend(augmentation) {
|
2892
|
+
return new _ZodObject({
|
2893
|
+
...this._def,
|
2894
|
+
shape: () => ({
|
2895
|
+
...this._def.shape(),
|
2896
|
+
...augmentation
|
2897
|
+
})
|
2898
|
+
});
|
2940
2899
|
}
|
2941
2900
|
/**
|
2942
2901
|
* Prior to zod@1.0.12 there was a bug in the
|
@@ -2947,11 +2906,73 @@ var init_lib = __esm({
|
|
2947
2906
|
const merged = new _ZodObject({
|
2948
2907
|
unknownKeys: merging._def.unknownKeys,
|
2949
2908
|
catchall: merging._def.catchall,
|
2950
|
-
shape: () =>
|
2909
|
+
shape: () => ({
|
2910
|
+
...this._def.shape(),
|
2911
|
+
...merging._def.shape()
|
2912
|
+
}),
|
2951
2913
|
typeName: ZodFirstPartyTypeKind.ZodObject
|
2952
2914
|
});
|
2953
2915
|
return merged;
|
2954
2916
|
}
|
2917
|
+
// merge<
|
2918
|
+
// Incoming extends AnyZodObject,
|
2919
|
+
// Augmentation extends Incoming["shape"],
|
2920
|
+
// NewOutput extends {
|
2921
|
+
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
2922
|
+
// ? Augmentation[k]["_output"]
|
2923
|
+
// : k extends keyof Output
|
2924
|
+
// ? Output[k]
|
2925
|
+
// : never;
|
2926
|
+
// },
|
2927
|
+
// NewInput extends {
|
2928
|
+
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
2929
|
+
// ? Augmentation[k]["_input"]
|
2930
|
+
// : k extends keyof Input
|
2931
|
+
// ? Input[k]
|
2932
|
+
// : never;
|
2933
|
+
// }
|
2934
|
+
// >(
|
2935
|
+
// merging: Incoming
|
2936
|
+
// ): ZodObject<
|
2937
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
2938
|
+
// Incoming["_def"]["unknownKeys"],
|
2939
|
+
// Incoming["_def"]["catchall"],
|
2940
|
+
// NewOutput,
|
2941
|
+
// NewInput
|
2942
|
+
// > {
|
2943
|
+
// const merged: any = new ZodObject({
|
2944
|
+
// unknownKeys: merging._def.unknownKeys,
|
2945
|
+
// catchall: merging._def.catchall,
|
2946
|
+
// shape: () =>
|
2947
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2948
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
2949
|
+
// }) as any;
|
2950
|
+
// return merged;
|
2951
|
+
// }
|
2952
|
+
setKey(key, schema3) {
|
2953
|
+
return this.augment({ [key]: schema3 });
|
2954
|
+
}
|
2955
|
+
// merge<Incoming extends AnyZodObject>(
|
2956
|
+
// merging: Incoming
|
2957
|
+
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
2958
|
+
// ZodObject<
|
2959
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
2960
|
+
// Incoming["_def"]["unknownKeys"],
|
2961
|
+
// Incoming["_def"]["catchall"]
|
2962
|
+
// > {
|
2963
|
+
// // const mergedShape = objectUtil.mergeShapes(
|
2964
|
+
// // this._def.shape(),
|
2965
|
+
// // merging._def.shape()
|
2966
|
+
// // );
|
2967
|
+
// const merged: any = new ZodObject({
|
2968
|
+
// unknownKeys: merging._def.unknownKeys,
|
2969
|
+
// catchall: merging._def.catchall,
|
2970
|
+
// shape: () =>
|
2971
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2972
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
2973
|
+
// }) as any;
|
2974
|
+
// return merged;
|
2975
|
+
// }
|
2955
2976
|
catchall(index4) {
|
2956
2977
|
return new _ZodObject({
|
2957
2978
|
...this._def,
|
@@ -2960,9 +2981,10 @@ var init_lib = __esm({
|
|
2960
2981
|
}
|
2961
2982
|
pick(mask) {
|
2962
2983
|
const shape = {};
|
2963
|
-
util.objectKeys(mask).
|
2964
|
-
if (this.shape[key])
|
2984
|
+
util.objectKeys(mask).forEach((key) => {
|
2985
|
+
if (mask[key] && this.shape[key]) {
|
2965
2986
|
shape[key] = this.shape[key];
|
2987
|
+
}
|
2966
2988
|
});
|
2967
2989
|
return new _ZodObject({
|
2968
2990
|
...this._def,
|
@@ -2971,8 +2993,8 @@ var init_lib = __esm({
|
|
2971
2993
|
}
|
2972
2994
|
omit(mask) {
|
2973
2995
|
const shape = {};
|
2974
|
-
util.objectKeys(this.shape).
|
2975
|
-
if (
|
2996
|
+
util.objectKeys(this.shape).forEach((key) => {
|
2997
|
+
if (!mask[key]) {
|
2976
2998
|
shape[key] = this.shape[key];
|
2977
2999
|
}
|
2978
3000
|
});
|
@@ -2981,29 +3003,22 @@ var init_lib = __esm({
|
|
2981
3003
|
shape: () => shape
|
2982
3004
|
});
|
2983
3005
|
}
|
3006
|
+
/**
|
3007
|
+
* @deprecated
|
3008
|
+
*/
|
2984
3009
|
deepPartial() {
|
2985
3010
|
return deepPartialify(this);
|
2986
3011
|
}
|
2987
3012
|
partial(mask) {
|
2988
3013
|
const newShape = {};
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
newShape[key] = this.shape[key].optional();
|
2995
|
-
}
|
2996
|
-
});
|
2997
|
-
return new _ZodObject({
|
2998
|
-
...this._def,
|
2999
|
-
shape: () => newShape
|
3000
|
-
});
|
3001
|
-
} else {
|
3002
|
-
for (const key in this.shape) {
|
3003
|
-
const fieldSchema = this.shape[key];
|
3014
|
+
util.objectKeys(this.shape).forEach((key) => {
|
3015
|
+
const fieldSchema = this.shape[key];
|
3016
|
+
if (mask && !mask[key]) {
|
3017
|
+
newShape[key] = fieldSchema;
|
3018
|
+
} else {
|
3004
3019
|
newShape[key] = fieldSchema.optional();
|
3005
3020
|
}
|
3006
|
-
}
|
3021
|
+
});
|
3007
3022
|
return new _ZodObject({
|
3008
3023
|
...this._def,
|
3009
3024
|
shape: () => newShape
|
@@ -3011,21 +3026,10 @@ var init_lib = __esm({
|
|
3011
3026
|
}
|
3012
3027
|
required(mask) {
|
3013
3028
|
const newShape = {};
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3018
|
-
} else {
|
3019
|
-
const fieldSchema = this.shape[key];
|
3020
|
-
let newField = fieldSchema;
|
3021
|
-
while (newField instanceof ZodOptional) {
|
3022
|
-
newField = newField._def.innerType;
|
3023
|
-
}
|
3024
|
-
newShape[key] = newField;
|
3025
|
-
}
|
3026
|
-
});
|
3027
|
-
} else {
|
3028
|
-
for (const key in this.shape) {
|
3029
|
+
util.objectKeys(this.shape).forEach((key) => {
|
3030
|
+
if (mask && !mask[key]) {
|
3031
|
+
newShape[key] = this.shape[key];
|
3032
|
+
} else {
|
3029
3033
|
const fieldSchema = this.shape[key];
|
3030
3034
|
let newField = fieldSchema;
|
3031
3035
|
while (newField instanceof ZodOptional) {
|
@@ -3033,7 +3037,7 @@ var init_lib = __esm({
|
|
3033
3037
|
}
|
3034
3038
|
newShape[key] = newField;
|
3035
3039
|
}
|
3036
|
-
}
|
3040
|
+
});
|
3037
3041
|
return new _ZodObject({
|
3038
3042
|
...this._def,
|
3039
3043
|
shape: () => newShape
|
@@ -3171,15 +3175,25 @@ var init_lib = __esm({
|
|
3171
3175
|
} else if (type instanceof ZodEnum) {
|
3172
3176
|
return type.options;
|
3173
3177
|
} else if (type instanceof ZodNativeEnum) {
|
3174
|
-
return
|
3178
|
+
return util.objectValues(type.enum);
|
3175
3179
|
} else if (type instanceof ZodDefault) {
|
3176
3180
|
return getDiscriminator(type._def.innerType);
|
3177
3181
|
} else if (type instanceof ZodUndefined) {
|
3178
3182
|
return [void 0];
|
3179
3183
|
} else if (type instanceof ZodNull) {
|
3180
3184
|
return [null];
|
3185
|
+
} else if (type instanceof ZodOptional) {
|
3186
|
+
return [void 0, ...getDiscriminator(type.unwrap())];
|
3187
|
+
} else if (type instanceof ZodNullable) {
|
3188
|
+
return [null, ...getDiscriminator(type.unwrap())];
|
3189
|
+
} else if (type instanceof ZodBranded) {
|
3190
|
+
return getDiscriminator(type.unwrap());
|
3191
|
+
} else if (type instanceof ZodReadonly) {
|
3192
|
+
return getDiscriminator(type.unwrap());
|
3193
|
+
} else if (type instanceof ZodCatch) {
|
3194
|
+
return getDiscriminator(type._def.innerType);
|
3181
3195
|
} else {
|
3182
|
-
return
|
3196
|
+
return [];
|
3183
3197
|
}
|
3184
3198
|
};
|
3185
3199
|
ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
@@ -3239,7 +3253,7 @@ var init_lib = __esm({
|
|
3239
3253
|
const optionsMap = /* @__PURE__ */ new Map();
|
3240
3254
|
for (const type of options) {
|
3241
3255
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
3242
|
-
if (!discriminatorValues) {
|
3256
|
+
if (!discriminatorValues.length) {
|
3243
3257
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
3244
3258
|
}
|
3245
3259
|
for (const value of discriminatorValues) {
|
@@ -3343,7 +3357,7 @@ var init_lib = __esm({
|
|
3343
3357
|
});
|
3344
3358
|
status.dirty();
|
3345
3359
|
}
|
3346
|
-
const items = ctx.data.map((item, itemIndex) => {
|
3360
|
+
const items = [...ctx.data].map((item, itemIndex) => {
|
3347
3361
|
const schema3 = this._def.items[itemIndex] || this._def.rest;
|
3348
3362
|
if (!schema3)
|
3349
3363
|
return null;
|
@@ -3401,7 +3415,8 @@ var init_lib = __esm({
|
|
3401
3415
|
for (const key in ctx.data) {
|
3402
3416
|
pairs.push({
|
3403
3417
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
3404
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
3418
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
|
3419
|
+
alwaysSet: key in ctx.data
|
3405
3420
|
});
|
3406
3421
|
}
|
3407
3422
|
if (ctx.common.async) {
|
@@ -3431,6 +3446,12 @@ var init_lib = __esm({
|
|
3431
3446
|
}
|
3432
3447
|
};
|
3433
3448
|
ZodMap = class extends ZodType {
|
3449
|
+
get keySchema() {
|
3450
|
+
return this._def.keyType;
|
3451
|
+
}
|
3452
|
+
get valueSchema() {
|
3453
|
+
return this._def.valueType;
|
3454
|
+
}
|
3434
3455
|
_parse(input) {
|
3435
3456
|
const { status, ctx } = this._processInputParams(input);
|
3436
3457
|
if (ctx.parsedType !== ZodParsedType.map) {
|
@@ -3625,27 +3646,29 @@ var init_lib = __esm({
|
|
3625
3646
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
3626
3647
|
const fn = ctx.data;
|
3627
3648
|
if (this._def.returns instanceof ZodPromise) {
|
3628
|
-
|
3649
|
+
const me = this;
|
3650
|
+
return OK(async function(...args) {
|
3629
3651
|
const error2 = new ZodError([]);
|
3630
|
-
const parsedArgs = await
|
3652
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
3631
3653
|
error2.addIssue(makeArgsIssue(args, e));
|
3632
3654
|
throw error2;
|
3633
3655
|
});
|
3634
|
-
const result = await fn
|
3635
|
-
const parsedReturns = await
|
3656
|
+
const result = await Reflect.apply(fn, this, parsedArgs);
|
3657
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
3636
3658
|
error2.addIssue(makeReturnsIssue(result, e));
|
3637
3659
|
throw error2;
|
3638
3660
|
});
|
3639
3661
|
return parsedReturns;
|
3640
3662
|
});
|
3641
3663
|
} else {
|
3642
|
-
|
3643
|
-
|
3664
|
+
const me = this;
|
3665
|
+
return OK(function(...args) {
|
3666
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
3644
3667
|
if (!parsedArgs.success) {
|
3645
3668
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
3646
3669
|
}
|
3647
|
-
const result = fn
|
3648
|
-
const parsedReturns =
|
3670
|
+
const result = Reflect.apply(fn, this, parsedArgs.data);
|
3671
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
3649
3672
|
if (!parsedReturns.success) {
|
3650
3673
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
3651
3674
|
}
|
@@ -3710,6 +3733,7 @@ var init_lib = __esm({
|
|
3710
3733
|
if (input.data !== this._def.value) {
|
3711
3734
|
const ctx = this._getOrReturnCtx(input);
|
3712
3735
|
addIssueToContext(ctx, {
|
3736
|
+
received: ctx.data,
|
3713
3737
|
code: ZodIssueCode.invalid_literal,
|
3714
3738
|
expected: this._def.value
|
3715
3739
|
});
|
@@ -3728,7 +3752,11 @@ var init_lib = __esm({
|
|
3728
3752
|
...processCreateParams(params)
|
3729
3753
|
});
|
3730
3754
|
};
|
3731
|
-
ZodEnum = class extends ZodType {
|
3755
|
+
ZodEnum = class _ZodEnum extends ZodType {
|
3756
|
+
constructor() {
|
3757
|
+
super(...arguments);
|
3758
|
+
_ZodEnum_cache.set(this, void 0);
|
3759
|
+
}
|
3732
3760
|
_parse(input) {
|
3733
3761
|
if (typeof input.data !== "string") {
|
3734
3762
|
const ctx = this._getOrReturnCtx(input);
|
@@ -3740,7 +3768,10 @@ var init_lib = __esm({
|
|
3740
3768
|
});
|
3741
3769
|
return INVALID;
|
3742
3770
|
}
|
3743
|
-
if (this
|
3771
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f")) {
|
3772
|
+
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
3773
|
+
}
|
3774
|
+
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
3744
3775
|
const ctx = this._getOrReturnCtx(input);
|
3745
3776
|
const expectedValues = this._def.values;
|
3746
3777
|
addIssueToContext(ctx, {
|
@@ -3776,9 +3807,26 @@ var init_lib = __esm({
|
|
3776
3807
|
}
|
3777
3808
|
return enumValues;
|
3778
3809
|
}
|
3810
|
+
extract(values, newDef = this._def) {
|
3811
|
+
return _ZodEnum.create(values, {
|
3812
|
+
...this._def,
|
3813
|
+
...newDef
|
3814
|
+
});
|
3815
|
+
}
|
3816
|
+
exclude(values, newDef = this._def) {
|
3817
|
+
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
3818
|
+
...this._def,
|
3819
|
+
...newDef
|
3820
|
+
});
|
3821
|
+
}
|
3779
3822
|
};
|
3823
|
+
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
3780
3824
|
ZodEnum.create = createZodEnum;
|
3781
3825
|
ZodNativeEnum = class extends ZodType {
|
3826
|
+
constructor() {
|
3827
|
+
super(...arguments);
|
3828
|
+
_ZodNativeEnum_cache.set(this, void 0);
|
3829
|
+
}
|
3782
3830
|
_parse(input) {
|
3783
3831
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
3784
3832
|
const ctx = this._getOrReturnCtx(input);
|
@@ -3791,7 +3839,10 @@ var init_lib = __esm({
|
|
3791
3839
|
});
|
3792
3840
|
return INVALID;
|
3793
3841
|
}
|
3794
|
-
if (
|
3842
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f")) {
|
3843
|
+
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
3844
|
+
}
|
3845
|
+
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
3795
3846
|
const expectedValues = util.objectValues(nativeEnumValues);
|
3796
3847
|
addIssueToContext(ctx, {
|
3797
3848
|
received: ctx.data,
|
@@ -3806,6 +3857,7 @@ var init_lib = __esm({
|
|
3806
3857
|
return this._def.values;
|
3807
3858
|
}
|
3808
3859
|
};
|
3860
|
+
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
3809
3861
|
ZodNativeEnum.create = (values, params) => {
|
3810
3862
|
return new ZodNativeEnum({
|
3811
3863
|
values,
|
@@ -3814,6 +3866,9 @@ var init_lib = __esm({
|
|
3814
3866
|
});
|
3815
3867
|
};
|
3816
3868
|
ZodPromise = class extends ZodType {
|
3869
|
+
unwrap() {
|
3870
|
+
return this._def.type;
|
3871
|
+
}
|
3817
3872
|
_parse(input) {
|
3818
3873
|
const { ctx } = this._processInputParams(input);
|
3819
3874
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
@@ -3850,24 +3905,6 @@ var init_lib = __esm({
|
|
3850
3905
|
_parse(input) {
|
3851
3906
|
const { status, ctx } = this._processInputParams(input);
|
3852
3907
|
const effect = this._def.effect || null;
|
3853
|
-
if (effect.type === "preprocess") {
|
3854
|
-
const processed = effect.transform(ctx.data);
|
3855
|
-
if (ctx.common.async) {
|
3856
|
-
return Promise.resolve(processed).then((processed2) => {
|
3857
|
-
return this._def.schema._parseAsync({
|
3858
|
-
data: processed2,
|
3859
|
-
path: ctx.path,
|
3860
|
-
parent: ctx
|
3861
|
-
});
|
3862
|
-
});
|
3863
|
-
} else {
|
3864
|
-
return this._def.schema._parseSync({
|
3865
|
-
data: processed,
|
3866
|
-
path: ctx.path,
|
3867
|
-
parent: ctx
|
3868
|
-
});
|
3869
|
-
}
|
3870
|
-
}
|
3871
3908
|
const checkCtx = {
|
3872
3909
|
addIssue: (arg) => {
|
3873
3910
|
addIssueToContext(ctx, arg);
|
@@ -3882,6 +3919,42 @@ var init_lib = __esm({
|
|
3882
3919
|
}
|
3883
3920
|
};
|
3884
3921
|
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
3922
|
+
if (effect.type === "preprocess") {
|
3923
|
+
const processed = effect.transform(ctx.data, checkCtx);
|
3924
|
+
if (ctx.common.async) {
|
3925
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
3926
|
+
if (status.value === "aborted")
|
3927
|
+
return INVALID;
|
3928
|
+
const result = await this._def.schema._parseAsync({
|
3929
|
+
data: processed2,
|
3930
|
+
path: ctx.path,
|
3931
|
+
parent: ctx
|
3932
|
+
});
|
3933
|
+
if (result.status === "aborted")
|
3934
|
+
return INVALID;
|
3935
|
+
if (result.status === "dirty")
|
3936
|
+
return DIRTY(result.value);
|
3937
|
+
if (status.value === "dirty")
|
3938
|
+
return DIRTY(result.value);
|
3939
|
+
return result;
|
3940
|
+
});
|
3941
|
+
} else {
|
3942
|
+
if (status.value === "aborted")
|
3943
|
+
return INVALID;
|
3944
|
+
const result = this._def.schema._parseSync({
|
3945
|
+
data: processed,
|
3946
|
+
path: ctx.path,
|
3947
|
+
parent: ctx
|
3948
|
+
});
|
3949
|
+
if (result.status === "aborted")
|
3950
|
+
return INVALID;
|
3951
|
+
if (result.status === "dirty")
|
3952
|
+
return DIRTY(result.value);
|
3953
|
+
if (status.value === "dirty")
|
3954
|
+
return DIRTY(result.value);
|
3955
|
+
return result;
|
3956
|
+
}
|
3957
|
+
}
|
3885
3958
|
if (effect.type === "refinement") {
|
3886
3959
|
const executeRefinement = (acc) => {
|
3887
3960
|
const result = effect.refinement(acc, checkCtx);
|
@@ -4024,26 +4097,45 @@ var init_lib = __esm({
|
|
4024
4097
|
ZodCatch = class extends ZodType {
|
4025
4098
|
_parse(input) {
|
4026
4099
|
const { ctx } = this._processInputParams(input);
|
4100
|
+
const newCtx = {
|
4101
|
+
...ctx,
|
4102
|
+
common: {
|
4103
|
+
...ctx.common,
|
4104
|
+
issues: []
|
4105
|
+
}
|
4106
|
+
};
|
4027
4107
|
const result = this._def.innerType._parse({
|
4028
|
-
data:
|
4029
|
-
path:
|
4030
|
-
parent:
|
4108
|
+
data: newCtx.data,
|
4109
|
+
path: newCtx.path,
|
4110
|
+
parent: {
|
4111
|
+
...newCtx
|
4112
|
+
}
|
4031
4113
|
});
|
4032
4114
|
if (isAsync(result)) {
|
4033
4115
|
return result.then((result2) => {
|
4034
4116
|
return {
|
4035
4117
|
status: "valid",
|
4036
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
4118
|
+
value: result2.status === "valid" ? result2.value : this._def.catchValue({
|
4119
|
+
get error() {
|
4120
|
+
return new ZodError(newCtx.common.issues);
|
4121
|
+
},
|
4122
|
+
input: newCtx.data
|
4123
|
+
})
|
4037
4124
|
};
|
4038
4125
|
});
|
4039
4126
|
} else {
|
4040
4127
|
return {
|
4041
4128
|
status: "valid",
|
4042
|
-
value: result.status === "valid" ? result.value : this._def.
|
4129
|
+
value: result.status === "valid" ? result.value : this._def.catchValue({
|
4130
|
+
get error() {
|
4131
|
+
return new ZodError(newCtx.common.issues);
|
4132
|
+
},
|
4133
|
+
input: newCtx.data
|
4134
|
+
})
|
4043
4135
|
};
|
4044
4136
|
}
|
4045
4137
|
}
|
4046
|
-
|
4138
|
+
removeCatch() {
|
4047
4139
|
return this._def.innerType;
|
4048
4140
|
}
|
4049
4141
|
};
|
@@ -4051,7 +4143,7 @@ var init_lib = __esm({
|
|
4051
4143
|
return new ZodCatch({
|
4052
4144
|
innerType: type,
|
4053
4145
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
4054
|
-
|
4146
|
+
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
4055
4147
|
...processCreateParams(params)
|
4056
4148
|
});
|
4057
4149
|
};
|
@@ -4146,6 +4238,25 @@ var init_lib = __esm({
|
|
4146
4238
|
});
|
4147
4239
|
}
|
4148
4240
|
};
|
4241
|
+
ZodReadonly = class extends ZodType {
|
4242
|
+
_parse(input) {
|
4243
|
+
const result = this._def.innerType._parse(input);
|
4244
|
+
if (isValid(result)) {
|
4245
|
+
result.value = Object.freeze(result.value);
|
4246
|
+
}
|
4247
|
+
return result;
|
4248
|
+
}
|
4249
|
+
unwrap() {
|
4250
|
+
return this._def.innerType;
|
4251
|
+
}
|
4252
|
+
};
|
4253
|
+
ZodReadonly.create = (type, params) => {
|
4254
|
+
return new ZodReadonly({
|
4255
|
+
innerType: type,
|
4256
|
+
typeName: ZodFirstPartyTypeKind.ZodReadonly,
|
4257
|
+
...processCreateParams(params)
|
4258
|
+
});
|
4259
|
+
};
|
4149
4260
|
late = {
|
4150
4261
|
object: ZodObject.lazycreate
|
4151
4262
|
};
|
@@ -4185,6 +4296,7 @@ var init_lib = __esm({
|
|
4185
4296
|
ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
|
4186
4297
|
ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
|
4187
4298
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
4299
|
+
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
4188
4300
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
4189
4301
|
stringType = ZodString.create;
|
4190
4302
|
numberType = ZodNumber.create;
|
@@ -4577,2625 +4689,191 @@ var init_pgSchema = __esm({
|
|
4577
4689
|
tables: recordType(stringType(), stringType()),
|
4578
4690
|
columns: recordType(stringType(), stringType())
|
4579
4691
|
}),
|
4580
|
-
internal: kitInternals2
|
4581
|
-
}).strict();
|
4582
|
-
tableSquashed2 = objectType({
|
4583
|
-
name: stringType(),
|
4584
|
-
schema: stringType(),
|
4585
|
-
columns: recordType(stringType(), column2),
|
4586
|
-
indexes: recordType(stringType(), stringType()),
|
4587
|
-
foreignKeys: recordType(stringType(), stringType()),
|
4588
|
-
compositePrimaryKeys: recordType(stringType(), stringType()),
|
4589
|
-
uniqueConstraints: recordType(stringType(), stringType())
|
4590
|
-
}).strict();
|
4591
|
-
tableSquashedV42 = objectType({
|
4592
|
-
name: stringType(),
|
4593
|
-
schema: stringType(),
|
4594
|
-
columns: recordType(stringType(), column2),
|
4595
|
-
indexes: recordType(stringType(), stringType()),
|
4596
|
-
foreignKeys: recordType(stringType(), stringType())
|
4597
|
-
}).strict();
|
4598
|
-
pgSchemaSquashedV4 = objectType({
|
4599
|
-
version: literalType("4"),
|
4600
|
-
dialect: enumType(["pg"]),
|
4601
|
-
tables: recordType(stringType(), tableSquashedV42),
|
4602
|
-
enums: recordType(stringType(), enumSchemaV1),
|
4603
|
-
schemas: recordType(stringType(), stringType())
|
4604
|
-
}).strict();
|
4605
|
-
pgSchemaSquashed = objectType({
|
4606
|
-
version: literalType("6"),
|
4607
|
-
dialect: enumType(["pg"]),
|
4608
|
-
tables: recordType(stringType(), tableSquashed2),
|
4609
|
-
enums: recordType(stringType(), enumSchema),
|
4610
|
-
schemas: recordType(stringType(), stringType())
|
4611
|
-
}).strict();
|
4612
|
-
pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
4613
|
-
pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
4614
|
-
pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
|
4615
|
-
pgSchema2 = pgSchemaInternal.merge(schemaHash2);
|
4616
|
-
backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema2]);
|
4617
|
-
dryPg = pgSchema2.parse({
|
4618
|
-
version: snapshotVersion,
|
4619
|
-
dialect: "pg",
|
4620
|
-
id: originUUID,
|
4621
|
-
prevId: "",
|
4622
|
-
tables: {},
|
4623
|
-
enums: {},
|
4624
|
-
schemas: {},
|
4625
|
-
_meta: {
|
4626
|
-
schemas: {},
|
4627
|
-
tables: {},
|
4628
|
-
columns: {}
|
4629
|
-
}
|
4630
|
-
});
|
4631
|
-
}
|
4632
|
-
});
|
4633
|
-
|
4634
|
-
// src/serializer/sqliteSchema.ts
|
4635
|
-
var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3, table3, dialect2, schemaHash3, schemaInternalV32, schemaInternalV42, latestVersion, schemaInternal2, schemaV32, schemaV42, schema2, tableSquashed3, schemaSquashed2, drySQLite;
|
4636
|
-
var init_sqliteSchema = __esm({
|
4637
|
-
"src/serializer/sqliteSchema.ts"() {
|
4638
|
-
"use strict";
|
4639
|
-
init_global();
|
4640
|
-
init_lib();
|
4641
|
-
index3 = objectType({
|
4642
|
-
name: stringType(),
|
4643
|
-
columns: stringType().array(),
|
4644
|
-
where: stringType().optional(),
|
4645
|
-
isUnique: booleanType()
|
4646
|
-
}).strict();
|
4647
|
-
fk3 = objectType({
|
4648
|
-
name: stringType(),
|
4649
|
-
tableFrom: stringType(),
|
4650
|
-
columnsFrom: stringType().array(),
|
4651
|
-
tableTo: stringType(),
|
4652
|
-
columnsTo: stringType().array(),
|
4653
|
-
onUpdate: stringType().optional(),
|
4654
|
-
onDelete: stringType().optional()
|
4655
|
-
}).strict();
|
4656
|
-
compositePK3 = objectType({
|
4657
|
-
columns: stringType().array(),
|
4658
|
-
name: stringType().optional()
|
4659
|
-
}).strict();
|
4660
|
-
column3 = objectType({
|
4661
|
-
name: stringType(),
|
4662
|
-
type: stringType(),
|
4663
|
-
primaryKey: booleanType(),
|
4664
|
-
notNull: booleanType(),
|
4665
|
-
autoincrement: booleanType().optional(),
|
4666
|
-
default: anyType().optional()
|
4667
|
-
}).strict();
|
4668
|
-
tableV33 = objectType({
|
4669
|
-
name: stringType(),
|
4670
|
-
columns: recordType(stringType(), column3),
|
4671
|
-
indexes: recordType(stringType(), index3),
|
4672
|
-
foreignKeys: recordType(stringType(), fk3)
|
4673
|
-
}).strict();
|
4674
|
-
uniqueConstraint3 = objectType({
|
4675
|
-
name: stringType(),
|
4676
|
-
columns: stringType().array()
|
4677
|
-
}).strict();
|
4678
|
-
table3 = objectType({
|
4679
|
-
name: stringType(),
|
4680
|
-
columns: recordType(stringType(), column3),
|
4681
|
-
indexes: recordType(stringType(), index3),
|
4682
|
-
foreignKeys: recordType(stringType(), fk3),
|
4683
|
-
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
4684
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
4685
|
-
}).strict();
|
4686
|
-
dialect2 = enumType(["sqlite"]);
|
4687
|
-
schemaHash3 = objectType({
|
4688
|
-
id: stringType(),
|
4689
|
-
prevId: stringType()
|
4690
|
-
}).strict();
|
4691
|
-
schemaInternalV32 = objectType({
|
4692
|
-
version: literalType("3"),
|
4693
|
-
dialect: dialect2,
|
4694
|
-
tables: recordType(stringType(), tableV33),
|
4695
|
-
enums: objectType({})
|
4696
|
-
}).strict();
|
4697
|
-
schemaInternalV42 = objectType({
|
4698
|
-
version: literalType("4"),
|
4699
|
-
dialect: dialect2,
|
4700
|
-
tables: recordType(stringType(), table3),
|
4701
|
-
enums: objectType({})
|
4702
|
-
}).strict();
|
4703
|
-
latestVersion = literalType("5");
|
4704
|
-
schemaInternal2 = objectType({
|
4705
|
-
version: latestVersion,
|
4706
|
-
dialect: dialect2,
|
4707
|
-
tables: recordType(stringType(), table3),
|
4708
|
-
enums: objectType({}),
|
4709
|
-
_meta: objectType({
|
4710
|
-
tables: recordType(stringType(), stringType()),
|
4711
|
-
columns: recordType(stringType(), stringType())
|
4712
|
-
})
|
4713
|
-
}).strict();
|
4714
|
-
schemaV32 = schemaInternalV32.merge(schemaHash3).strict();
|
4715
|
-
schemaV42 = schemaInternalV42.merge(schemaHash3).strict();
|
4716
|
-
schema2 = schemaInternal2.merge(schemaHash3).strict();
|
4717
|
-
tableSquashed3 = objectType({
|
4718
|
-
name: stringType(),
|
4719
|
-
columns: recordType(stringType(), column3),
|
4720
|
-
indexes: recordType(stringType(), stringType()),
|
4721
|
-
foreignKeys: recordType(stringType(), stringType()),
|
4722
|
-
compositePrimaryKeys: recordType(stringType(), stringType()),
|
4723
|
-
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
4724
|
-
}).strict();
|
4725
|
-
schemaSquashed2 = objectType({
|
4726
|
-
version: latestVersion,
|
4727
|
-
dialect: dialect2,
|
4728
|
-
tables: recordType(stringType(), tableSquashed3),
|
4729
|
-
enums: anyType()
|
4730
|
-
}).strict();
|
4731
|
-
drySQLite = schema2.parse({
|
4732
|
-
version: "5",
|
4733
|
-
dialect: "sqlite",
|
4734
|
-
id: originUUID,
|
4735
|
-
prevId: "",
|
4736
|
-
tables: {},
|
4737
|
-
enums: {},
|
4738
|
-
_meta: {
|
4739
|
-
tables: {},
|
4740
|
-
columns: {}
|
4741
|
-
}
|
4742
|
-
});
|
4743
|
-
}
|
4744
|
-
});
|
4745
|
-
|
4746
|
-
// src/utils.ts
|
4747
|
-
var init_utils = __esm({
|
4748
|
-
"src/utils.ts"() {
|
4749
|
-
"use strict";
|
4750
|
-
init_views();
|
4751
|
-
init_mysqlSchema();
|
4752
|
-
init_pgSchema();
|
4753
|
-
init_sqliteSchema();
|
4754
|
-
init_source();
|
4755
|
-
init_global();
|
4756
|
-
}
|
4757
|
-
});
|
4758
|
-
|
4759
|
-
// src/cli/views.ts
|
4760
|
-
var import_hanji;
|
4761
|
-
var init_views = __esm({
|
4762
|
-
"src/cli/views.ts"() {
|
4763
|
-
"use strict";
|
4764
|
-
init_source();
|
4765
|
-
import_hanji = __toESM(require_hanji());
|
4766
|
-
init_utils();
|
4767
|
-
}
|
4768
|
-
});
|
4769
|
-
|
4770
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
|
4771
|
-
var require_constants = __commonJS({
|
4772
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js"(exports, module) {
|
4773
|
-
var SEMVER_SPEC_VERSION = "2.0.0";
|
4774
|
-
var MAX_LENGTH = 256;
|
4775
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
4776
|
-
9007199254740991;
|
4777
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
4778
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
4779
|
-
var RELEASE_TYPES = [
|
4780
|
-
"major",
|
4781
|
-
"premajor",
|
4782
|
-
"minor",
|
4783
|
-
"preminor",
|
4784
|
-
"patch",
|
4785
|
-
"prepatch",
|
4786
|
-
"prerelease"
|
4787
|
-
];
|
4788
|
-
module.exports = {
|
4789
|
-
MAX_LENGTH,
|
4790
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
4791
|
-
MAX_SAFE_BUILD_LENGTH,
|
4792
|
-
MAX_SAFE_INTEGER,
|
4793
|
-
RELEASE_TYPES,
|
4794
|
-
SEMVER_SPEC_VERSION,
|
4795
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
4796
|
-
FLAG_LOOSE: 2
|
4797
|
-
};
|
4798
|
-
}
|
4799
|
-
});
|
4800
|
-
|
4801
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js
|
4802
|
-
var require_debug = __commonJS({
|
4803
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js"(exports, module) {
|
4804
|
-
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
4805
|
-
};
|
4806
|
-
module.exports = debug;
|
4807
|
-
}
|
4808
|
-
});
|
4809
|
-
|
4810
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js
|
4811
|
-
var require_re = __commonJS({
|
4812
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js"(exports, module) {
|
4813
|
-
var {
|
4814
|
-
MAX_SAFE_COMPONENT_LENGTH,
|
4815
|
-
MAX_SAFE_BUILD_LENGTH,
|
4816
|
-
MAX_LENGTH
|
4817
|
-
} = require_constants();
|
4818
|
-
var debug = require_debug();
|
4819
|
-
exports = module.exports = {};
|
4820
|
-
var re = exports.re = [];
|
4821
|
-
var safeRe = exports.safeRe = [];
|
4822
|
-
var src = exports.src = [];
|
4823
|
-
var t = exports.t = {};
|
4824
|
-
var R = 0;
|
4825
|
-
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
4826
|
-
var safeRegexReplacements = [
|
4827
|
-
["\\s", 1],
|
4828
|
-
["\\d", MAX_LENGTH],
|
4829
|
-
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
4830
|
-
];
|
4831
|
-
var makeSafeRegex = (value) => {
|
4832
|
-
for (const [token, max] of safeRegexReplacements) {
|
4833
|
-
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
4834
|
-
}
|
4835
|
-
return value;
|
4836
|
-
};
|
4837
|
-
var createToken = (name, value, isGlobal) => {
|
4838
|
-
const safe = makeSafeRegex(value);
|
4839
|
-
const index4 = R++;
|
4840
|
-
debug(name, index4, value);
|
4841
|
-
t[name] = index4;
|
4842
|
-
src[index4] = value;
|
4843
|
-
re[index4] = new RegExp(value, isGlobal ? "g" : void 0);
|
4844
|
-
safeRe[index4] = new RegExp(safe, isGlobal ? "g" : void 0);
|
4845
|
-
};
|
4846
|
-
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
4847
|
-
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
4848
|
-
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
4849
|
-
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
4850
|
-
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
4851
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
4852
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
4853
|
-
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
4854
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
4855
|
-
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
4856
|
-
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
4857
|
-
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
4858
|
-
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
4859
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
4860
|
-
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
4861
|
-
createToken("GTLT", "((?:<|>)?=?)");
|
4862
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
4863
|
-
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
4864
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
4865
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
4866
|
-
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
4867
|
-
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
4868
|
-
createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
|
4869
|
-
createToken("COERCERTL", src[t.COERCE], true);
|
4870
|
-
createToken("LONETILDE", "(?:~>?)");
|
4871
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
4872
|
-
exports.tildeTrimReplace = "$1~";
|
4873
|
-
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
4874
|
-
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
4875
|
-
createToken("LONECARET", "(?:\\^)");
|
4876
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
4877
|
-
exports.caretTrimReplace = "$1^";
|
4878
|
-
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
4879
|
-
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
4880
|
-
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
4881
|
-
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
4882
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
4883
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
4884
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
4885
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
4886
|
-
createToken("STAR", "(<|>)?=?\\s*\\*");
|
4887
|
-
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
4888
|
-
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
4889
|
-
}
|
4890
|
-
});
|
4891
|
-
|
4892
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js
|
4893
|
-
var require_parse_options = __commonJS({
|
4894
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js"(exports, module) {
|
4895
|
-
var looseOption = Object.freeze({ loose: true });
|
4896
|
-
var emptyOpts = Object.freeze({});
|
4897
|
-
var parseOptions = (options) => {
|
4898
|
-
if (!options) {
|
4899
|
-
return emptyOpts;
|
4900
|
-
}
|
4901
|
-
if (typeof options !== "object") {
|
4902
|
-
return looseOption;
|
4903
|
-
}
|
4904
|
-
return options;
|
4905
|
-
};
|
4906
|
-
module.exports = parseOptions;
|
4907
|
-
}
|
4908
|
-
});
|
4909
|
-
|
4910
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js
|
4911
|
-
var require_identifiers = __commonJS({
|
4912
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js"(exports, module) {
|
4913
|
-
var numeric = /^[0-9]+$/;
|
4914
|
-
var compareIdentifiers = (a, b) => {
|
4915
|
-
const anum = numeric.test(a);
|
4916
|
-
const bnum = numeric.test(b);
|
4917
|
-
if (anum && bnum) {
|
4918
|
-
a = +a;
|
4919
|
-
b = +b;
|
4920
|
-
}
|
4921
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
4922
|
-
};
|
4923
|
-
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
4924
|
-
module.exports = {
|
4925
|
-
compareIdentifiers,
|
4926
|
-
rcompareIdentifiers
|
4927
|
-
};
|
4928
|
-
}
|
4929
|
-
});
|
4930
|
-
|
4931
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js
|
4932
|
-
var require_semver = __commonJS({
|
4933
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js"(exports, module) {
|
4934
|
-
var debug = require_debug();
|
4935
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
4936
|
-
var { safeRe: re, t } = require_re();
|
4937
|
-
var parseOptions = require_parse_options();
|
4938
|
-
var { compareIdentifiers } = require_identifiers();
|
4939
|
-
var SemVer = class _SemVer {
|
4940
|
-
constructor(version, options) {
|
4941
|
-
options = parseOptions(options);
|
4942
|
-
if (version instanceof _SemVer) {
|
4943
|
-
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
4944
|
-
return version;
|
4945
|
-
} else {
|
4946
|
-
version = version.version;
|
4947
|
-
}
|
4948
|
-
} else if (typeof version !== "string") {
|
4949
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
4950
|
-
}
|
4951
|
-
if (version.length > MAX_LENGTH) {
|
4952
|
-
throw new TypeError(
|
4953
|
-
`version is longer than ${MAX_LENGTH} characters`
|
4954
|
-
);
|
4955
|
-
}
|
4956
|
-
debug("SemVer", version, options);
|
4957
|
-
this.options = options;
|
4958
|
-
this.loose = !!options.loose;
|
4959
|
-
this.includePrerelease = !!options.includePrerelease;
|
4960
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
4961
|
-
if (!m) {
|
4962
|
-
throw new TypeError(`Invalid Version: ${version}`);
|
4963
|
-
}
|
4964
|
-
this.raw = version;
|
4965
|
-
this.major = +m[1];
|
4966
|
-
this.minor = +m[2];
|
4967
|
-
this.patch = +m[3];
|
4968
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
4969
|
-
throw new TypeError("Invalid major version");
|
4970
|
-
}
|
4971
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
4972
|
-
throw new TypeError("Invalid minor version");
|
4973
|
-
}
|
4974
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
4975
|
-
throw new TypeError("Invalid patch version");
|
4976
|
-
}
|
4977
|
-
if (!m[4]) {
|
4978
|
-
this.prerelease = [];
|
4979
|
-
} else {
|
4980
|
-
this.prerelease = m[4].split(".").map((id) => {
|
4981
|
-
if (/^[0-9]+$/.test(id)) {
|
4982
|
-
const num = +id;
|
4983
|
-
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
4984
|
-
return num;
|
4985
|
-
}
|
4986
|
-
}
|
4987
|
-
return id;
|
4988
|
-
});
|
4989
|
-
}
|
4990
|
-
this.build = m[5] ? m[5].split(".") : [];
|
4991
|
-
this.format();
|
4992
|
-
}
|
4993
|
-
format() {
|
4994
|
-
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
4995
|
-
if (this.prerelease.length) {
|
4996
|
-
this.version += `-${this.prerelease.join(".")}`;
|
4997
|
-
}
|
4998
|
-
return this.version;
|
4999
|
-
}
|
5000
|
-
toString() {
|
5001
|
-
return this.version;
|
5002
|
-
}
|
5003
|
-
compare(other) {
|
5004
|
-
debug("SemVer.compare", this.version, this.options, other);
|
5005
|
-
if (!(other instanceof _SemVer)) {
|
5006
|
-
if (typeof other === "string" && other === this.version) {
|
5007
|
-
return 0;
|
5008
|
-
}
|
5009
|
-
other = new _SemVer(other, this.options);
|
5010
|
-
}
|
5011
|
-
if (other.version === this.version) {
|
5012
|
-
return 0;
|
5013
|
-
}
|
5014
|
-
return this.compareMain(other) || this.comparePre(other);
|
5015
|
-
}
|
5016
|
-
compareMain(other) {
|
5017
|
-
if (!(other instanceof _SemVer)) {
|
5018
|
-
other = new _SemVer(other, this.options);
|
5019
|
-
}
|
5020
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
5021
|
-
}
|
5022
|
-
comparePre(other) {
|
5023
|
-
if (!(other instanceof _SemVer)) {
|
5024
|
-
other = new _SemVer(other, this.options);
|
5025
|
-
}
|
5026
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
5027
|
-
return -1;
|
5028
|
-
} else if (!this.prerelease.length && other.prerelease.length) {
|
5029
|
-
return 1;
|
5030
|
-
} else if (!this.prerelease.length && !other.prerelease.length) {
|
5031
|
-
return 0;
|
5032
|
-
}
|
5033
|
-
let i = 0;
|
5034
|
-
do {
|
5035
|
-
const a = this.prerelease[i];
|
5036
|
-
const b = other.prerelease[i];
|
5037
|
-
debug("prerelease compare", i, a, b);
|
5038
|
-
if (a === void 0 && b === void 0) {
|
5039
|
-
return 0;
|
5040
|
-
} else if (b === void 0) {
|
5041
|
-
return 1;
|
5042
|
-
} else if (a === void 0) {
|
5043
|
-
return -1;
|
5044
|
-
} else if (a === b) {
|
5045
|
-
continue;
|
5046
|
-
} else {
|
5047
|
-
return compareIdentifiers(a, b);
|
5048
|
-
}
|
5049
|
-
} while (++i);
|
5050
|
-
}
|
5051
|
-
compareBuild(other) {
|
5052
|
-
if (!(other instanceof _SemVer)) {
|
5053
|
-
other = new _SemVer(other, this.options);
|
5054
|
-
}
|
5055
|
-
let i = 0;
|
5056
|
-
do {
|
5057
|
-
const a = this.build[i];
|
5058
|
-
const b = other.build[i];
|
5059
|
-
debug("prerelease compare", i, a, b);
|
5060
|
-
if (a === void 0 && b === void 0) {
|
5061
|
-
return 0;
|
5062
|
-
} else if (b === void 0) {
|
5063
|
-
return 1;
|
5064
|
-
} else if (a === void 0) {
|
5065
|
-
return -1;
|
5066
|
-
} else if (a === b) {
|
5067
|
-
continue;
|
5068
|
-
} else {
|
5069
|
-
return compareIdentifiers(a, b);
|
5070
|
-
}
|
5071
|
-
} while (++i);
|
5072
|
-
}
|
5073
|
-
// preminor will bump the version up to the next minor release, and immediately
|
5074
|
-
// down to pre-release. premajor and prepatch work the same way.
|
5075
|
-
inc(release, identifier, identifierBase) {
|
5076
|
-
switch (release) {
|
5077
|
-
case "premajor":
|
5078
|
-
this.prerelease.length = 0;
|
5079
|
-
this.patch = 0;
|
5080
|
-
this.minor = 0;
|
5081
|
-
this.major++;
|
5082
|
-
this.inc("pre", identifier, identifierBase);
|
5083
|
-
break;
|
5084
|
-
case "preminor":
|
5085
|
-
this.prerelease.length = 0;
|
5086
|
-
this.patch = 0;
|
5087
|
-
this.minor++;
|
5088
|
-
this.inc("pre", identifier, identifierBase);
|
5089
|
-
break;
|
5090
|
-
case "prepatch":
|
5091
|
-
this.prerelease.length = 0;
|
5092
|
-
this.inc("patch", identifier, identifierBase);
|
5093
|
-
this.inc("pre", identifier, identifierBase);
|
5094
|
-
break;
|
5095
|
-
case "prerelease":
|
5096
|
-
if (this.prerelease.length === 0) {
|
5097
|
-
this.inc("patch", identifier, identifierBase);
|
5098
|
-
}
|
5099
|
-
this.inc("pre", identifier, identifierBase);
|
5100
|
-
break;
|
5101
|
-
case "major":
|
5102
|
-
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
5103
|
-
this.major++;
|
5104
|
-
}
|
5105
|
-
this.minor = 0;
|
5106
|
-
this.patch = 0;
|
5107
|
-
this.prerelease = [];
|
5108
|
-
break;
|
5109
|
-
case "minor":
|
5110
|
-
if (this.patch !== 0 || this.prerelease.length === 0) {
|
5111
|
-
this.minor++;
|
5112
|
-
}
|
5113
|
-
this.patch = 0;
|
5114
|
-
this.prerelease = [];
|
5115
|
-
break;
|
5116
|
-
case "patch":
|
5117
|
-
if (this.prerelease.length === 0) {
|
5118
|
-
this.patch++;
|
5119
|
-
}
|
5120
|
-
this.prerelease = [];
|
5121
|
-
break;
|
5122
|
-
case "pre": {
|
5123
|
-
const base = Number(identifierBase) ? 1 : 0;
|
5124
|
-
if (!identifier && identifierBase === false) {
|
5125
|
-
throw new Error("invalid increment argument: identifier is empty");
|
5126
|
-
}
|
5127
|
-
if (this.prerelease.length === 0) {
|
5128
|
-
this.prerelease = [base];
|
5129
|
-
} else {
|
5130
|
-
let i = this.prerelease.length;
|
5131
|
-
while (--i >= 0) {
|
5132
|
-
if (typeof this.prerelease[i] === "number") {
|
5133
|
-
this.prerelease[i]++;
|
5134
|
-
i = -2;
|
5135
|
-
}
|
5136
|
-
}
|
5137
|
-
if (i === -1) {
|
5138
|
-
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
5139
|
-
throw new Error("invalid increment argument: identifier already exists");
|
5140
|
-
}
|
5141
|
-
this.prerelease.push(base);
|
5142
|
-
}
|
5143
|
-
}
|
5144
|
-
if (identifier) {
|
5145
|
-
let prerelease = [identifier, base];
|
5146
|
-
if (identifierBase === false) {
|
5147
|
-
prerelease = [identifier];
|
5148
|
-
}
|
5149
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
5150
|
-
if (isNaN(this.prerelease[1])) {
|
5151
|
-
this.prerelease = prerelease;
|
5152
|
-
}
|
5153
|
-
} else {
|
5154
|
-
this.prerelease = prerelease;
|
5155
|
-
}
|
5156
|
-
}
|
5157
|
-
break;
|
5158
|
-
}
|
5159
|
-
default:
|
5160
|
-
throw new Error(`invalid increment argument: ${release}`);
|
5161
|
-
}
|
5162
|
-
this.raw = this.format();
|
5163
|
-
if (this.build.length) {
|
5164
|
-
this.raw += `+${this.build.join(".")}`;
|
5165
|
-
}
|
5166
|
-
return this;
|
5167
|
-
}
|
5168
|
-
};
|
5169
|
-
module.exports = SemVer;
|
5170
|
-
}
|
5171
|
-
});
|
5172
|
-
|
5173
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js
|
5174
|
-
var require_parse = __commonJS({
|
5175
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js"(exports, module) {
|
5176
|
-
var SemVer = require_semver();
|
5177
|
-
var parse = (version, options, throwErrors = false) => {
|
5178
|
-
if (version instanceof SemVer) {
|
5179
|
-
return version;
|
5180
|
-
}
|
5181
|
-
try {
|
5182
|
-
return new SemVer(version, options);
|
5183
|
-
} catch (er) {
|
5184
|
-
if (!throwErrors) {
|
5185
|
-
return null;
|
5186
|
-
}
|
5187
|
-
throw er;
|
5188
|
-
}
|
5189
|
-
};
|
5190
|
-
module.exports = parse;
|
5191
|
-
}
|
5192
|
-
});
|
5193
|
-
|
5194
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js
|
5195
|
-
var require_valid = __commonJS({
|
5196
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js"(exports, module) {
|
5197
|
-
var parse = require_parse();
|
5198
|
-
var valid = (version, options) => {
|
5199
|
-
const v = parse(version, options);
|
5200
|
-
return v ? v.version : null;
|
5201
|
-
};
|
5202
|
-
module.exports = valid;
|
5203
|
-
}
|
5204
|
-
});
|
5205
|
-
|
5206
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js
|
5207
|
-
var require_clean = __commonJS({
|
5208
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js"(exports, module) {
|
5209
|
-
var parse = require_parse();
|
5210
|
-
var clean = (version, options) => {
|
5211
|
-
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
5212
|
-
return s ? s.version : null;
|
5213
|
-
};
|
5214
|
-
module.exports = clean;
|
5215
|
-
}
|
5216
|
-
});
|
5217
|
-
|
5218
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js
|
5219
|
-
var require_inc = __commonJS({
|
5220
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js"(exports, module) {
|
5221
|
-
var SemVer = require_semver();
|
5222
|
-
var inc = (version, release, options, identifier, identifierBase) => {
|
5223
|
-
if (typeof options === "string") {
|
5224
|
-
identifierBase = identifier;
|
5225
|
-
identifier = options;
|
5226
|
-
options = void 0;
|
5227
|
-
}
|
5228
|
-
try {
|
5229
|
-
return new SemVer(
|
5230
|
-
version instanceof SemVer ? version.version : version,
|
5231
|
-
options
|
5232
|
-
).inc(release, identifier, identifierBase).version;
|
5233
|
-
} catch (er) {
|
5234
|
-
return null;
|
5235
|
-
}
|
5236
|
-
};
|
5237
|
-
module.exports = inc;
|
5238
|
-
}
|
5239
|
-
});
|
5240
|
-
|
5241
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js
|
5242
|
-
var require_diff = __commonJS({
|
5243
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js"(exports, module) {
|
5244
|
-
var parse = require_parse();
|
5245
|
-
var diff = (version1, version2) => {
|
5246
|
-
const v1 = parse(version1, null, true);
|
5247
|
-
const v2 = parse(version2, null, true);
|
5248
|
-
const comparison = v1.compare(v2);
|
5249
|
-
if (comparison === 0) {
|
5250
|
-
return null;
|
5251
|
-
}
|
5252
|
-
const v1Higher = comparison > 0;
|
5253
|
-
const highVersion = v1Higher ? v1 : v2;
|
5254
|
-
const lowVersion = v1Higher ? v2 : v1;
|
5255
|
-
const highHasPre = !!highVersion.prerelease.length;
|
5256
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
5257
|
-
if (lowHasPre && !highHasPre) {
|
5258
|
-
if (!lowVersion.patch && !lowVersion.minor) {
|
5259
|
-
return "major";
|
5260
|
-
}
|
5261
|
-
if (highVersion.patch) {
|
5262
|
-
return "patch";
|
5263
|
-
}
|
5264
|
-
if (highVersion.minor) {
|
5265
|
-
return "minor";
|
5266
|
-
}
|
5267
|
-
return "major";
|
5268
|
-
}
|
5269
|
-
const prefix = highHasPre ? "pre" : "";
|
5270
|
-
if (v1.major !== v2.major) {
|
5271
|
-
return prefix + "major";
|
5272
|
-
}
|
5273
|
-
if (v1.minor !== v2.minor) {
|
5274
|
-
return prefix + "minor";
|
5275
|
-
}
|
5276
|
-
if (v1.patch !== v2.patch) {
|
5277
|
-
return prefix + "patch";
|
5278
|
-
}
|
5279
|
-
return "prerelease";
|
5280
|
-
};
|
5281
|
-
module.exports = diff;
|
5282
|
-
}
|
5283
|
-
});
|
5284
|
-
|
5285
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js
|
5286
|
-
var require_major = __commonJS({
|
5287
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js"(exports, module) {
|
5288
|
-
var SemVer = require_semver();
|
5289
|
-
var major = (a, loose) => new SemVer(a, loose).major;
|
5290
|
-
module.exports = major;
|
5291
|
-
}
|
5292
|
-
});
|
5293
|
-
|
5294
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js
|
5295
|
-
var require_minor = __commonJS({
|
5296
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js"(exports, module) {
|
5297
|
-
var SemVer = require_semver();
|
5298
|
-
var minor = (a, loose) => new SemVer(a, loose).minor;
|
5299
|
-
module.exports = minor;
|
5300
|
-
}
|
5301
|
-
});
|
5302
|
-
|
5303
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js
|
5304
|
-
var require_patch = __commonJS({
|
5305
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js"(exports, module) {
|
5306
|
-
var SemVer = require_semver();
|
5307
|
-
var patch = (a, loose) => new SemVer(a, loose).patch;
|
5308
|
-
module.exports = patch;
|
5309
|
-
}
|
5310
|
-
});
|
5311
|
-
|
5312
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js
|
5313
|
-
var require_prerelease = __commonJS({
|
5314
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js"(exports, module) {
|
5315
|
-
var parse = require_parse();
|
5316
|
-
var prerelease = (version, options) => {
|
5317
|
-
const parsed = parse(version, options);
|
5318
|
-
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
5319
|
-
};
|
5320
|
-
module.exports = prerelease;
|
5321
|
-
}
|
5322
|
-
});
|
5323
|
-
|
5324
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js
|
5325
|
-
var require_compare = __commonJS({
|
5326
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js"(exports, module) {
|
5327
|
-
var SemVer = require_semver();
|
5328
|
-
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
5329
|
-
module.exports = compare;
|
5330
|
-
}
|
5331
|
-
});
|
5332
|
-
|
5333
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js
|
5334
|
-
var require_rcompare = __commonJS({
|
5335
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js"(exports, module) {
|
5336
|
-
var compare = require_compare();
|
5337
|
-
var rcompare = (a, b, loose) => compare(b, a, loose);
|
5338
|
-
module.exports = rcompare;
|
5339
|
-
}
|
5340
|
-
});
|
5341
|
-
|
5342
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js
|
5343
|
-
var require_compare_loose = __commonJS({
|
5344
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
5345
|
-
var compare = require_compare();
|
5346
|
-
var compareLoose = (a, b) => compare(a, b, true);
|
5347
|
-
module.exports = compareLoose;
|
5348
|
-
}
|
5349
|
-
});
|
5350
|
-
|
5351
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js
|
5352
|
-
var require_compare_build = __commonJS({
|
5353
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js"(exports, module) {
|
5354
|
-
var SemVer = require_semver();
|
5355
|
-
var compareBuild = (a, b, loose) => {
|
5356
|
-
const versionA = new SemVer(a, loose);
|
5357
|
-
const versionB = new SemVer(b, loose);
|
5358
|
-
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
5359
|
-
};
|
5360
|
-
module.exports = compareBuild;
|
5361
|
-
}
|
5362
|
-
});
|
5363
|
-
|
5364
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js
|
5365
|
-
var require_sort = __commonJS({
|
5366
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js"(exports, module) {
|
5367
|
-
var compareBuild = require_compare_build();
|
5368
|
-
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
5369
|
-
module.exports = sort;
|
5370
|
-
}
|
5371
|
-
});
|
5372
|
-
|
5373
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js
|
5374
|
-
var require_rsort = __commonJS({
|
5375
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js"(exports, module) {
|
5376
|
-
var compareBuild = require_compare_build();
|
5377
|
-
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
5378
|
-
module.exports = rsort;
|
5379
|
-
}
|
5380
|
-
});
|
5381
|
-
|
5382
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js
|
5383
|
-
var require_gt = __commonJS({
|
5384
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js"(exports, module) {
|
5385
|
-
var compare = require_compare();
|
5386
|
-
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
5387
|
-
module.exports = gt;
|
5388
|
-
}
|
5389
|
-
});
|
5390
|
-
|
5391
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js
|
5392
|
-
var require_lt = __commonJS({
|
5393
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js"(exports, module) {
|
5394
|
-
var compare = require_compare();
|
5395
|
-
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
5396
|
-
module.exports = lt;
|
5397
|
-
}
|
5398
|
-
});
|
5399
|
-
|
5400
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js
|
5401
|
-
var require_eq = __commonJS({
|
5402
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js"(exports, module) {
|
5403
|
-
var compare = require_compare();
|
5404
|
-
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
5405
|
-
module.exports = eq;
|
5406
|
-
}
|
5407
|
-
});
|
5408
|
-
|
5409
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js
|
5410
|
-
var require_neq = __commonJS({
|
5411
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js"(exports, module) {
|
5412
|
-
var compare = require_compare();
|
5413
|
-
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
5414
|
-
module.exports = neq;
|
5415
|
-
}
|
5416
|
-
});
|
5417
|
-
|
5418
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js
|
5419
|
-
var require_gte = __commonJS({
|
5420
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js"(exports, module) {
|
5421
|
-
var compare = require_compare();
|
5422
|
-
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
5423
|
-
module.exports = gte;
|
5424
|
-
}
|
5425
|
-
});
|
5426
|
-
|
5427
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js
|
5428
|
-
var require_lte = __commonJS({
|
5429
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js"(exports, module) {
|
5430
|
-
var compare = require_compare();
|
5431
|
-
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
5432
|
-
module.exports = lte;
|
5433
|
-
}
|
5434
|
-
});
|
5435
|
-
|
5436
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js
|
5437
|
-
var require_cmp = __commonJS({
|
5438
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js"(exports, module) {
|
5439
|
-
var eq = require_eq();
|
5440
|
-
var neq = require_neq();
|
5441
|
-
var gt = require_gt();
|
5442
|
-
var gte = require_gte();
|
5443
|
-
var lt = require_lt();
|
5444
|
-
var lte = require_lte();
|
5445
|
-
var cmp = (a, op, b, loose) => {
|
5446
|
-
switch (op) {
|
5447
|
-
case "===":
|
5448
|
-
if (typeof a === "object") {
|
5449
|
-
a = a.version;
|
5450
|
-
}
|
5451
|
-
if (typeof b === "object") {
|
5452
|
-
b = b.version;
|
5453
|
-
}
|
5454
|
-
return a === b;
|
5455
|
-
case "!==":
|
5456
|
-
if (typeof a === "object") {
|
5457
|
-
a = a.version;
|
5458
|
-
}
|
5459
|
-
if (typeof b === "object") {
|
5460
|
-
b = b.version;
|
5461
|
-
}
|
5462
|
-
return a !== b;
|
5463
|
-
case "":
|
5464
|
-
case "=":
|
5465
|
-
case "==":
|
5466
|
-
return eq(a, b, loose);
|
5467
|
-
case "!=":
|
5468
|
-
return neq(a, b, loose);
|
5469
|
-
case ">":
|
5470
|
-
return gt(a, b, loose);
|
5471
|
-
case ">=":
|
5472
|
-
return gte(a, b, loose);
|
5473
|
-
case "<":
|
5474
|
-
return lt(a, b, loose);
|
5475
|
-
case "<=":
|
5476
|
-
return lte(a, b, loose);
|
5477
|
-
default:
|
5478
|
-
throw new TypeError(`Invalid operator: ${op}`);
|
5479
|
-
}
|
5480
|
-
};
|
5481
|
-
module.exports = cmp;
|
5482
|
-
}
|
5483
|
-
});
|
5484
|
-
|
5485
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js
|
5486
|
-
var require_coerce = __commonJS({
|
5487
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js"(exports, module) {
|
5488
|
-
var SemVer = require_semver();
|
5489
|
-
var parse = require_parse();
|
5490
|
-
var { safeRe: re, t } = require_re();
|
5491
|
-
var coerce = (version, options) => {
|
5492
|
-
if (version instanceof SemVer) {
|
5493
|
-
return version;
|
5494
|
-
}
|
5495
|
-
if (typeof version === "number") {
|
5496
|
-
version = String(version);
|
5497
|
-
}
|
5498
|
-
if (typeof version !== "string") {
|
5499
|
-
return null;
|
5500
|
-
}
|
5501
|
-
options = options || {};
|
5502
|
-
let match2 = null;
|
5503
|
-
if (!options.rtl) {
|
5504
|
-
match2 = version.match(re[t.COERCE]);
|
5505
|
-
} else {
|
5506
|
-
let next;
|
5507
|
-
while ((next = re[t.COERCERTL].exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) {
|
5508
|
-
if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
|
5509
|
-
match2 = next;
|
5510
|
-
}
|
5511
|
-
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
|
5512
|
-
}
|
5513
|
-
re[t.COERCERTL].lastIndex = -1;
|
5514
|
-
}
|
5515
|
-
if (match2 === null) {
|
5516
|
-
return null;
|
5517
|
-
}
|
5518
|
-
return parse(`${match2[2]}.${match2[3] || "0"}.${match2[4] || "0"}`, options);
|
5519
|
-
};
|
5520
|
-
module.exports = coerce;
|
5521
|
-
}
|
5522
|
-
});
|
5523
|
-
|
5524
|
-
// node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js
|
5525
|
-
var require_iterator = __commonJS({
|
5526
|
-
"node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js"(exports, module) {
|
5527
|
-
"use strict";
|
5528
|
-
module.exports = function(Yallist) {
|
5529
|
-
Yallist.prototype[Symbol.iterator] = function* () {
|
5530
|
-
for (let walker = this.head; walker; walker = walker.next) {
|
5531
|
-
yield walker.value;
|
5532
|
-
}
|
5533
|
-
};
|
5534
|
-
};
|
5535
|
-
}
|
5536
|
-
});
|
5537
|
-
|
5538
|
-
// node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js
|
5539
|
-
var require_yallist = __commonJS({
|
5540
|
-
"node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js"(exports, module) {
|
5541
|
-
"use strict";
|
5542
|
-
module.exports = Yallist;
|
5543
|
-
Yallist.Node = Node;
|
5544
|
-
Yallist.create = Yallist;
|
5545
|
-
function Yallist(list) {
|
5546
|
-
var self2 = this;
|
5547
|
-
if (!(self2 instanceof Yallist)) {
|
5548
|
-
self2 = new Yallist();
|
5549
|
-
}
|
5550
|
-
self2.tail = null;
|
5551
|
-
self2.head = null;
|
5552
|
-
self2.length = 0;
|
5553
|
-
if (list && typeof list.forEach === "function") {
|
5554
|
-
list.forEach(function(item) {
|
5555
|
-
self2.push(item);
|
5556
|
-
});
|
5557
|
-
} else if (arguments.length > 0) {
|
5558
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
5559
|
-
self2.push(arguments[i]);
|
5560
|
-
}
|
5561
|
-
}
|
5562
|
-
return self2;
|
5563
|
-
}
|
5564
|
-
Yallist.prototype.removeNode = function(node) {
|
5565
|
-
if (node.list !== this) {
|
5566
|
-
throw new Error("removing node which does not belong to this list");
|
5567
|
-
}
|
5568
|
-
var next = node.next;
|
5569
|
-
var prev = node.prev;
|
5570
|
-
if (next) {
|
5571
|
-
next.prev = prev;
|
5572
|
-
}
|
5573
|
-
if (prev) {
|
5574
|
-
prev.next = next;
|
5575
|
-
}
|
5576
|
-
if (node === this.head) {
|
5577
|
-
this.head = next;
|
5578
|
-
}
|
5579
|
-
if (node === this.tail) {
|
5580
|
-
this.tail = prev;
|
5581
|
-
}
|
5582
|
-
node.list.length--;
|
5583
|
-
node.next = null;
|
5584
|
-
node.prev = null;
|
5585
|
-
node.list = null;
|
5586
|
-
return next;
|
5587
|
-
};
|
5588
|
-
Yallist.prototype.unshiftNode = function(node) {
|
5589
|
-
if (node === this.head) {
|
5590
|
-
return;
|
5591
|
-
}
|
5592
|
-
if (node.list) {
|
5593
|
-
node.list.removeNode(node);
|
5594
|
-
}
|
5595
|
-
var head = this.head;
|
5596
|
-
node.list = this;
|
5597
|
-
node.next = head;
|
5598
|
-
if (head) {
|
5599
|
-
head.prev = node;
|
5600
|
-
}
|
5601
|
-
this.head = node;
|
5602
|
-
if (!this.tail) {
|
5603
|
-
this.tail = node;
|
5604
|
-
}
|
5605
|
-
this.length++;
|
5606
|
-
};
|
5607
|
-
Yallist.prototype.pushNode = function(node) {
|
5608
|
-
if (node === this.tail) {
|
5609
|
-
return;
|
5610
|
-
}
|
5611
|
-
if (node.list) {
|
5612
|
-
node.list.removeNode(node);
|
5613
|
-
}
|
5614
|
-
var tail = this.tail;
|
5615
|
-
node.list = this;
|
5616
|
-
node.prev = tail;
|
5617
|
-
if (tail) {
|
5618
|
-
tail.next = node;
|
5619
|
-
}
|
5620
|
-
this.tail = node;
|
5621
|
-
if (!this.head) {
|
5622
|
-
this.head = node;
|
5623
|
-
}
|
5624
|
-
this.length++;
|
5625
|
-
};
|
5626
|
-
Yallist.prototype.push = function() {
|
5627
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
5628
|
-
push(this, arguments[i]);
|
5629
|
-
}
|
5630
|
-
return this.length;
|
5631
|
-
};
|
5632
|
-
Yallist.prototype.unshift = function() {
|
5633
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
5634
|
-
unshift(this, arguments[i]);
|
5635
|
-
}
|
5636
|
-
return this.length;
|
5637
|
-
};
|
5638
|
-
Yallist.prototype.pop = function() {
|
5639
|
-
if (!this.tail) {
|
5640
|
-
return void 0;
|
5641
|
-
}
|
5642
|
-
var res = this.tail.value;
|
5643
|
-
this.tail = this.tail.prev;
|
5644
|
-
if (this.tail) {
|
5645
|
-
this.tail.next = null;
|
5646
|
-
} else {
|
5647
|
-
this.head = null;
|
5648
|
-
}
|
5649
|
-
this.length--;
|
5650
|
-
return res;
|
5651
|
-
};
|
5652
|
-
Yallist.prototype.shift = function() {
|
5653
|
-
if (!this.head) {
|
5654
|
-
return void 0;
|
5655
|
-
}
|
5656
|
-
var res = this.head.value;
|
5657
|
-
this.head = this.head.next;
|
5658
|
-
if (this.head) {
|
5659
|
-
this.head.prev = null;
|
5660
|
-
} else {
|
5661
|
-
this.tail = null;
|
5662
|
-
}
|
5663
|
-
this.length--;
|
5664
|
-
return res;
|
5665
|
-
};
|
5666
|
-
Yallist.prototype.forEach = function(fn, thisp) {
|
5667
|
-
thisp = thisp || this;
|
5668
|
-
for (var walker = this.head, i = 0; walker !== null; i++) {
|
5669
|
-
fn.call(thisp, walker.value, i, this);
|
5670
|
-
walker = walker.next;
|
5671
|
-
}
|
5672
|
-
};
|
5673
|
-
Yallist.prototype.forEachReverse = function(fn, thisp) {
|
5674
|
-
thisp = thisp || this;
|
5675
|
-
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
5676
|
-
fn.call(thisp, walker.value, i, this);
|
5677
|
-
walker = walker.prev;
|
5678
|
-
}
|
5679
|
-
};
|
5680
|
-
Yallist.prototype.get = function(n) {
|
5681
|
-
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
5682
|
-
walker = walker.next;
|
5683
|
-
}
|
5684
|
-
if (i === n && walker !== null) {
|
5685
|
-
return walker.value;
|
5686
|
-
}
|
5687
|
-
};
|
5688
|
-
Yallist.prototype.getReverse = function(n) {
|
5689
|
-
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
5690
|
-
walker = walker.prev;
|
5691
|
-
}
|
5692
|
-
if (i === n && walker !== null) {
|
5693
|
-
return walker.value;
|
5694
|
-
}
|
5695
|
-
};
|
5696
|
-
Yallist.prototype.map = function(fn, thisp) {
|
5697
|
-
thisp = thisp || this;
|
5698
|
-
var res = new Yallist();
|
5699
|
-
for (var walker = this.head; walker !== null; ) {
|
5700
|
-
res.push(fn.call(thisp, walker.value, this));
|
5701
|
-
walker = walker.next;
|
5702
|
-
}
|
5703
|
-
return res;
|
5704
|
-
};
|
5705
|
-
Yallist.prototype.mapReverse = function(fn, thisp) {
|
5706
|
-
thisp = thisp || this;
|
5707
|
-
var res = new Yallist();
|
5708
|
-
for (var walker = this.tail; walker !== null; ) {
|
5709
|
-
res.push(fn.call(thisp, walker.value, this));
|
5710
|
-
walker = walker.prev;
|
5711
|
-
}
|
5712
|
-
return res;
|
5713
|
-
};
|
5714
|
-
Yallist.prototype.reduce = function(fn, initial) {
|
5715
|
-
var acc;
|
5716
|
-
var walker = this.head;
|
5717
|
-
if (arguments.length > 1) {
|
5718
|
-
acc = initial;
|
5719
|
-
} else if (this.head) {
|
5720
|
-
walker = this.head.next;
|
5721
|
-
acc = this.head.value;
|
5722
|
-
} else {
|
5723
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
5724
|
-
}
|
5725
|
-
for (var i = 0; walker !== null; i++) {
|
5726
|
-
acc = fn(acc, walker.value, i);
|
5727
|
-
walker = walker.next;
|
5728
|
-
}
|
5729
|
-
return acc;
|
5730
|
-
};
|
5731
|
-
Yallist.prototype.reduceReverse = function(fn, initial) {
|
5732
|
-
var acc;
|
5733
|
-
var walker = this.tail;
|
5734
|
-
if (arguments.length > 1) {
|
5735
|
-
acc = initial;
|
5736
|
-
} else if (this.tail) {
|
5737
|
-
walker = this.tail.prev;
|
5738
|
-
acc = this.tail.value;
|
5739
|
-
} else {
|
5740
|
-
throw new TypeError("Reduce of empty list with no initial value");
|
5741
|
-
}
|
5742
|
-
for (var i = this.length - 1; walker !== null; i--) {
|
5743
|
-
acc = fn(acc, walker.value, i);
|
5744
|
-
walker = walker.prev;
|
5745
|
-
}
|
5746
|
-
return acc;
|
5747
|
-
};
|
5748
|
-
Yallist.prototype.toArray = function() {
|
5749
|
-
var arr = new Array(this.length);
|
5750
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
5751
|
-
arr[i] = walker.value;
|
5752
|
-
walker = walker.next;
|
5753
|
-
}
|
5754
|
-
return arr;
|
5755
|
-
};
|
5756
|
-
Yallist.prototype.toArrayReverse = function() {
|
5757
|
-
var arr = new Array(this.length);
|
5758
|
-
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
5759
|
-
arr[i] = walker.value;
|
5760
|
-
walker = walker.prev;
|
5761
|
-
}
|
5762
|
-
return arr;
|
5763
|
-
};
|
5764
|
-
Yallist.prototype.slice = function(from, to) {
|
5765
|
-
to = to || this.length;
|
5766
|
-
if (to < 0) {
|
5767
|
-
to += this.length;
|
5768
|
-
}
|
5769
|
-
from = from || 0;
|
5770
|
-
if (from < 0) {
|
5771
|
-
from += this.length;
|
5772
|
-
}
|
5773
|
-
var ret = new Yallist();
|
5774
|
-
if (to < from || to < 0) {
|
5775
|
-
return ret;
|
5776
|
-
}
|
5777
|
-
if (from < 0) {
|
5778
|
-
from = 0;
|
5779
|
-
}
|
5780
|
-
if (to > this.length) {
|
5781
|
-
to = this.length;
|
5782
|
-
}
|
5783
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
5784
|
-
walker = walker.next;
|
5785
|
-
}
|
5786
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
5787
|
-
ret.push(walker.value);
|
5788
|
-
}
|
5789
|
-
return ret;
|
5790
|
-
};
|
5791
|
-
Yallist.prototype.sliceReverse = function(from, to) {
|
5792
|
-
to = to || this.length;
|
5793
|
-
if (to < 0) {
|
5794
|
-
to += this.length;
|
5795
|
-
}
|
5796
|
-
from = from || 0;
|
5797
|
-
if (from < 0) {
|
5798
|
-
from += this.length;
|
5799
|
-
}
|
5800
|
-
var ret = new Yallist();
|
5801
|
-
if (to < from || to < 0) {
|
5802
|
-
return ret;
|
5803
|
-
}
|
5804
|
-
if (from < 0) {
|
5805
|
-
from = 0;
|
5806
|
-
}
|
5807
|
-
if (to > this.length) {
|
5808
|
-
to = this.length;
|
5809
|
-
}
|
5810
|
-
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
5811
|
-
walker = walker.prev;
|
5812
|
-
}
|
5813
|
-
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
5814
|
-
ret.push(walker.value);
|
5815
|
-
}
|
5816
|
-
return ret;
|
5817
|
-
};
|
5818
|
-
Yallist.prototype.splice = function(start, deleteCount, ...nodes) {
|
5819
|
-
if (start > this.length) {
|
5820
|
-
start = this.length - 1;
|
5821
|
-
}
|
5822
|
-
if (start < 0) {
|
5823
|
-
start = this.length + start;
|
5824
|
-
}
|
5825
|
-
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
5826
|
-
walker = walker.next;
|
5827
|
-
}
|
5828
|
-
var ret = [];
|
5829
|
-
for (var i = 0; walker && i < deleteCount; i++) {
|
5830
|
-
ret.push(walker.value);
|
5831
|
-
walker = this.removeNode(walker);
|
5832
|
-
}
|
5833
|
-
if (walker === null) {
|
5834
|
-
walker = this.tail;
|
5835
|
-
}
|
5836
|
-
if (walker !== this.head && walker !== this.tail) {
|
5837
|
-
walker = walker.prev;
|
5838
|
-
}
|
5839
|
-
for (var i = 0; i < nodes.length; i++) {
|
5840
|
-
walker = insert(this, walker, nodes[i]);
|
5841
|
-
}
|
5842
|
-
return ret;
|
5843
|
-
};
|
5844
|
-
Yallist.prototype.reverse = function() {
|
5845
|
-
var head = this.head;
|
5846
|
-
var tail = this.tail;
|
5847
|
-
for (var walker = head; walker !== null; walker = walker.prev) {
|
5848
|
-
var p = walker.prev;
|
5849
|
-
walker.prev = walker.next;
|
5850
|
-
walker.next = p;
|
5851
|
-
}
|
5852
|
-
this.head = tail;
|
5853
|
-
this.tail = head;
|
5854
|
-
return this;
|
5855
|
-
};
|
5856
|
-
function insert(self2, node, value) {
|
5857
|
-
var inserted = node === self2.head ? new Node(value, null, node, self2) : new Node(value, node, node.next, self2);
|
5858
|
-
if (inserted.next === null) {
|
5859
|
-
self2.tail = inserted;
|
5860
|
-
}
|
5861
|
-
if (inserted.prev === null) {
|
5862
|
-
self2.head = inserted;
|
5863
|
-
}
|
5864
|
-
self2.length++;
|
5865
|
-
return inserted;
|
5866
|
-
}
|
5867
|
-
function push(self2, item) {
|
5868
|
-
self2.tail = new Node(item, self2.tail, null, self2);
|
5869
|
-
if (!self2.head) {
|
5870
|
-
self2.head = self2.tail;
|
5871
|
-
}
|
5872
|
-
self2.length++;
|
5873
|
-
}
|
5874
|
-
function unshift(self2, item) {
|
5875
|
-
self2.head = new Node(item, null, self2.head, self2);
|
5876
|
-
if (!self2.tail) {
|
5877
|
-
self2.tail = self2.head;
|
5878
|
-
}
|
5879
|
-
self2.length++;
|
5880
|
-
}
|
5881
|
-
function Node(value, prev, next, list) {
|
5882
|
-
if (!(this instanceof Node)) {
|
5883
|
-
return new Node(value, prev, next, list);
|
5884
|
-
}
|
5885
|
-
this.list = list;
|
5886
|
-
this.value = value;
|
5887
|
-
if (prev) {
|
5888
|
-
prev.next = this;
|
5889
|
-
this.prev = prev;
|
5890
|
-
} else {
|
5891
|
-
this.prev = null;
|
5892
|
-
}
|
5893
|
-
if (next) {
|
5894
|
-
next.prev = this;
|
5895
|
-
this.next = next;
|
5896
|
-
} else {
|
5897
|
-
this.next = null;
|
5898
|
-
}
|
5899
|
-
}
|
5900
|
-
try {
|
5901
|
-
require_iterator()(Yallist);
|
5902
|
-
} catch (er) {
|
5903
|
-
}
|
5904
|
-
}
|
5905
|
-
});
|
5906
|
-
|
5907
|
-
// node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js
|
5908
|
-
var require_lru_cache = __commonJS({
|
5909
|
-
"node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js"(exports, module) {
|
5910
|
-
"use strict";
|
5911
|
-
var Yallist = require_yallist();
|
5912
|
-
var MAX = Symbol("max");
|
5913
|
-
var LENGTH = Symbol("length");
|
5914
|
-
var LENGTH_CALCULATOR = Symbol("lengthCalculator");
|
5915
|
-
var ALLOW_STALE = Symbol("allowStale");
|
5916
|
-
var MAX_AGE = Symbol("maxAge");
|
5917
|
-
var DISPOSE = Symbol("dispose");
|
5918
|
-
var NO_DISPOSE_ON_SET = Symbol("noDisposeOnSet");
|
5919
|
-
var LRU_LIST = Symbol("lruList");
|
5920
|
-
var CACHE = Symbol("cache");
|
5921
|
-
var UPDATE_AGE_ON_GET = Symbol("updateAgeOnGet");
|
5922
|
-
var naiveLength = () => 1;
|
5923
|
-
var LRUCache = class {
|
5924
|
-
constructor(options) {
|
5925
|
-
if (typeof options === "number")
|
5926
|
-
options = { max: options };
|
5927
|
-
if (!options)
|
5928
|
-
options = {};
|
5929
|
-
if (options.max && (typeof options.max !== "number" || options.max < 0))
|
5930
|
-
throw new TypeError("max must be a non-negative number");
|
5931
|
-
const max = this[MAX] = options.max || Infinity;
|
5932
|
-
const lc = options.length || naiveLength;
|
5933
|
-
this[LENGTH_CALCULATOR] = typeof lc !== "function" ? naiveLength : lc;
|
5934
|
-
this[ALLOW_STALE] = options.stale || false;
|
5935
|
-
if (options.maxAge && typeof options.maxAge !== "number")
|
5936
|
-
throw new TypeError("maxAge must be a number");
|
5937
|
-
this[MAX_AGE] = options.maxAge || 0;
|
5938
|
-
this[DISPOSE] = options.dispose;
|
5939
|
-
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
5940
|
-
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
5941
|
-
this.reset();
|
5942
|
-
}
|
5943
|
-
// resize the cache when the max changes.
|
5944
|
-
set max(mL) {
|
5945
|
-
if (typeof mL !== "number" || mL < 0)
|
5946
|
-
throw new TypeError("max must be a non-negative number");
|
5947
|
-
this[MAX] = mL || Infinity;
|
5948
|
-
trim(this);
|
5949
|
-
}
|
5950
|
-
get max() {
|
5951
|
-
return this[MAX];
|
5952
|
-
}
|
5953
|
-
set allowStale(allowStale) {
|
5954
|
-
this[ALLOW_STALE] = !!allowStale;
|
5955
|
-
}
|
5956
|
-
get allowStale() {
|
5957
|
-
return this[ALLOW_STALE];
|
5958
|
-
}
|
5959
|
-
set maxAge(mA) {
|
5960
|
-
if (typeof mA !== "number")
|
5961
|
-
throw new TypeError("maxAge must be a non-negative number");
|
5962
|
-
this[MAX_AGE] = mA;
|
5963
|
-
trim(this);
|
5964
|
-
}
|
5965
|
-
get maxAge() {
|
5966
|
-
return this[MAX_AGE];
|
5967
|
-
}
|
5968
|
-
// resize the cache when the lengthCalculator changes.
|
5969
|
-
set lengthCalculator(lC) {
|
5970
|
-
if (typeof lC !== "function")
|
5971
|
-
lC = naiveLength;
|
5972
|
-
if (lC !== this[LENGTH_CALCULATOR]) {
|
5973
|
-
this[LENGTH_CALCULATOR] = lC;
|
5974
|
-
this[LENGTH] = 0;
|
5975
|
-
this[LRU_LIST].forEach((hit) => {
|
5976
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
5977
|
-
this[LENGTH] += hit.length;
|
5978
|
-
});
|
5979
|
-
}
|
5980
|
-
trim(this);
|
5981
|
-
}
|
5982
|
-
get lengthCalculator() {
|
5983
|
-
return this[LENGTH_CALCULATOR];
|
5984
|
-
}
|
5985
|
-
get length() {
|
5986
|
-
return this[LENGTH];
|
5987
|
-
}
|
5988
|
-
get itemCount() {
|
5989
|
-
return this[LRU_LIST].length;
|
5990
|
-
}
|
5991
|
-
rforEach(fn, thisp) {
|
5992
|
-
thisp = thisp || this;
|
5993
|
-
for (let walker = this[LRU_LIST].tail; walker !== null; ) {
|
5994
|
-
const prev = walker.prev;
|
5995
|
-
forEachStep(this, fn, walker, thisp);
|
5996
|
-
walker = prev;
|
5997
|
-
}
|
5998
|
-
}
|
5999
|
-
forEach(fn, thisp) {
|
6000
|
-
thisp = thisp || this;
|
6001
|
-
for (let walker = this[LRU_LIST].head; walker !== null; ) {
|
6002
|
-
const next = walker.next;
|
6003
|
-
forEachStep(this, fn, walker, thisp);
|
6004
|
-
walker = next;
|
6005
|
-
}
|
6006
|
-
}
|
6007
|
-
keys() {
|
6008
|
-
return this[LRU_LIST].toArray().map((k) => k.key);
|
6009
|
-
}
|
6010
|
-
values() {
|
6011
|
-
return this[LRU_LIST].toArray().map((k) => k.value);
|
6012
|
-
}
|
6013
|
-
reset() {
|
6014
|
-
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
6015
|
-
this[LRU_LIST].forEach((hit) => this[DISPOSE](hit.key, hit.value));
|
6016
|
-
}
|
6017
|
-
this[CACHE] = /* @__PURE__ */ new Map();
|
6018
|
-
this[LRU_LIST] = new Yallist();
|
6019
|
-
this[LENGTH] = 0;
|
6020
|
-
}
|
6021
|
-
dump() {
|
6022
|
-
return this[LRU_LIST].map((hit) => isStale(this, hit) ? false : {
|
6023
|
-
k: hit.key,
|
6024
|
-
v: hit.value,
|
6025
|
-
e: hit.now + (hit.maxAge || 0)
|
6026
|
-
}).toArray().filter((h) => h);
|
6027
|
-
}
|
6028
|
-
dumpLru() {
|
6029
|
-
return this[LRU_LIST];
|
6030
|
-
}
|
6031
|
-
set(key, value, maxAge) {
|
6032
|
-
maxAge = maxAge || this[MAX_AGE];
|
6033
|
-
if (maxAge && typeof maxAge !== "number")
|
6034
|
-
throw new TypeError("maxAge must be a number");
|
6035
|
-
const now = maxAge ? Date.now() : 0;
|
6036
|
-
const len = this[LENGTH_CALCULATOR](value, key);
|
6037
|
-
if (this[CACHE].has(key)) {
|
6038
|
-
if (len > this[MAX]) {
|
6039
|
-
del(this, this[CACHE].get(key));
|
6040
|
-
return false;
|
6041
|
-
}
|
6042
|
-
const node = this[CACHE].get(key);
|
6043
|
-
const item = node.value;
|
6044
|
-
if (this[DISPOSE]) {
|
6045
|
-
if (!this[NO_DISPOSE_ON_SET])
|
6046
|
-
this[DISPOSE](key, item.value);
|
6047
|
-
}
|
6048
|
-
item.now = now;
|
6049
|
-
item.maxAge = maxAge;
|
6050
|
-
item.value = value;
|
6051
|
-
this[LENGTH] += len - item.length;
|
6052
|
-
item.length = len;
|
6053
|
-
this.get(key);
|
6054
|
-
trim(this);
|
6055
|
-
return true;
|
6056
|
-
}
|
6057
|
-
const hit = new Entry(key, value, len, now, maxAge);
|
6058
|
-
if (hit.length > this[MAX]) {
|
6059
|
-
if (this[DISPOSE])
|
6060
|
-
this[DISPOSE](key, value);
|
6061
|
-
return false;
|
6062
|
-
}
|
6063
|
-
this[LENGTH] += hit.length;
|
6064
|
-
this[LRU_LIST].unshift(hit);
|
6065
|
-
this[CACHE].set(key, this[LRU_LIST].head);
|
6066
|
-
trim(this);
|
6067
|
-
return true;
|
6068
|
-
}
|
6069
|
-
has(key) {
|
6070
|
-
if (!this[CACHE].has(key))
|
6071
|
-
return false;
|
6072
|
-
const hit = this[CACHE].get(key).value;
|
6073
|
-
return !isStale(this, hit);
|
6074
|
-
}
|
6075
|
-
get(key) {
|
6076
|
-
return get(this, key, true);
|
6077
|
-
}
|
6078
|
-
peek(key) {
|
6079
|
-
return get(this, key, false);
|
6080
|
-
}
|
6081
|
-
pop() {
|
6082
|
-
const node = this[LRU_LIST].tail;
|
6083
|
-
if (!node)
|
6084
|
-
return null;
|
6085
|
-
del(this, node);
|
6086
|
-
return node.value;
|
6087
|
-
}
|
6088
|
-
del(key) {
|
6089
|
-
del(this, this[CACHE].get(key));
|
6090
|
-
}
|
6091
|
-
load(arr) {
|
6092
|
-
this.reset();
|
6093
|
-
const now = Date.now();
|
6094
|
-
for (let l = arr.length - 1; l >= 0; l--) {
|
6095
|
-
const hit = arr[l];
|
6096
|
-
const expiresAt = hit.e || 0;
|
6097
|
-
if (expiresAt === 0)
|
6098
|
-
this.set(hit.k, hit.v);
|
6099
|
-
else {
|
6100
|
-
const maxAge = expiresAt - now;
|
6101
|
-
if (maxAge > 0) {
|
6102
|
-
this.set(hit.k, hit.v, maxAge);
|
6103
|
-
}
|
6104
|
-
}
|
6105
|
-
}
|
6106
|
-
}
|
6107
|
-
prune() {
|
6108
|
-
this[CACHE].forEach((value, key) => get(this, key, false));
|
6109
|
-
}
|
6110
|
-
};
|
6111
|
-
var get = (self2, key, doUse) => {
|
6112
|
-
const node = self2[CACHE].get(key);
|
6113
|
-
if (node) {
|
6114
|
-
const hit = node.value;
|
6115
|
-
if (isStale(self2, hit)) {
|
6116
|
-
del(self2, node);
|
6117
|
-
if (!self2[ALLOW_STALE])
|
6118
|
-
return void 0;
|
6119
|
-
} else {
|
6120
|
-
if (doUse) {
|
6121
|
-
if (self2[UPDATE_AGE_ON_GET])
|
6122
|
-
node.value.now = Date.now();
|
6123
|
-
self2[LRU_LIST].unshiftNode(node);
|
6124
|
-
}
|
6125
|
-
}
|
6126
|
-
return hit.value;
|
6127
|
-
}
|
6128
|
-
};
|
6129
|
-
var isStale = (self2, hit) => {
|
6130
|
-
if (!hit || !hit.maxAge && !self2[MAX_AGE])
|
6131
|
-
return false;
|
6132
|
-
const diff = Date.now() - hit.now;
|
6133
|
-
return hit.maxAge ? diff > hit.maxAge : self2[MAX_AGE] && diff > self2[MAX_AGE];
|
6134
|
-
};
|
6135
|
-
var trim = (self2) => {
|
6136
|
-
if (self2[LENGTH] > self2[MAX]) {
|
6137
|
-
for (let walker = self2[LRU_LIST].tail; self2[LENGTH] > self2[MAX] && walker !== null; ) {
|
6138
|
-
const prev = walker.prev;
|
6139
|
-
del(self2, walker);
|
6140
|
-
walker = prev;
|
6141
|
-
}
|
6142
|
-
}
|
6143
|
-
};
|
6144
|
-
var del = (self2, node) => {
|
6145
|
-
if (node) {
|
6146
|
-
const hit = node.value;
|
6147
|
-
if (self2[DISPOSE])
|
6148
|
-
self2[DISPOSE](hit.key, hit.value);
|
6149
|
-
self2[LENGTH] -= hit.length;
|
6150
|
-
self2[CACHE].delete(hit.key);
|
6151
|
-
self2[LRU_LIST].removeNode(node);
|
6152
|
-
}
|
6153
|
-
};
|
6154
|
-
var Entry = class {
|
6155
|
-
constructor(key, value, length, now, maxAge) {
|
6156
|
-
this.key = key;
|
6157
|
-
this.value = value;
|
6158
|
-
this.length = length;
|
6159
|
-
this.now = now;
|
6160
|
-
this.maxAge = maxAge || 0;
|
6161
|
-
}
|
6162
|
-
};
|
6163
|
-
var forEachStep = (self2, fn, node, thisp) => {
|
6164
|
-
let hit = node.value;
|
6165
|
-
if (isStale(self2, hit)) {
|
6166
|
-
del(self2, node);
|
6167
|
-
if (!self2[ALLOW_STALE])
|
6168
|
-
hit = void 0;
|
6169
|
-
}
|
6170
|
-
if (hit)
|
6171
|
-
fn.call(thisp, hit.value, hit.key, self2);
|
6172
|
-
};
|
6173
|
-
module.exports = LRUCache;
|
6174
|
-
}
|
6175
|
-
});
|
6176
|
-
|
6177
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js
|
6178
|
-
var require_range = __commonJS({
|
6179
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js"(exports, module) {
|
6180
|
-
var Range = class _Range {
|
6181
|
-
constructor(range, options) {
|
6182
|
-
options = parseOptions(options);
|
6183
|
-
if (range instanceof _Range) {
|
6184
|
-
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
6185
|
-
return range;
|
6186
|
-
} else {
|
6187
|
-
return new _Range(range.raw, options);
|
6188
|
-
}
|
6189
|
-
}
|
6190
|
-
if (range instanceof Comparator) {
|
6191
|
-
this.raw = range.value;
|
6192
|
-
this.set = [[range]];
|
6193
|
-
this.format();
|
6194
|
-
return this;
|
6195
|
-
}
|
6196
|
-
this.options = options;
|
6197
|
-
this.loose = !!options.loose;
|
6198
|
-
this.includePrerelease = !!options.includePrerelease;
|
6199
|
-
this.raw = range.trim().split(/\s+/).join(" ");
|
6200
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
6201
|
-
if (!this.set.length) {
|
6202
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
6203
|
-
}
|
6204
|
-
if (this.set.length > 1) {
|
6205
|
-
const first = this.set[0];
|
6206
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
6207
|
-
if (this.set.length === 0) {
|
6208
|
-
this.set = [first];
|
6209
|
-
} else if (this.set.length > 1) {
|
6210
|
-
for (const c of this.set) {
|
6211
|
-
if (c.length === 1 && isAny(c[0])) {
|
6212
|
-
this.set = [c];
|
6213
|
-
break;
|
6214
|
-
}
|
6215
|
-
}
|
6216
|
-
}
|
6217
|
-
}
|
6218
|
-
this.format();
|
6219
|
-
}
|
6220
|
-
format() {
|
6221
|
-
this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
|
6222
|
-
return this.range;
|
6223
|
-
}
|
6224
|
-
toString() {
|
6225
|
-
return this.range;
|
6226
|
-
}
|
6227
|
-
parseRange(range) {
|
6228
|
-
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
6229
|
-
const memoKey = memoOpts + ":" + range;
|
6230
|
-
const cached = cache.get(memoKey);
|
6231
|
-
if (cached) {
|
6232
|
-
return cached;
|
6233
|
-
}
|
6234
|
-
const loose = this.options.loose;
|
6235
|
-
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
6236
|
-
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
6237
|
-
debug("hyphen replace", range);
|
6238
|
-
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
6239
|
-
debug("comparator trim", range);
|
6240
|
-
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
6241
|
-
debug("tilde trim", range);
|
6242
|
-
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
6243
|
-
debug("caret trim", range);
|
6244
|
-
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
6245
|
-
if (loose) {
|
6246
|
-
rangeList = rangeList.filter((comp) => {
|
6247
|
-
debug("loose invalid filter", comp, this.options);
|
6248
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
6249
|
-
});
|
6250
|
-
}
|
6251
|
-
debug("range list", rangeList);
|
6252
|
-
const rangeMap = /* @__PURE__ */ new Map();
|
6253
|
-
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
6254
|
-
for (const comp of comparators) {
|
6255
|
-
if (isNullSet(comp)) {
|
6256
|
-
return [comp];
|
6257
|
-
}
|
6258
|
-
rangeMap.set(comp.value, comp);
|
6259
|
-
}
|
6260
|
-
if (rangeMap.size > 1 && rangeMap.has("")) {
|
6261
|
-
rangeMap.delete("");
|
6262
|
-
}
|
6263
|
-
const result = [...rangeMap.values()];
|
6264
|
-
cache.set(memoKey, result);
|
6265
|
-
return result;
|
6266
|
-
}
|
6267
|
-
intersects(range, options) {
|
6268
|
-
if (!(range instanceof _Range)) {
|
6269
|
-
throw new TypeError("a Range is required");
|
6270
|
-
}
|
6271
|
-
return this.set.some((thisComparators) => {
|
6272
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
6273
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
6274
|
-
return rangeComparators.every((rangeComparator) => {
|
6275
|
-
return thisComparator.intersects(rangeComparator, options);
|
6276
|
-
});
|
6277
|
-
});
|
6278
|
-
});
|
6279
|
-
});
|
6280
|
-
}
|
6281
|
-
// if ANY of the sets match ALL of its comparators, then pass
|
6282
|
-
test(version) {
|
6283
|
-
if (!version) {
|
6284
|
-
return false;
|
6285
|
-
}
|
6286
|
-
if (typeof version === "string") {
|
6287
|
-
try {
|
6288
|
-
version = new SemVer(version, this.options);
|
6289
|
-
} catch (er) {
|
6290
|
-
return false;
|
6291
|
-
}
|
6292
|
-
}
|
6293
|
-
for (let i = 0; i < this.set.length; i++) {
|
6294
|
-
if (testSet(this.set[i], version, this.options)) {
|
6295
|
-
return true;
|
6296
|
-
}
|
6297
|
-
}
|
6298
|
-
return false;
|
6299
|
-
}
|
6300
|
-
};
|
6301
|
-
module.exports = Range;
|
6302
|
-
var LRU = require_lru_cache();
|
6303
|
-
var cache = new LRU({ max: 1e3 });
|
6304
|
-
var parseOptions = require_parse_options();
|
6305
|
-
var Comparator = require_comparator();
|
6306
|
-
var debug = require_debug();
|
6307
|
-
var SemVer = require_semver();
|
6308
|
-
var {
|
6309
|
-
safeRe: re,
|
6310
|
-
t,
|
6311
|
-
comparatorTrimReplace,
|
6312
|
-
tildeTrimReplace,
|
6313
|
-
caretTrimReplace
|
6314
|
-
} = require_re();
|
6315
|
-
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
6316
|
-
var isNullSet = (c) => c.value === "<0.0.0-0";
|
6317
|
-
var isAny = (c) => c.value === "";
|
6318
|
-
var isSatisfiable = (comparators, options) => {
|
6319
|
-
let result = true;
|
6320
|
-
const remainingComparators = comparators.slice();
|
6321
|
-
let testComparator = remainingComparators.pop();
|
6322
|
-
while (result && remainingComparators.length) {
|
6323
|
-
result = remainingComparators.every((otherComparator) => {
|
6324
|
-
return testComparator.intersects(otherComparator, options);
|
6325
|
-
});
|
6326
|
-
testComparator = remainingComparators.pop();
|
6327
|
-
}
|
6328
|
-
return result;
|
6329
|
-
};
|
6330
|
-
var parseComparator = (comp, options) => {
|
6331
|
-
debug("comp", comp, options);
|
6332
|
-
comp = replaceCarets(comp, options);
|
6333
|
-
debug("caret", comp);
|
6334
|
-
comp = replaceTildes(comp, options);
|
6335
|
-
debug("tildes", comp);
|
6336
|
-
comp = replaceXRanges(comp, options);
|
6337
|
-
debug("xrange", comp);
|
6338
|
-
comp = replaceStars(comp, options);
|
6339
|
-
debug("stars", comp);
|
6340
|
-
return comp;
|
6341
|
-
};
|
6342
|
-
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
6343
|
-
var replaceTildes = (comp, options) => {
|
6344
|
-
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
6345
|
-
};
|
6346
|
-
var replaceTilde = (comp, options) => {
|
6347
|
-
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
6348
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
6349
|
-
debug("tilde", comp, _, M, m, p, pr);
|
6350
|
-
let ret;
|
6351
|
-
if (isX(M)) {
|
6352
|
-
ret = "";
|
6353
|
-
} else if (isX(m)) {
|
6354
|
-
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
6355
|
-
} else if (isX(p)) {
|
6356
|
-
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
6357
|
-
} else if (pr) {
|
6358
|
-
debug("replaceTilde pr", pr);
|
6359
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
6360
|
-
} else {
|
6361
|
-
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
6362
|
-
}
|
6363
|
-
debug("tilde return", ret);
|
6364
|
-
return ret;
|
6365
|
-
});
|
6366
|
-
};
|
6367
|
-
var replaceCarets = (comp, options) => {
|
6368
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
6369
|
-
};
|
6370
|
-
var replaceCaret = (comp, options) => {
|
6371
|
-
debug("caret", comp, options);
|
6372
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
6373
|
-
const z = options.includePrerelease ? "-0" : "";
|
6374
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
6375
|
-
debug("caret", comp, _, M, m, p, pr);
|
6376
|
-
let ret;
|
6377
|
-
if (isX(M)) {
|
6378
|
-
ret = "";
|
6379
|
-
} else if (isX(m)) {
|
6380
|
-
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
6381
|
-
} else if (isX(p)) {
|
6382
|
-
if (M === "0") {
|
6383
|
-
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
6384
|
-
} else {
|
6385
|
-
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
6386
|
-
}
|
6387
|
-
} else if (pr) {
|
6388
|
-
debug("replaceCaret pr", pr);
|
6389
|
-
if (M === "0") {
|
6390
|
-
if (m === "0") {
|
6391
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
6392
|
-
} else {
|
6393
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
6394
|
-
}
|
6395
|
-
} else {
|
6396
|
-
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
6397
|
-
}
|
6398
|
-
} else {
|
6399
|
-
debug("no pr");
|
6400
|
-
if (M === "0") {
|
6401
|
-
if (m === "0") {
|
6402
|
-
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
6403
|
-
} else {
|
6404
|
-
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
6405
|
-
}
|
6406
|
-
} else {
|
6407
|
-
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
6408
|
-
}
|
6409
|
-
}
|
6410
|
-
debug("caret return", ret);
|
6411
|
-
return ret;
|
6412
|
-
});
|
6413
|
-
};
|
6414
|
-
var replaceXRanges = (comp, options) => {
|
6415
|
-
debug("replaceXRanges", comp, options);
|
6416
|
-
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
6417
|
-
};
|
6418
|
-
var replaceXRange = (comp, options) => {
|
6419
|
-
comp = comp.trim();
|
6420
|
-
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
6421
|
-
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
6422
|
-
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
6423
|
-
const xM = isX(M);
|
6424
|
-
const xm = xM || isX(m);
|
6425
|
-
const xp = xm || isX(p);
|
6426
|
-
const anyX = xp;
|
6427
|
-
if (gtlt === "=" && anyX) {
|
6428
|
-
gtlt = "";
|
6429
|
-
}
|
6430
|
-
pr = options.includePrerelease ? "-0" : "";
|
6431
|
-
if (xM) {
|
6432
|
-
if (gtlt === ">" || gtlt === "<") {
|
6433
|
-
ret = "<0.0.0-0";
|
6434
|
-
} else {
|
6435
|
-
ret = "*";
|
6436
|
-
}
|
6437
|
-
} else if (gtlt && anyX) {
|
6438
|
-
if (xm) {
|
6439
|
-
m = 0;
|
6440
|
-
}
|
6441
|
-
p = 0;
|
6442
|
-
if (gtlt === ">") {
|
6443
|
-
gtlt = ">=";
|
6444
|
-
if (xm) {
|
6445
|
-
M = +M + 1;
|
6446
|
-
m = 0;
|
6447
|
-
p = 0;
|
6448
|
-
} else {
|
6449
|
-
m = +m + 1;
|
6450
|
-
p = 0;
|
6451
|
-
}
|
6452
|
-
} else if (gtlt === "<=") {
|
6453
|
-
gtlt = "<";
|
6454
|
-
if (xm) {
|
6455
|
-
M = +M + 1;
|
6456
|
-
} else {
|
6457
|
-
m = +m + 1;
|
6458
|
-
}
|
6459
|
-
}
|
6460
|
-
if (gtlt === "<") {
|
6461
|
-
pr = "-0";
|
6462
|
-
}
|
6463
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
6464
|
-
} else if (xm) {
|
6465
|
-
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
6466
|
-
} else if (xp) {
|
6467
|
-
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
6468
|
-
}
|
6469
|
-
debug("xRange return", ret);
|
6470
|
-
return ret;
|
6471
|
-
});
|
6472
|
-
};
|
6473
|
-
var replaceStars = (comp, options) => {
|
6474
|
-
debug("replaceStars", comp, options);
|
6475
|
-
return comp.trim().replace(re[t.STAR], "");
|
6476
|
-
};
|
6477
|
-
var replaceGTE0 = (comp, options) => {
|
6478
|
-
debug("replaceGTE0", comp, options);
|
6479
|
-
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
6480
|
-
};
|
6481
|
-
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) => {
|
6482
|
-
if (isX(fM)) {
|
6483
|
-
from = "";
|
6484
|
-
} else if (isX(fm)) {
|
6485
|
-
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
6486
|
-
} else if (isX(fp)) {
|
6487
|
-
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
6488
|
-
} else if (fpr) {
|
6489
|
-
from = `>=${from}`;
|
6490
|
-
} else {
|
6491
|
-
from = `>=${from}${incPr ? "-0" : ""}`;
|
6492
|
-
}
|
6493
|
-
if (isX(tM)) {
|
6494
|
-
to = "";
|
6495
|
-
} else if (isX(tm)) {
|
6496
|
-
to = `<${+tM + 1}.0.0-0`;
|
6497
|
-
} else if (isX(tp)) {
|
6498
|
-
to = `<${tM}.${+tm + 1}.0-0`;
|
6499
|
-
} else if (tpr) {
|
6500
|
-
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
6501
|
-
} else if (incPr) {
|
6502
|
-
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
6503
|
-
} else {
|
6504
|
-
to = `<=${to}`;
|
6505
|
-
}
|
6506
|
-
return `${from} ${to}`.trim();
|
6507
|
-
};
|
6508
|
-
var testSet = (set, version, options) => {
|
6509
|
-
for (let i = 0; i < set.length; i++) {
|
6510
|
-
if (!set[i].test(version)) {
|
6511
|
-
return false;
|
6512
|
-
}
|
6513
|
-
}
|
6514
|
-
if (version.prerelease.length && !options.includePrerelease) {
|
6515
|
-
for (let i = 0; i < set.length; i++) {
|
6516
|
-
debug(set[i].semver);
|
6517
|
-
if (set[i].semver === Comparator.ANY) {
|
6518
|
-
continue;
|
6519
|
-
}
|
6520
|
-
if (set[i].semver.prerelease.length > 0) {
|
6521
|
-
const allowed = set[i].semver;
|
6522
|
-
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
6523
|
-
return true;
|
6524
|
-
}
|
6525
|
-
}
|
6526
|
-
}
|
6527
|
-
return false;
|
6528
|
-
}
|
6529
|
-
return true;
|
6530
|
-
};
|
6531
|
-
}
|
6532
|
-
});
|
6533
|
-
|
6534
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js
|
6535
|
-
var require_comparator = __commonJS({
|
6536
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js"(exports, module) {
|
6537
|
-
var ANY = Symbol("SemVer ANY");
|
6538
|
-
var Comparator = class _Comparator {
|
6539
|
-
static get ANY() {
|
6540
|
-
return ANY;
|
6541
|
-
}
|
6542
|
-
constructor(comp, options) {
|
6543
|
-
options = parseOptions(options);
|
6544
|
-
if (comp instanceof _Comparator) {
|
6545
|
-
if (comp.loose === !!options.loose) {
|
6546
|
-
return comp;
|
6547
|
-
} else {
|
6548
|
-
comp = comp.value;
|
6549
|
-
}
|
6550
|
-
}
|
6551
|
-
comp = comp.trim().split(/\s+/).join(" ");
|
6552
|
-
debug("comparator", comp, options);
|
6553
|
-
this.options = options;
|
6554
|
-
this.loose = !!options.loose;
|
6555
|
-
this.parse(comp);
|
6556
|
-
if (this.semver === ANY) {
|
6557
|
-
this.value = "";
|
6558
|
-
} else {
|
6559
|
-
this.value = this.operator + this.semver.version;
|
6560
|
-
}
|
6561
|
-
debug("comp", this);
|
6562
|
-
}
|
6563
|
-
parse(comp) {
|
6564
|
-
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
6565
|
-
const m = comp.match(r);
|
6566
|
-
if (!m) {
|
6567
|
-
throw new TypeError(`Invalid comparator: ${comp}`);
|
6568
|
-
}
|
6569
|
-
this.operator = m[1] !== void 0 ? m[1] : "";
|
6570
|
-
if (this.operator === "=") {
|
6571
|
-
this.operator = "";
|
6572
|
-
}
|
6573
|
-
if (!m[2]) {
|
6574
|
-
this.semver = ANY;
|
6575
|
-
} else {
|
6576
|
-
this.semver = new SemVer(m[2], this.options.loose);
|
6577
|
-
}
|
6578
|
-
}
|
6579
|
-
toString() {
|
6580
|
-
return this.value;
|
6581
|
-
}
|
6582
|
-
test(version) {
|
6583
|
-
debug("Comparator.test", version, this.options.loose);
|
6584
|
-
if (this.semver === ANY || version === ANY) {
|
6585
|
-
return true;
|
6586
|
-
}
|
6587
|
-
if (typeof version === "string") {
|
6588
|
-
try {
|
6589
|
-
version = new SemVer(version, this.options);
|
6590
|
-
} catch (er) {
|
6591
|
-
return false;
|
6592
|
-
}
|
6593
|
-
}
|
6594
|
-
return cmp(version, this.operator, this.semver, this.options);
|
6595
|
-
}
|
6596
|
-
intersects(comp, options) {
|
6597
|
-
if (!(comp instanceof _Comparator)) {
|
6598
|
-
throw new TypeError("a Comparator is required");
|
6599
|
-
}
|
6600
|
-
if (this.operator === "") {
|
6601
|
-
if (this.value === "") {
|
6602
|
-
return true;
|
6603
|
-
}
|
6604
|
-
return new Range(comp.value, options).test(this.value);
|
6605
|
-
} else if (comp.operator === "") {
|
6606
|
-
if (comp.value === "") {
|
6607
|
-
return true;
|
6608
|
-
}
|
6609
|
-
return new Range(this.value, options).test(comp.semver);
|
6610
|
-
}
|
6611
|
-
options = parseOptions(options);
|
6612
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
6613
|
-
return false;
|
6614
|
-
}
|
6615
|
-
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
6616
|
-
return false;
|
6617
|
-
}
|
6618
|
-
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
6619
|
-
return true;
|
6620
|
-
}
|
6621
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
6622
|
-
return true;
|
6623
|
-
}
|
6624
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
6625
|
-
return true;
|
6626
|
-
}
|
6627
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
6628
|
-
return true;
|
6629
|
-
}
|
6630
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
6631
|
-
return true;
|
6632
|
-
}
|
6633
|
-
return false;
|
6634
|
-
}
|
6635
|
-
};
|
6636
|
-
module.exports = Comparator;
|
6637
|
-
var parseOptions = require_parse_options();
|
6638
|
-
var { safeRe: re, t } = require_re();
|
6639
|
-
var cmp = require_cmp();
|
6640
|
-
var debug = require_debug();
|
6641
|
-
var SemVer = require_semver();
|
6642
|
-
var Range = require_range();
|
6643
|
-
}
|
6644
|
-
});
|
6645
|
-
|
6646
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js
|
6647
|
-
var require_satisfies = __commonJS({
|
6648
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js"(exports, module) {
|
6649
|
-
var Range = require_range();
|
6650
|
-
var satisfies = (version, range, options) => {
|
6651
|
-
try {
|
6652
|
-
range = new Range(range, options);
|
6653
|
-
} catch (er) {
|
6654
|
-
return false;
|
6655
|
-
}
|
6656
|
-
return range.test(version);
|
6657
|
-
};
|
6658
|
-
module.exports = satisfies;
|
6659
|
-
}
|
6660
|
-
});
|
6661
|
-
|
6662
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js
|
6663
|
-
var require_to_comparators = __commonJS({
|
6664
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
6665
|
-
var Range = require_range();
|
6666
|
-
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
6667
|
-
module.exports = toComparators;
|
6668
|
-
}
|
6669
|
-
});
|
6670
|
-
|
6671
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js
|
6672
|
-
var require_max_satisfying = __commonJS({
|
6673
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
6674
|
-
var SemVer = require_semver();
|
6675
|
-
var Range = require_range();
|
6676
|
-
var maxSatisfying = (versions, range, options) => {
|
6677
|
-
let max = null;
|
6678
|
-
let maxSV = null;
|
6679
|
-
let rangeObj = null;
|
6680
|
-
try {
|
6681
|
-
rangeObj = new Range(range, options);
|
6682
|
-
} catch (er) {
|
6683
|
-
return null;
|
6684
|
-
}
|
6685
|
-
versions.forEach((v) => {
|
6686
|
-
if (rangeObj.test(v)) {
|
6687
|
-
if (!max || maxSV.compare(v) === -1) {
|
6688
|
-
max = v;
|
6689
|
-
maxSV = new SemVer(max, options);
|
6690
|
-
}
|
6691
|
-
}
|
6692
|
-
});
|
6693
|
-
return max;
|
6694
|
-
};
|
6695
|
-
module.exports = maxSatisfying;
|
6696
|
-
}
|
6697
|
-
});
|
6698
|
-
|
6699
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js
|
6700
|
-
var require_min_satisfying = __commonJS({
|
6701
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
6702
|
-
var SemVer = require_semver();
|
6703
|
-
var Range = require_range();
|
6704
|
-
var minSatisfying = (versions, range, options) => {
|
6705
|
-
let min = null;
|
6706
|
-
let minSV = null;
|
6707
|
-
let rangeObj = null;
|
6708
|
-
try {
|
6709
|
-
rangeObj = new Range(range, options);
|
6710
|
-
} catch (er) {
|
6711
|
-
return null;
|
6712
|
-
}
|
6713
|
-
versions.forEach((v) => {
|
6714
|
-
if (rangeObj.test(v)) {
|
6715
|
-
if (!min || minSV.compare(v) === 1) {
|
6716
|
-
min = v;
|
6717
|
-
minSV = new SemVer(min, options);
|
6718
|
-
}
|
6719
|
-
}
|
6720
|
-
});
|
6721
|
-
return min;
|
6722
|
-
};
|
6723
|
-
module.exports = minSatisfying;
|
6724
|
-
}
|
6725
|
-
});
|
6726
|
-
|
6727
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js
|
6728
|
-
var require_min_version = __commonJS({
|
6729
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js"(exports, module) {
|
6730
|
-
var SemVer = require_semver();
|
6731
|
-
var Range = require_range();
|
6732
|
-
var gt = require_gt();
|
6733
|
-
var minVersion = (range, loose) => {
|
6734
|
-
range = new Range(range, loose);
|
6735
|
-
let minver = new SemVer("0.0.0");
|
6736
|
-
if (range.test(minver)) {
|
6737
|
-
return minver;
|
6738
|
-
}
|
6739
|
-
minver = new SemVer("0.0.0-0");
|
6740
|
-
if (range.test(minver)) {
|
6741
|
-
return minver;
|
6742
|
-
}
|
6743
|
-
minver = null;
|
6744
|
-
for (let i = 0; i < range.set.length; ++i) {
|
6745
|
-
const comparators = range.set[i];
|
6746
|
-
let setMin = null;
|
6747
|
-
comparators.forEach((comparator) => {
|
6748
|
-
const compver = new SemVer(comparator.semver.version);
|
6749
|
-
switch (comparator.operator) {
|
6750
|
-
case ">":
|
6751
|
-
if (compver.prerelease.length === 0) {
|
6752
|
-
compver.patch++;
|
6753
|
-
} else {
|
6754
|
-
compver.prerelease.push(0);
|
6755
|
-
}
|
6756
|
-
compver.raw = compver.format();
|
6757
|
-
case "":
|
6758
|
-
case ">=":
|
6759
|
-
if (!setMin || gt(compver, setMin)) {
|
6760
|
-
setMin = compver;
|
6761
|
-
}
|
6762
|
-
break;
|
6763
|
-
case "<":
|
6764
|
-
case "<=":
|
6765
|
-
break;
|
6766
|
-
default:
|
6767
|
-
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
6768
|
-
}
|
6769
|
-
});
|
6770
|
-
if (setMin && (!minver || gt(minver, setMin))) {
|
6771
|
-
minver = setMin;
|
6772
|
-
}
|
6773
|
-
}
|
6774
|
-
if (minver && range.test(minver)) {
|
6775
|
-
return minver;
|
6776
|
-
}
|
6777
|
-
return null;
|
6778
|
-
};
|
6779
|
-
module.exports = minVersion;
|
6780
|
-
}
|
6781
|
-
});
|
6782
|
-
|
6783
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js
|
6784
|
-
var require_valid2 = __commonJS({
|
6785
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js"(exports, module) {
|
6786
|
-
var Range = require_range();
|
6787
|
-
var validRange = (range, options) => {
|
6788
|
-
try {
|
6789
|
-
return new Range(range, options).range || "*";
|
6790
|
-
} catch (er) {
|
6791
|
-
return null;
|
6792
|
-
}
|
6793
|
-
};
|
6794
|
-
module.exports = validRange;
|
6795
|
-
}
|
6796
|
-
});
|
6797
|
-
|
6798
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js
|
6799
|
-
var require_outside = __commonJS({
|
6800
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js"(exports, module) {
|
6801
|
-
var SemVer = require_semver();
|
6802
|
-
var Comparator = require_comparator();
|
6803
|
-
var { ANY } = Comparator;
|
6804
|
-
var Range = require_range();
|
6805
|
-
var satisfies = require_satisfies();
|
6806
|
-
var gt = require_gt();
|
6807
|
-
var lt = require_lt();
|
6808
|
-
var lte = require_lte();
|
6809
|
-
var gte = require_gte();
|
6810
|
-
var outside = (version, range, hilo, options) => {
|
6811
|
-
version = new SemVer(version, options);
|
6812
|
-
range = new Range(range, options);
|
6813
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
6814
|
-
switch (hilo) {
|
6815
|
-
case ">":
|
6816
|
-
gtfn = gt;
|
6817
|
-
ltefn = lte;
|
6818
|
-
ltfn = lt;
|
6819
|
-
comp = ">";
|
6820
|
-
ecomp = ">=";
|
6821
|
-
break;
|
6822
|
-
case "<":
|
6823
|
-
gtfn = lt;
|
6824
|
-
ltefn = gte;
|
6825
|
-
ltfn = gt;
|
6826
|
-
comp = "<";
|
6827
|
-
ecomp = "<=";
|
6828
|
-
break;
|
6829
|
-
default:
|
6830
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
6831
|
-
}
|
6832
|
-
if (satisfies(version, range, options)) {
|
6833
|
-
return false;
|
6834
|
-
}
|
6835
|
-
for (let i = 0; i < range.set.length; ++i) {
|
6836
|
-
const comparators = range.set[i];
|
6837
|
-
let high = null;
|
6838
|
-
let low = null;
|
6839
|
-
comparators.forEach((comparator) => {
|
6840
|
-
if (comparator.semver === ANY) {
|
6841
|
-
comparator = new Comparator(">=0.0.0");
|
6842
|
-
}
|
6843
|
-
high = high || comparator;
|
6844
|
-
low = low || comparator;
|
6845
|
-
if (gtfn(comparator.semver, high.semver, options)) {
|
6846
|
-
high = comparator;
|
6847
|
-
} else if (ltfn(comparator.semver, low.semver, options)) {
|
6848
|
-
low = comparator;
|
6849
|
-
}
|
6850
|
-
});
|
6851
|
-
if (high.operator === comp || high.operator === ecomp) {
|
6852
|
-
return false;
|
6853
|
-
}
|
6854
|
-
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
6855
|
-
return false;
|
6856
|
-
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
6857
|
-
return false;
|
6858
|
-
}
|
4692
|
+
internal: kitInternals2
|
4693
|
+
}).strict();
|
4694
|
+
tableSquashed2 = objectType({
|
4695
|
+
name: stringType(),
|
4696
|
+
schema: stringType(),
|
4697
|
+
columns: recordType(stringType(), column2),
|
4698
|
+
indexes: recordType(stringType(), stringType()),
|
4699
|
+
foreignKeys: recordType(stringType(), stringType()),
|
4700
|
+
compositePrimaryKeys: recordType(stringType(), stringType()),
|
4701
|
+
uniqueConstraints: recordType(stringType(), stringType())
|
4702
|
+
}).strict();
|
4703
|
+
tableSquashedV42 = objectType({
|
4704
|
+
name: stringType(),
|
4705
|
+
schema: stringType(),
|
4706
|
+
columns: recordType(stringType(), column2),
|
4707
|
+
indexes: recordType(stringType(), stringType()),
|
4708
|
+
foreignKeys: recordType(stringType(), stringType())
|
4709
|
+
}).strict();
|
4710
|
+
pgSchemaSquashedV4 = objectType({
|
4711
|
+
version: literalType("4"),
|
4712
|
+
dialect: enumType(["pg"]),
|
4713
|
+
tables: recordType(stringType(), tableSquashedV42),
|
4714
|
+
enums: recordType(stringType(), enumSchemaV1),
|
4715
|
+
schemas: recordType(stringType(), stringType())
|
4716
|
+
}).strict();
|
4717
|
+
pgSchemaSquashed = objectType({
|
4718
|
+
version: literalType("6"),
|
4719
|
+
dialect: enumType(["pg"]),
|
4720
|
+
tables: recordType(stringType(), tableSquashed2),
|
4721
|
+
enums: recordType(stringType(), enumSchema),
|
4722
|
+
schemas: recordType(stringType(), stringType())
|
4723
|
+
}).strict();
|
4724
|
+
pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
4725
|
+
pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
4726
|
+
pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
|
4727
|
+
pgSchema2 = pgSchemaInternal.merge(schemaHash2);
|
4728
|
+
backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema2]);
|
4729
|
+
dryPg = pgSchema2.parse({
|
4730
|
+
version: snapshotVersion,
|
4731
|
+
dialect: "pg",
|
4732
|
+
id: originUUID,
|
4733
|
+
prevId: "",
|
4734
|
+
tables: {},
|
4735
|
+
enums: {},
|
4736
|
+
schemas: {},
|
4737
|
+
_meta: {
|
4738
|
+
schemas: {},
|
4739
|
+
tables: {},
|
4740
|
+
columns: {}
|
6859
4741
|
}
|
6860
|
-
|
6861
|
-
};
|
6862
|
-
module.exports = outside;
|
6863
|
-
}
|
6864
|
-
});
|
6865
|
-
|
6866
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js
|
6867
|
-
var require_gtr = __commonJS({
|
6868
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js"(exports, module) {
|
6869
|
-
var outside = require_outside();
|
6870
|
-
var gtr = (version, range, options) => outside(version, range, ">", options);
|
6871
|
-
module.exports = gtr;
|
6872
|
-
}
|
6873
|
-
});
|
6874
|
-
|
6875
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js
|
6876
|
-
var require_ltr = __commonJS({
|
6877
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js"(exports, module) {
|
6878
|
-
var outside = require_outside();
|
6879
|
-
var ltr = (version, range, options) => outside(version, range, "<", options);
|
6880
|
-
module.exports = ltr;
|
6881
|
-
}
|
6882
|
-
});
|
6883
|
-
|
6884
|
-
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js
|
6885
|
-
var require_intersects = __commonJS({
|
6886
|
-
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js"(exports, module) {
|
6887
|
-
var Range = require_range();
|
6888
|
-
var intersects = (r1, r2, options) => {
|
6889
|
-
r1 = new Range(r1, options);
|
6890
|
-
r2 = new Range(r2, options);
|
6891
|
-
return r1.intersects(r2, options);
|
6892
|
-
};
|
6893
|
-
module.exports = intersects;
|
4742
|
+
});
|
6894
4743
|
}
|
6895
4744
|
});
|
6896
4745
|
|
6897
|
-
//
|
6898
|
-
var
|
6899
|
-
|
6900
|
-
|
6901
|
-
|
6902
|
-
|
6903
|
-
|
6904
|
-
|
6905
|
-
|
6906
|
-
|
6907
|
-
|
6908
|
-
|
6909
|
-
|
6910
|
-
|
6911
|
-
|
6912
|
-
|
6913
|
-
|
6914
|
-
|
6915
|
-
|
6916
|
-
|
6917
|
-
|
6918
|
-
|
6919
|
-
|
6920
|
-
|
6921
|
-
|
6922
|
-
|
6923
|
-
|
6924
|
-
|
6925
|
-
|
6926
|
-
|
6927
|
-
|
6928
|
-
|
6929
|
-
|
6930
|
-
|
6931
|
-
|
6932
|
-
|
6933
|
-
|
6934
|
-
|
6935
|
-
|
6936
|
-
|
6937
|
-
|
4746
|
+
// src/serializer/sqliteSchema.ts
|
4747
|
+
var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3, table3, dialect2, schemaHash3, schemaInternalV32, schemaInternalV42, latestVersion, schemaInternal2, schemaV32, schemaV42, schema2, tableSquashed3, schemaSquashed2, drySQLite;
|
4748
|
+
var init_sqliteSchema = __esm({
|
4749
|
+
"src/serializer/sqliteSchema.ts"() {
|
4750
|
+
"use strict";
|
4751
|
+
init_global();
|
4752
|
+
init_lib();
|
4753
|
+
index3 = objectType({
|
4754
|
+
name: stringType(),
|
4755
|
+
columns: stringType().array(),
|
4756
|
+
where: stringType().optional(),
|
4757
|
+
isUnique: booleanType()
|
4758
|
+
}).strict();
|
4759
|
+
fk3 = objectType({
|
4760
|
+
name: stringType(),
|
4761
|
+
tableFrom: stringType(),
|
4762
|
+
columnsFrom: stringType().array(),
|
4763
|
+
tableTo: stringType(),
|
4764
|
+
columnsTo: stringType().array(),
|
4765
|
+
onUpdate: stringType().optional(),
|
4766
|
+
onDelete: stringType().optional()
|
4767
|
+
}).strict();
|
4768
|
+
compositePK3 = objectType({
|
4769
|
+
columns: stringType().array(),
|
4770
|
+
name: stringType().optional()
|
4771
|
+
}).strict();
|
4772
|
+
column3 = objectType({
|
4773
|
+
name: stringType(),
|
4774
|
+
type: stringType(),
|
4775
|
+
primaryKey: booleanType(),
|
4776
|
+
notNull: booleanType(),
|
4777
|
+
autoincrement: booleanType().optional(),
|
4778
|
+
default: anyType().optional()
|
4779
|
+
}).strict();
|
4780
|
+
tableV33 = objectType({
|
4781
|
+
name: stringType(),
|
4782
|
+
columns: recordType(stringType(), column3),
|
4783
|
+
indexes: recordType(stringType(), index3),
|
4784
|
+
foreignKeys: recordType(stringType(), fk3)
|
4785
|
+
}).strict();
|
4786
|
+
uniqueConstraint3 = objectType({
|
4787
|
+
name: stringType(),
|
4788
|
+
columns: stringType().array()
|
4789
|
+
}).strict();
|
4790
|
+
table3 = objectType({
|
4791
|
+
name: stringType(),
|
4792
|
+
columns: recordType(stringType(), column3),
|
4793
|
+
indexes: recordType(stringType(), index3),
|
4794
|
+
foreignKeys: recordType(stringType(), fk3),
|
4795
|
+
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
4796
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
4797
|
+
}).strict();
|
4798
|
+
dialect2 = enumType(["sqlite"]);
|
4799
|
+
schemaHash3 = objectType({
|
4800
|
+
id: stringType(),
|
4801
|
+
prevId: stringType()
|
4802
|
+
}).strict();
|
4803
|
+
schemaInternalV32 = objectType({
|
4804
|
+
version: literalType("3"),
|
4805
|
+
dialect: dialect2,
|
4806
|
+
tables: recordType(stringType(), tableV33),
|
4807
|
+
enums: objectType({})
|
4808
|
+
}).strict();
|
4809
|
+
schemaInternalV42 = objectType({
|
4810
|
+
version: literalType("4"),
|
4811
|
+
dialect: dialect2,
|
4812
|
+
tables: recordType(stringType(), table3),
|
4813
|
+
enums: objectType({})
|
4814
|
+
}).strict();
|
4815
|
+
latestVersion = literalType("5");
|
4816
|
+
schemaInternal2 = objectType({
|
4817
|
+
version: latestVersion,
|
4818
|
+
dialect: dialect2,
|
4819
|
+
tables: recordType(stringType(), table3),
|
4820
|
+
enums: objectType({}),
|
4821
|
+
_meta: objectType({
|
4822
|
+
tables: recordType(stringType(), stringType()),
|
4823
|
+
columns: recordType(stringType(), stringType())
|
4824
|
+
})
|
4825
|
+
}).strict();
|
4826
|
+
schemaV32 = schemaInternalV32.merge(schemaHash3).strict();
|
4827
|
+
schemaV42 = schemaInternalV42.merge(schemaHash3).strict();
|
4828
|
+
schema2 = schemaInternal2.merge(schemaHash3).strict();
|
4829
|
+
tableSquashed3 = objectType({
|
4830
|
+
name: stringType(),
|
4831
|
+
columns: recordType(stringType(), column3),
|
4832
|
+
indexes: recordType(stringType(), stringType()),
|
4833
|
+
foreignKeys: recordType(stringType(), stringType()),
|
4834
|
+
compositePrimaryKeys: recordType(stringType(), stringType()),
|
4835
|
+
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
4836
|
+
}).strict();
|
4837
|
+
schemaSquashed2 = objectType({
|
4838
|
+
version: latestVersion,
|
4839
|
+
dialect: dialect2,
|
4840
|
+
tables: recordType(stringType(), tableSquashed3),
|
4841
|
+
enums: anyType()
|
4842
|
+
}).strict();
|
4843
|
+
drySQLite = schema2.parse({
|
4844
|
+
version: "5",
|
4845
|
+
dialect: "sqlite",
|
4846
|
+
id: originUUID,
|
4847
|
+
prevId: "",
|
4848
|
+
tables: {},
|
4849
|
+
enums: {},
|
4850
|
+
_meta: {
|
4851
|
+
tables: {},
|
4852
|
+
columns: {}
|
6938
4853
|
}
|
6939
|
-
|
6940
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
6941
|
-
return simplified.length < original.length ? simplified : range;
|
6942
|
-
};
|
4854
|
+
});
|
6943
4855
|
}
|
6944
4856
|
});
|
6945
4857
|
|
6946
|
-
//
|
6947
|
-
var
|
6948
|
-
"
|
6949
|
-
|
6950
|
-
|
6951
|
-
|
6952
|
-
|
6953
|
-
|
6954
|
-
|
6955
|
-
if (sub === dom) {
|
6956
|
-
return true;
|
6957
|
-
}
|
6958
|
-
sub = new Range(sub, options);
|
6959
|
-
dom = new Range(dom, options);
|
6960
|
-
let sawNonNull = false;
|
6961
|
-
OUTER:
|
6962
|
-
for (const simpleSub of sub.set) {
|
6963
|
-
for (const simpleDom of dom.set) {
|
6964
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
6965
|
-
sawNonNull = sawNonNull || isSub !== null;
|
6966
|
-
if (isSub) {
|
6967
|
-
continue OUTER;
|
6968
|
-
}
|
6969
|
-
}
|
6970
|
-
if (sawNonNull) {
|
6971
|
-
return false;
|
6972
|
-
}
|
6973
|
-
}
|
6974
|
-
return true;
|
6975
|
-
};
|
6976
|
-
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
6977
|
-
var minimumVersion = [new Comparator(">=0.0.0")];
|
6978
|
-
var simpleSubset = (sub, dom, options) => {
|
6979
|
-
if (sub === dom) {
|
6980
|
-
return true;
|
6981
|
-
}
|
6982
|
-
if (sub.length === 1 && sub[0].semver === ANY) {
|
6983
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
6984
|
-
return true;
|
6985
|
-
} else if (options.includePrerelease) {
|
6986
|
-
sub = minimumVersionWithPreRelease;
|
6987
|
-
} else {
|
6988
|
-
sub = minimumVersion;
|
6989
|
-
}
|
6990
|
-
}
|
6991
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
6992
|
-
if (options.includePrerelease) {
|
6993
|
-
return true;
|
6994
|
-
} else {
|
6995
|
-
dom = minimumVersion;
|
6996
|
-
}
|
6997
|
-
}
|
6998
|
-
const eqSet = /* @__PURE__ */ new Set();
|
6999
|
-
let gt, lt;
|
7000
|
-
for (const c of sub) {
|
7001
|
-
if (c.operator === ">" || c.operator === ">=") {
|
7002
|
-
gt = higherGT(gt, c, options);
|
7003
|
-
} else if (c.operator === "<" || c.operator === "<=") {
|
7004
|
-
lt = lowerLT(lt, c, options);
|
7005
|
-
} else {
|
7006
|
-
eqSet.add(c.semver);
|
7007
|
-
}
|
7008
|
-
}
|
7009
|
-
if (eqSet.size > 1) {
|
7010
|
-
return null;
|
7011
|
-
}
|
7012
|
-
let gtltComp;
|
7013
|
-
if (gt && lt) {
|
7014
|
-
gtltComp = compare(gt.semver, lt.semver, options);
|
7015
|
-
if (gtltComp > 0) {
|
7016
|
-
return null;
|
7017
|
-
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
7018
|
-
return null;
|
7019
|
-
}
|
7020
|
-
}
|
7021
|
-
for (const eq of eqSet) {
|
7022
|
-
if (gt && !satisfies(eq, String(gt), options)) {
|
7023
|
-
return null;
|
7024
|
-
}
|
7025
|
-
if (lt && !satisfies(eq, String(lt), options)) {
|
7026
|
-
return null;
|
7027
|
-
}
|
7028
|
-
for (const c of dom) {
|
7029
|
-
if (!satisfies(eq, String(c), options)) {
|
7030
|
-
return false;
|
7031
|
-
}
|
7032
|
-
}
|
7033
|
-
return true;
|
7034
|
-
}
|
7035
|
-
let higher, lower;
|
7036
|
-
let hasDomLT, hasDomGT;
|
7037
|
-
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
7038
|
-
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
7039
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
7040
|
-
needDomLTPre = false;
|
7041
|
-
}
|
7042
|
-
for (const c of dom) {
|
7043
|
-
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
7044
|
-
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
7045
|
-
if (gt) {
|
7046
|
-
if (needDomGTPre) {
|
7047
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
7048
|
-
needDomGTPre = false;
|
7049
|
-
}
|
7050
|
-
}
|
7051
|
-
if (c.operator === ">" || c.operator === ">=") {
|
7052
|
-
higher = higherGT(gt, c, options);
|
7053
|
-
if (higher === c && higher !== gt) {
|
7054
|
-
return false;
|
7055
|
-
}
|
7056
|
-
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
7057
|
-
return false;
|
7058
|
-
}
|
7059
|
-
}
|
7060
|
-
if (lt) {
|
7061
|
-
if (needDomLTPre) {
|
7062
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
7063
|
-
needDomLTPre = false;
|
7064
|
-
}
|
7065
|
-
}
|
7066
|
-
if (c.operator === "<" || c.operator === "<=") {
|
7067
|
-
lower = lowerLT(lt, c, options);
|
7068
|
-
if (lower === c && lower !== lt) {
|
7069
|
-
return false;
|
7070
|
-
}
|
7071
|
-
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
7072
|
-
return false;
|
7073
|
-
}
|
7074
|
-
}
|
7075
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
7076
|
-
return false;
|
7077
|
-
}
|
7078
|
-
}
|
7079
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
7080
|
-
return false;
|
7081
|
-
}
|
7082
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
7083
|
-
return false;
|
7084
|
-
}
|
7085
|
-
if (needDomGTPre || needDomLTPre) {
|
7086
|
-
return false;
|
7087
|
-
}
|
7088
|
-
return true;
|
7089
|
-
};
|
7090
|
-
var higherGT = (a, b, options) => {
|
7091
|
-
if (!a) {
|
7092
|
-
return b;
|
7093
|
-
}
|
7094
|
-
const comp = compare(a.semver, b.semver, options);
|
7095
|
-
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
7096
|
-
};
|
7097
|
-
var lowerLT = (a, b, options) => {
|
7098
|
-
if (!a) {
|
7099
|
-
return b;
|
7100
|
-
}
|
7101
|
-
const comp = compare(a.semver, b.semver, options);
|
7102
|
-
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
7103
|
-
};
|
7104
|
-
module.exports = subset;
|
4858
|
+
// src/utils.ts
|
4859
|
+
var init_utils = __esm({
|
4860
|
+
"src/utils.ts"() {
|
4861
|
+
"use strict";
|
4862
|
+
init_views();
|
4863
|
+
init_mysqlSchema();
|
4864
|
+
init_pgSchema();
|
4865
|
+
init_sqliteSchema();
|
4866
|
+
init_global();
|
7105
4867
|
}
|
7106
4868
|
});
|
7107
4869
|
|
7108
|
-
//
|
7109
|
-
var
|
7110
|
-
|
7111
|
-
|
7112
|
-
|
7113
|
-
|
7114
|
-
|
7115
|
-
var parse = require_parse();
|
7116
|
-
var valid = require_valid();
|
7117
|
-
var clean = require_clean();
|
7118
|
-
var inc = require_inc();
|
7119
|
-
var diff = require_diff();
|
7120
|
-
var major = require_major();
|
7121
|
-
var minor = require_minor();
|
7122
|
-
var patch = require_patch();
|
7123
|
-
var prerelease = require_prerelease();
|
7124
|
-
var compare = require_compare();
|
7125
|
-
var rcompare = require_rcompare();
|
7126
|
-
var compareLoose = require_compare_loose();
|
7127
|
-
var compareBuild = require_compare_build();
|
7128
|
-
var sort = require_sort();
|
7129
|
-
var rsort = require_rsort();
|
7130
|
-
var gt = require_gt();
|
7131
|
-
var lt = require_lt();
|
7132
|
-
var eq = require_eq();
|
7133
|
-
var neq = require_neq();
|
7134
|
-
var gte = require_gte();
|
7135
|
-
var lte = require_lte();
|
7136
|
-
var cmp = require_cmp();
|
7137
|
-
var coerce = require_coerce();
|
7138
|
-
var Comparator = require_comparator();
|
7139
|
-
var Range = require_range();
|
7140
|
-
var satisfies = require_satisfies();
|
7141
|
-
var toComparators = require_to_comparators();
|
7142
|
-
var maxSatisfying = require_max_satisfying();
|
7143
|
-
var minSatisfying = require_min_satisfying();
|
7144
|
-
var minVersion = require_min_version();
|
7145
|
-
var validRange = require_valid2();
|
7146
|
-
var outside = require_outside();
|
7147
|
-
var gtr = require_gtr();
|
7148
|
-
var ltr = require_ltr();
|
7149
|
-
var intersects = require_intersects();
|
7150
|
-
var simplifyRange = require_simplify();
|
7151
|
-
var subset = require_subset();
|
7152
|
-
module.exports = {
|
7153
|
-
parse,
|
7154
|
-
valid,
|
7155
|
-
clean,
|
7156
|
-
inc,
|
7157
|
-
diff,
|
7158
|
-
major,
|
7159
|
-
minor,
|
7160
|
-
patch,
|
7161
|
-
prerelease,
|
7162
|
-
compare,
|
7163
|
-
rcompare,
|
7164
|
-
compareLoose,
|
7165
|
-
compareBuild,
|
7166
|
-
sort,
|
7167
|
-
rsort,
|
7168
|
-
gt,
|
7169
|
-
lt,
|
7170
|
-
eq,
|
7171
|
-
neq,
|
7172
|
-
gte,
|
7173
|
-
lte,
|
7174
|
-
cmp,
|
7175
|
-
coerce,
|
7176
|
-
Comparator,
|
7177
|
-
Range,
|
7178
|
-
satisfies,
|
7179
|
-
toComparators,
|
7180
|
-
maxSatisfying,
|
7181
|
-
minSatisfying,
|
7182
|
-
minVersion,
|
7183
|
-
validRange,
|
7184
|
-
outside,
|
7185
|
-
gtr,
|
7186
|
-
ltr,
|
7187
|
-
intersects,
|
7188
|
-
simplifyRange,
|
7189
|
-
subset,
|
7190
|
-
SemVer,
|
7191
|
-
re: internalRe.re,
|
7192
|
-
src: internalRe.src,
|
7193
|
-
tokens: internalRe.t,
|
7194
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
7195
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
7196
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
7197
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
7198
|
-
};
|
4870
|
+
// src/cli/views.ts
|
4871
|
+
var import_hanji;
|
4872
|
+
var init_views = __esm({
|
4873
|
+
"src/cli/views.ts"() {
|
4874
|
+
"use strict";
|
4875
|
+
import_hanji = __toESM(require_hanji());
|
4876
|
+
init_utils();
|
7199
4877
|
}
|
7200
4878
|
});
|
7201
4879
|
|
@@ -7204,7 +4882,6 @@ import * as glob from "glob";
|
|
7204
4882
|
var init_serializer = __esm({
|
7205
4883
|
"src/serializer/index.ts"() {
|
7206
4884
|
"use strict";
|
7207
|
-
init_source();
|
7208
4885
|
init_views();
|
7209
4886
|
}
|
7210
4887
|
});
|
@@ -7213,7 +4890,6 @@ var init_serializer = __esm({
|
|
7213
4890
|
var init_outputs = __esm({
|
7214
4891
|
"src/cli/validations/outputs.ts"() {
|
7215
4892
|
"use strict";
|
7216
|
-
init_source();
|
7217
4893
|
}
|
7218
4894
|
});
|
7219
4895
|
|
@@ -7270,7 +4946,6 @@ var init_sqliteSerializer = __esm({
|
|
7270
4946
|
"use strict";
|
7271
4947
|
init_serializer();
|
7272
4948
|
init_outputs();
|
7273
|
-
init_source();
|
7274
4949
|
dialect3 = new SQLiteSyncDialect();
|
7275
4950
|
fromDatabase = async (db, tablesFilter = (table4) => true, progressCallback) => {
|
7276
4951
|
const result = {};
|
@@ -7693,7 +5368,6 @@ var init_pgSerializer = __esm({
|
|
7693
5368
|
"src/serializer/pgSerializer.ts"() {
|
7694
5369
|
"use strict";
|
7695
5370
|
init_serializer();
|
7696
|
-
init_source();
|
7697
5371
|
init_outputs();
|
7698
5372
|
dialect4 = new PgDialect();
|
7699
5373
|
trimChar = (str, char) => {
|
@@ -8298,10 +5972,6 @@ var sqliteSchemaToDrizzle = (schema3) => {
|
|
8298
5972
|
return tables;
|
8299
5973
|
};
|
8300
5974
|
|
8301
|
-
// src/cli/utils.ts
|
8302
|
-
init_views();
|
8303
|
-
var import_semver = __toESM(require_semver2());
|
8304
|
-
|
8305
5975
|
// src/cli/commands/sqliteIntrospect.ts
|
8306
5976
|
init_views();
|
8307
5977
|
init_global();
|
@@ -8412,10 +6082,10 @@ Array.prototype.random = function() {
|
|
8412
6082
|
return this[~~(Math.random() * this.length)];
|
8413
6083
|
};
|
8414
6084
|
|
8415
|
-
// node_modules/.pnpm/minimatch@7.4.
|
6085
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/index.js
|
8416
6086
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
8417
6087
|
|
8418
|
-
// node_modules/.pnpm/minimatch@7.4.
|
6088
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/brace-expressions.js
|
8419
6089
|
var posixClasses = {
|
8420
6090
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
8421
6091
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
@@ -8525,17 +6195,17 @@ var parseClass = (glob2, position) => {
|
|
8525
6195
|
return [comb, uflag, endPos - pos, true];
|
8526
6196
|
};
|
8527
6197
|
|
8528
|
-
// node_modules/.pnpm/minimatch@7.4.
|
6198
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/escape.js
|
8529
6199
|
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
8530
6200
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
8531
6201
|
};
|
8532
6202
|
|
8533
|
-
// node_modules/.pnpm/minimatch@7.4.
|
6203
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/unescape.js
|
8534
6204
|
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
8535
6205
|
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
8536
6206
|
};
|
8537
6207
|
|
8538
|
-
// node_modules/.pnpm/minimatch@7.4.
|
6208
|
+
// node_modules/.pnpm/minimatch@7.4.6/node_modules/minimatch/dist/mjs/index.js
|
8539
6209
|
var minimatch = (p, pattern, options = {}) => {
|
8540
6210
|
assertValidPattern(pattern);
|
8541
6211
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|