drizzle-kit 0.20.17-8b4d89e → 0.20.17-9f0ea64
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +17975 -7386
- package/cli/commands/migrate.d.ts +41 -41
- package/cli/commands/mysqlIntrospect.d.ts +9 -9
- package/cli/commands/pgIntrospect.d.ts +7 -7
- package/cli/commands/sqliteIntrospect.d.ts +12 -12
- package/cli/utils.d.ts +1 -0
- package/cli/validations/cli.d.ts +11 -11
- package/cli/validations/common.d.ts +27 -27
- package/cli/validations/mysql.d.ts +4 -4
- package/cli/validations/pg.d.ts +4 -10
- package/index.d.mts +15 -9
- package/index.d.ts +15 -9
- package/package.json +9 -6
- package/payload.js +3145 -3787
- package/payload.mjs +322 -964
- package/schemaValidator.d.ts +221 -221
- package/serializer/mysqlSchema.d.ts +910 -1224
- package/serializer/pgSchema.d.ts +734 -734
- package/serializer/sqliteSchema.d.ts +457 -457
- package/snapshotsDiffer.d.ts +314 -314
- package/utils-studio.js +926 -1051
- package/utils-studio.mjs +888 -1013
- package/utils.js +217 -852
- package/utils.mjs +192 -827
package/utils-studio.js
CHANGED
@@ -33,12 +33,522 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
33
33
|
));
|
34
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
35
35
|
|
36
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
37
|
+
function assembleStyles() {
|
38
|
+
const codes = /* @__PURE__ */ new Map();
|
39
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
40
|
+
for (const [styleName, style] of Object.entries(group)) {
|
41
|
+
styles[styleName] = {
|
42
|
+
open: `\x1B[${style[0]}m`,
|
43
|
+
close: `\x1B[${style[1]}m`
|
44
|
+
};
|
45
|
+
group[styleName] = styles[styleName];
|
46
|
+
codes.set(style[0], style[1]);
|
47
|
+
}
|
48
|
+
Object.defineProperty(styles, groupName, {
|
49
|
+
value: group,
|
50
|
+
enumerable: false
|
51
|
+
});
|
52
|
+
}
|
53
|
+
Object.defineProperty(styles, "codes", {
|
54
|
+
value: codes,
|
55
|
+
enumerable: false
|
56
|
+
});
|
57
|
+
styles.color.close = "\x1B[39m";
|
58
|
+
styles.bgColor.close = "\x1B[49m";
|
59
|
+
styles.color.ansi = wrapAnsi16();
|
60
|
+
styles.color.ansi256 = wrapAnsi256();
|
61
|
+
styles.color.ansi16m = wrapAnsi16m();
|
62
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
63
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
64
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
65
|
+
Object.defineProperties(styles, {
|
66
|
+
rgbToAnsi256: {
|
67
|
+
value(red, green, blue) {
|
68
|
+
if (red === green && green === blue) {
|
69
|
+
if (red < 8) {
|
70
|
+
return 16;
|
71
|
+
}
|
72
|
+
if (red > 248) {
|
73
|
+
return 231;
|
74
|
+
}
|
75
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
76
|
+
}
|
77
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
78
|
+
},
|
79
|
+
enumerable: false
|
80
|
+
},
|
81
|
+
hexToRgb: {
|
82
|
+
value(hex) {
|
83
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
84
|
+
if (!matches) {
|
85
|
+
return [0, 0, 0];
|
86
|
+
}
|
87
|
+
let [colorString] = matches;
|
88
|
+
if (colorString.length === 3) {
|
89
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
90
|
+
}
|
91
|
+
const integer = Number.parseInt(colorString, 16);
|
92
|
+
return [
|
93
|
+
/* eslint-disable no-bitwise */
|
94
|
+
integer >> 16 & 255,
|
95
|
+
integer >> 8 & 255,
|
96
|
+
integer & 255
|
97
|
+
/* eslint-enable no-bitwise */
|
98
|
+
];
|
99
|
+
},
|
100
|
+
enumerable: false
|
101
|
+
},
|
102
|
+
hexToAnsi256: {
|
103
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
104
|
+
enumerable: false
|
105
|
+
},
|
106
|
+
ansi256ToAnsi: {
|
107
|
+
value(code) {
|
108
|
+
if (code < 8) {
|
109
|
+
return 30 + code;
|
110
|
+
}
|
111
|
+
if (code < 16) {
|
112
|
+
return 90 + (code - 8);
|
113
|
+
}
|
114
|
+
let red;
|
115
|
+
let green;
|
116
|
+
let blue;
|
117
|
+
if (code >= 232) {
|
118
|
+
red = ((code - 232) * 10 + 8) / 255;
|
119
|
+
green = red;
|
120
|
+
blue = red;
|
121
|
+
} else {
|
122
|
+
code -= 16;
|
123
|
+
const remainder = code % 36;
|
124
|
+
red = Math.floor(code / 36) / 5;
|
125
|
+
green = Math.floor(remainder / 6) / 5;
|
126
|
+
blue = remainder % 6 / 5;
|
127
|
+
}
|
128
|
+
const value = Math.max(red, green, blue) * 2;
|
129
|
+
if (value === 0) {
|
130
|
+
return 30;
|
131
|
+
}
|
132
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
133
|
+
if (value === 2) {
|
134
|
+
result += 60;
|
135
|
+
}
|
136
|
+
return result;
|
137
|
+
},
|
138
|
+
enumerable: false
|
139
|
+
},
|
140
|
+
rgbToAnsi: {
|
141
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
142
|
+
enumerable: false
|
143
|
+
},
|
144
|
+
hexToAnsi: {
|
145
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
146
|
+
enumerable: false
|
147
|
+
}
|
148
|
+
});
|
149
|
+
return styles;
|
150
|
+
}
|
151
|
+
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
152
|
+
var init_ansi_styles = __esm({
|
153
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
154
|
+
ANSI_BACKGROUND_OFFSET = 10;
|
155
|
+
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
156
|
+
wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
157
|
+
wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
158
|
+
styles = {
|
159
|
+
modifier: {
|
160
|
+
reset: [0, 0],
|
161
|
+
// 21 isn't widely supported and 22 does the same thing
|
162
|
+
bold: [1, 22],
|
163
|
+
dim: [2, 22],
|
164
|
+
italic: [3, 23],
|
165
|
+
underline: [4, 24],
|
166
|
+
overline: [53, 55],
|
167
|
+
inverse: [7, 27],
|
168
|
+
hidden: [8, 28],
|
169
|
+
strikethrough: [9, 29]
|
170
|
+
},
|
171
|
+
color: {
|
172
|
+
black: [30, 39],
|
173
|
+
red: [31, 39],
|
174
|
+
green: [32, 39],
|
175
|
+
yellow: [33, 39],
|
176
|
+
blue: [34, 39],
|
177
|
+
magenta: [35, 39],
|
178
|
+
cyan: [36, 39],
|
179
|
+
white: [37, 39],
|
180
|
+
// Bright color
|
181
|
+
blackBright: [90, 39],
|
182
|
+
gray: [90, 39],
|
183
|
+
// Alias of `blackBright`
|
184
|
+
grey: [90, 39],
|
185
|
+
// Alias of `blackBright`
|
186
|
+
redBright: [91, 39],
|
187
|
+
greenBright: [92, 39],
|
188
|
+
yellowBright: [93, 39],
|
189
|
+
blueBright: [94, 39],
|
190
|
+
magentaBright: [95, 39],
|
191
|
+
cyanBright: [96, 39],
|
192
|
+
whiteBright: [97, 39]
|
193
|
+
},
|
194
|
+
bgColor: {
|
195
|
+
bgBlack: [40, 49],
|
196
|
+
bgRed: [41, 49],
|
197
|
+
bgGreen: [42, 49],
|
198
|
+
bgYellow: [43, 49],
|
199
|
+
bgBlue: [44, 49],
|
200
|
+
bgMagenta: [45, 49],
|
201
|
+
bgCyan: [46, 49],
|
202
|
+
bgWhite: [47, 49],
|
203
|
+
// Bright color
|
204
|
+
bgBlackBright: [100, 49],
|
205
|
+
bgGray: [100, 49],
|
206
|
+
// Alias of `bgBlackBright`
|
207
|
+
bgGrey: [100, 49],
|
208
|
+
// Alias of `bgBlackBright`
|
209
|
+
bgRedBright: [101, 49],
|
210
|
+
bgGreenBright: [102, 49],
|
211
|
+
bgYellowBright: [103, 49],
|
212
|
+
bgBlueBright: [104, 49],
|
213
|
+
bgMagentaBright: [105, 49],
|
214
|
+
bgCyanBright: [106, 49],
|
215
|
+
bgWhiteBright: [107, 49]
|
216
|
+
}
|
217
|
+
};
|
218
|
+
modifierNames = Object.keys(styles.modifier);
|
219
|
+
foregroundColorNames = Object.keys(styles.color);
|
220
|
+
backgroundColorNames = Object.keys(styles.bgColor);
|
221
|
+
colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
222
|
+
ansiStyles = assembleStyles();
|
223
|
+
ansi_styles_default = ansiStyles;
|
224
|
+
}
|
225
|
+
});
|
226
|
+
|
227
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js
|
228
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process.default.argv) {
|
229
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
230
|
+
const position = argv.indexOf(prefix + flag);
|
231
|
+
const terminatorPosition = argv.indexOf("--");
|
232
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
233
|
+
}
|
234
|
+
function envForceColor() {
|
235
|
+
if ("FORCE_COLOR" in env) {
|
236
|
+
if (env.FORCE_COLOR === "true") {
|
237
|
+
return 1;
|
238
|
+
}
|
239
|
+
if (env.FORCE_COLOR === "false") {
|
240
|
+
return 0;
|
241
|
+
}
|
242
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
function translateLevel(level) {
|
246
|
+
if (level === 0) {
|
247
|
+
return false;
|
248
|
+
}
|
249
|
+
return {
|
250
|
+
level,
|
251
|
+
hasBasic: true,
|
252
|
+
has256: level >= 2,
|
253
|
+
has16m: level >= 3
|
254
|
+
};
|
255
|
+
}
|
256
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
257
|
+
const noFlagForceColor = envForceColor();
|
258
|
+
if (noFlagForceColor !== void 0) {
|
259
|
+
flagForceColor = noFlagForceColor;
|
260
|
+
}
|
261
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
262
|
+
if (forceColor === 0) {
|
263
|
+
return 0;
|
264
|
+
}
|
265
|
+
if (sniffFlags) {
|
266
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
267
|
+
return 3;
|
268
|
+
}
|
269
|
+
if (hasFlag("color=256")) {
|
270
|
+
return 2;
|
271
|
+
}
|
272
|
+
}
|
273
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
274
|
+
return 1;
|
275
|
+
}
|
276
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
277
|
+
return 0;
|
278
|
+
}
|
279
|
+
const min = forceColor || 0;
|
280
|
+
if (env.TERM === "dumb") {
|
281
|
+
return min;
|
282
|
+
}
|
283
|
+
if (import_node_process.default.platform === "win32") {
|
284
|
+
const osRelease = import_node_os.default.release().split(".");
|
285
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
286
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
287
|
+
}
|
288
|
+
return 1;
|
289
|
+
}
|
290
|
+
if ("CI" in env) {
|
291
|
+
if ("GITHUB_ACTIONS" in env) {
|
292
|
+
return 3;
|
293
|
+
}
|
294
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
295
|
+
return 1;
|
296
|
+
}
|
297
|
+
return min;
|
298
|
+
}
|
299
|
+
if ("TEAMCITY_VERSION" in env) {
|
300
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
301
|
+
}
|
302
|
+
if (env.COLORTERM === "truecolor") {
|
303
|
+
return 3;
|
304
|
+
}
|
305
|
+
if (env.TERM === "xterm-kitty") {
|
306
|
+
return 3;
|
307
|
+
}
|
308
|
+
if ("TERM_PROGRAM" in env) {
|
309
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
310
|
+
switch (env.TERM_PROGRAM) {
|
311
|
+
case "iTerm.app": {
|
312
|
+
return version >= 3 ? 3 : 2;
|
313
|
+
}
|
314
|
+
case "Apple_Terminal": {
|
315
|
+
return 2;
|
316
|
+
}
|
317
|
+
}
|
318
|
+
}
|
319
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
320
|
+
return 2;
|
321
|
+
}
|
322
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
323
|
+
return 1;
|
324
|
+
}
|
325
|
+
if ("COLORTERM" in env) {
|
326
|
+
return 1;
|
327
|
+
}
|
328
|
+
return min;
|
329
|
+
}
|
330
|
+
function createSupportsColor(stream, options = {}) {
|
331
|
+
const level = _supportsColor(stream, {
|
332
|
+
streamIsTTY: stream && stream.isTTY,
|
333
|
+
...options
|
334
|
+
});
|
335
|
+
return translateLevel(level);
|
336
|
+
}
|
337
|
+
var import_node_process, import_node_os, import_node_tty, env, flagForceColor, supportsColor, supports_color_default;
|
338
|
+
var init_supports_color = __esm({
|
339
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
340
|
+
import_node_process = __toESM(require("node:process"), 1);
|
341
|
+
import_node_os = __toESM(require("node:os"), 1);
|
342
|
+
import_node_tty = __toESM(require("node:tty"), 1);
|
343
|
+
({ env } = import_node_process.default);
|
344
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
345
|
+
flagForceColor = 0;
|
346
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
347
|
+
flagForceColor = 1;
|
348
|
+
}
|
349
|
+
supportsColor = {
|
350
|
+
stdout: createSupportsColor({ isTTY: import_node_tty.default.isatty(1) }),
|
351
|
+
stderr: createSupportsColor({ isTTY: import_node_tty.default.isatty(2) })
|
352
|
+
};
|
353
|
+
supports_color_default = supportsColor;
|
354
|
+
}
|
355
|
+
});
|
356
|
+
|
357
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js
|
358
|
+
function stringReplaceAll(string, substring, replacer) {
|
359
|
+
let index4 = string.indexOf(substring);
|
360
|
+
if (index4 === -1) {
|
361
|
+
return string;
|
362
|
+
}
|
363
|
+
const substringLength = substring.length;
|
364
|
+
let endIndex = 0;
|
365
|
+
let returnValue = "";
|
366
|
+
do {
|
367
|
+
returnValue += string.slice(endIndex, index4) + substring + replacer;
|
368
|
+
endIndex = index4 + substringLength;
|
369
|
+
index4 = string.indexOf(substring, endIndex);
|
370
|
+
} while (index4 !== -1);
|
371
|
+
returnValue += string.slice(endIndex);
|
372
|
+
return returnValue;
|
373
|
+
}
|
374
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
|
375
|
+
let endIndex = 0;
|
376
|
+
let returnValue = "";
|
377
|
+
do {
|
378
|
+
const gotCR = string[index4 - 1] === "\r";
|
379
|
+
returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
380
|
+
endIndex = index4 + 1;
|
381
|
+
index4 = string.indexOf("\n", endIndex);
|
382
|
+
} while (index4 !== -1);
|
383
|
+
returnValue += string.slice(endIndex);
|
384
|
+
return returnValue;
|
385
|
+
}
|
386
|
+
var init_utilities = __esm({
|
387
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/utilities.js"() {
|
388
|
+
}
|
389
|
+
});
|
390
|
+
|
391
|
+
// node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js
|
392
|
+
function createChalk(options) {
|
393
|
+
return chalkFactory(options);
|
394
|
+
}
|
395
|
+
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr;
|
396
|
+
var init_source = __esm({
|
397
|
+
"node_modules/.pnpm/chalk@5.2.0/node_modules/chalk/source/index.js"() {
|
398
|
+
init_ansi_styles();
|
399
|
+
init_supports_color();
|
400
|
+
init_utilities();
|
401
|
+
init_ansi_styles();
|
402
|
+
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
403
|
+
GENERATOR = Symbol("GENERATOR");
|
404
|
+
STYLER = Symbol("STYLER");
|
405
|
+
IS_EMPTY = Symbol("IS_EMPTY");
|
406
|
+
levelMapping = [
|
407
|
+
"ansi",
|
408
|
+
"ansi",
|
409
|
+
"ansi256",
|
410
|
+
"ansi16m"
|
411
|
+
];
|
412
|
+
styles2 = /* @__PURE__ */ Object.create(null);
|
413
|
+
applyOptions = (object, options = {}) => {
|
414
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
415
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
416
|
+
}
|
417
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
418
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
419
|
+
};
|
420
|
+
chalkFactory = (options) => {
|
421
|
+
const chalk2 = (...strings) => strings.join(" ");
|
422
|
+
applyOptions(chalk2, options);
|
423
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
424
|
+
return chalk2;
|
425
|
+
};
|
426
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
427
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
428
|
+
styles2[styleName] = {
|
429
|
+
get() {
|
430
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
431
|
+
Object.defineProperty(this, styleName, { value: builder });
|
432
|
+
return builder;
|
433
|
+
}
|
434
|
+
};
|
435
|
+
}
|
436
|
+
styles2.visible = {
|
437
|
+
get() {
|
438
|
+
const builder = createBuilder(this, this[STYLER], true);
|
439
|
+
Object.defineProperty(this, "visible", { value: builder });
|
440
|
+
return builder;
|
441
|
+
}
|
442
|
+
};
|
443
|
+
getModelAnsi = (model, level, type, ...arguments_) => {
|
444
|
+
if (model === "rgb") {
|
445
|
+
if (level === "ansi16m") {
|
446
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
447
|
+
}
|
448
|
+
if (level === "ansi256") {
|
449
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
450
|
+
}
|
451
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
452
|
+
}
|
453
|
+
if (model === "hex") {
|
454
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
455
|
+
}
|
456
|
+
return ansi_styles_default[type][model](...arguments_);
|
457
|
+
};
|
458
|
+
usedModels = ["rgb", "hex", "ansi256"];
|
459
|
+
for (const model of usedModels) {
|
460
|
+
styles2[model] = {
|
461
|
+
get() {
|
462
|
+
const { level } = this;
|
463
|
+
return function(...arguments_) {
|
464
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
465
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
466
|
+
};
|
467
|
+
}
|
468
|
+
};
|
469
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
470
|
+
styles2[bgModel] = {
|
471
|
+
get() {
|
472
|
+
const { level } = this;
|
473
|
+
return function(...arguments_) {
|
474
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
475
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
476
|
+
};
|
477
|
+
}
|
478
|
+
};
|
479
|
+
}
|
480
|
+
proto = Object.defineProperties(() => {
|
481
|
+
}, {
|
482
|
+
...styles2,
|
483
|
+
level: {
|
484
|
+
enumerable: true,
|
485
|
+
get() {
|
486
|
+
return this[GENERATOR].level;
|
487
|
+
},
|
488
|
+
set(level) {
|
489
|
+
this[GENERATOR].level = level;
|
490
|
+
}
|
491
|
+
}
|
492
|
+
});
|
493
|
+
createStyler = (open, close, parent) => {
|
494
|
+
let openAll;
|
495
|
+
let closeAll;
|
496
|
+
if (parent === void 0) {
|
497
|
+
openAll = open;
|
498
|
+
closeAll = close;
|
499
|
+
} else {
|
500
|
+
openAll = parent.openAll + open;
|
501
|
+
closeAll = close + parent.closeAll;
|
502
|
+
}
|
503
|
+
return {
|
504
|
+
open,
|
505
|
+
close,
|
506
|
+
openAll,
|
507
|
+
closeAll,
|
508
|
+
parent
|
509
|
+
};
|
510
|
+
};
|
511
|
+
createBuilder = (self2, _styler, _isEmpty) => {
|
512
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
513
|
+
Object.setPrototypeOf(builder, proto);
|
514
|
+
builder[GENERATOR] = self2;
|
515
|
+
builder[STYLER] = _styler;
|
516
|
+
builder[IS_EMPTY] = _isEmpty;
|
517
|
+
return builder;
|
518
|
+
};
|
519
|
+
applyStyle = (self2, string) => {
|
520
|
+
if (self2.level <= 0 || !string) {
|
521
|
+
return self2[IS_EMPTY] ? "" : string;
|
522
|
+
}
|
523
|
+
let styler = self2[STYLER];
|
524
|
+
if (styler === void 0) {
|
525
|
+
return string;
|
526
|
+
}
|
527
|
+
const { openAll, closeAll } = styler;
|
528
|
+
if (string.includes("\x1B")) {
|
529
|
+
while (styler !== void 0) {
|
530
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
531
|
+
styler = styler.parent;
|
532
|
+
}
|
533
|
+
}
|
534
|
+
const lfIndex = string.indexOf("\n");
|
535
|
+
if (lfIndex !== -1) {
|
536
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
537
|
+
}
|
538
|
+
return openAll + string + closeAll;
|
539
|
+
};
|
540
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
541
|
+
chalk = createChalk();
|
542
|
+
chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
543
|
+
}
|
544
|
+
});
|
545
|
+
|
36
546
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js
|
37
547
|
var require_readline = __commonJS({
|
38
|
-
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(
|
548
|
+
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(exports) {
|
39
549
|
"use strict";
|
40
|
-
Object.defineProperty(
|
41
|
-
|
550
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
551
|
+
exports.prepareReadLine = void 0;
|
42
552
|
var prepareReadLine = () => {
|
43
553
|
const stdin = process.stdin;
|
44
554
|
const stdout = process.stdout;
|
@@ -54,13 +564,13 @@ var require_readline = __commonJS({
|
|
54
564
|
closable: rl
|
55
565
|
};
|
56
566
|
};
|
57
|
-
|
567
|
+
exports.prepareReadLine = prepareReadLine;
|
58
568
|
}
|
59
569
|
});
|
60
570
|
|
61
571
|
// node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
62
572
|
var require_src = __commonJS({
|
63
|
-
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(
|
573
|
+
"node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module2) {
|
64
574
|
"use strict";
|
65
575
|
var ESC = "\x1B";
|
66
576
|
var CSI = `${ESC}[`;
|
@@ -121,10 +631,10 @@ var require_src = __commonJS({
|
|
121
631
|
|
122
632
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/utils.js
|
123
633
|
var require_utils = __commonJS({
|
124
|
-
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/utils.js"(
|
634
|
+
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/utils.js"(exports) {
|
125
635
|
"use strict";
|
126
|
-
Object.defineProperty(
|
127
|
-
|
636
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
637
|
+
exports.clear = void 0;
|
128
638
|
var sisteransi_1 = require_src();
|
129
639
|
var strip = (str) => {
|
130
640
|
const pattern = [
|
@@ -145,13 +655,13 @@ var require_utils = __commonJS({
|
|
145
655
|
}
|
146
656
|
return sisteransi_1.erase.lines(rows);
|
147
657
|
};
|
148
|
-
|
658
|
+
exports.clear = clear;
|
149
659
|
}
|
150
660
|
});
|
151
661
|
|
152
662
|
// node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js
|
153
663
|
var require_lodash = __commonJS({
|
154
|
-
"node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js"(
|
664
|
+
"node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js"(exports, module2) {
|
155
665
|
var FUNC_ERROR_TEXT = "Expected a function";
|
156
666
|
var NAN = 0 / 0;
|
157
667
|
var symbolTag = "[object Symbol]";
|
@@ -299,9 +809,9 @@ var require_lodash = __commonJS({
|
|
299
809
|
|
300
810
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/index.js
|
301
811
|
var require_hanji = __commonJS({
|
302
|
-
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/index.js"(
|
812
|
+
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/index.js"(exports) {
|
303
813
|
"use strict";
|
304
|
-
var __awaiter =
|
814
|
+
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
305
815
|
function adopt(value) {
|
306
816
|
return value instanceof P ? value : new P(function(resolve) {
|
307
817
|
resolve(value);
|
@@ -328,11 +838,11 @@ var require_hanji = __commonJS({
|
|
328
838
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
329
839
|
});
|
330
840
|
};
|
331
|
-
var __importDefault =
|
841
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
332
842
|
return mod && mod.__esModule ? mod : { "default": mod };
|
333
843
|
};
|
334
|
-
Object.defineProperty(
|
335
|
-
|
844
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
845
|
+
exports.onTerminate = exports.renderWithTask = exports.render = exports.TaskTerminal = exports.TaskView = exports.Terminal = exports.deferred = exports.SelectState = exports.Prompt = void 0;
|
336
846
|
var readline_1 = require_readline();
|
337
847
|
var sisteransi_1 = require_src();
|
338
848
|
var utils_1 = require_utils();
|
@@ -367,7 +877,7 @@ var require_hanji = __commonJS({
|
|
367
877
|
this.inputCallbacks.forEach((it) => it(str, key));
|
368
878
|
}
|
369
879
|
};
|
370
|
-
|
880
|
+
exports.Prompt = Prompt2;
|
371
881
|
var SelectState2 = class {
|
372
882
|
constructor(items) {
|
373
883
|
this.items = items;
|
@@ -395,7 +905,7 @@ var require_hanji = __commonJS({
|
|
395
905
|
return false;
|
396
906
|
}
|
397
907
|
};
|
398
|
-
|
908
|
+
exports.SelectState = SelectState2;
|
399
909
|
var deferred = () => {
|
400
910
|
let resolve;
|
401
911
|
let reject;
|
@@ -409,7 +919,7 @@ var require_hanji = __commonJS({
|
|
409
919
|
promise
|
410
920
|
};
|
411
921
|
};
|
412
|
-
|
922
|
+
exports.deferred = deferred;
|
413
923
|
var Terminal = class {
|
414
924
|
constructor(view, stdin, stdout, closable) {
|
415
925
|
this.view = view;
|
@@ -454,7 +964,7 @@ var require_hanji = __commonJS({
|
|
454
964
|
};
|
455
965
|
this.stdin.on("keypress", keypress);
|
456
966
|
this.view.attach(this);
|
457
|
-
const { resolve, promise } = (0,
|
967
|
+
const { resolve, promise } = (0, exports.deferred)();
|
458
968
|
this.resolve = resolve;
|
459
969
|
this.promise = promise;
|
460
970
|
this.renderFunc = (0, lodash_throttle_1.default)((str) => {
|
@@ -485,7 +995,7 @@ var require_hanji = __commonJS({
|
|
485
995
|
this.renderFunc(`${clearPrefix}${string}`);
|
486
996
|
}
|
487
997
|
};
|
488
|
-
|
998
|
+
exports.Terminal = Terminal;
|
489
999
|
var TaskView2 = class {
|
490
1000
|
constructor() {
|
491
1001
|
this.attachCallbacks = [];
|
@@ -510,7 +1020,7 @@ var require_hanji = __commonJS({
|
|
510
1020
|
}
|
511
1021
|
}
|
512
1022
|
};
|
513
|
-
|
1023
|
+
exports.TaskView = TaskView2;
|
514
1024
|
var TaskTerminal = class {
|
515
1025
|
constructor(view, stdout) {
|
516
1026
|
this.view = view;
|
@@ -531,7 +1041,7 @@ var require_hanji = __commonJS({
|
|
531
1041
|
this.stdout.write(`${clearPrefix}${string}`);
|
532
1042
|
}
|
533
1043
|
};
|
534
|
-
|
1044
|
+
exports.TaskTerminal = TaskTerminal;
|
535
1045
|
function render2(view) {
|
536
1046
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
537
1047
|
if (view instanceof Prompt2) {
|
@@ -544,7 +1054,7 @@ var require_hanji = __commonJS({
|
|
544
1054
|
closable.close();
|
545
1055
|
return;
|
546
1056
|
}
|
547
|
-
|
1057
|
+
exports.render = render2;
|
548
1058
|
function renderWithTask2(view, task) {
|
549
1059
|
return __awaiter(this, void 0, void 0, function* () {
|
550
1060
|
const terminal = new TaskTerminal(view, process.stdout);
|
@@ -554,12 +1064,12 @@ var require_hanji = __commonJS({
|
|
554
1064
|
return result;
|
555
1065
|
});
|
556
1066
|
}
|
557
|
-
|
1067
|
+
exports.renderWithTask = renderWithTask2;
|
558
1068
|
var terminateHandler;
|
559
1069
|
function onTerminate(callback) {
|
560
1070
|
terminateHandler = callback;
|
561
1071
|
}
|
562
|
-
|
1072
|
+
exports.onTerminate = onTerminate;
|
563
1073
|
}
|
564
1074
|
});
|
565
1075
|
|
@@ -573,12 +1083,11 @@ var init_global = __esm({
|
|
573
1083
|
}
|
574
1084
|
});
|
575
1085
|
|
576
|
-
// node_modules/.pnpm/zod@3.
|
1086
|
+
// node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs
|
577
1087
|
function getErrorMap() {
|
578
1088
|
return overrideErrorMap;
|
579
1089
|
}
|
580
1090
|
function addIssueToContext(ctx, issueData) {
|
581
|
-
const overrideMap = getErrorMap();
|
582
1091
|
const issue = makeIssue({
|
583
1092
|
issueData,
|
584
1093
|
data: ctx.data,
|
@@ -586,29 +1095,13 @@ function addIssueToContext(ctx, issueData) {
|
|
586
1095
|
errorMaps: [
|
587
1096
|
ctx.common.contextualErrorMap,
|
588
1097
|
ctx.schemaErrorMap,
|
589
|
-
|
590
|
-
|
1098
|
+
getErrorMap(),
|
1099
|
+
errorMap
|
591
1100
|
// then global default map
|
592
1101
|
].filter((x) => !!x)
|
593
1102
|
});
|
594
1103
|
ctx.common.issues.push(issue);
|
595
1104
|
}
|
596
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
597
|
-
if (kind === "a" && !f)
|
598
|
-
throw new TypeError("Private accessor was defined without a getter");
|
599
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
600
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
601
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
602
|
-
}
|
603
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
604
|
-
if (kind === "m")
|
605
|
-
throw new TypeError("Private method is not writable");
|
606
|
-
if (kind === "a" && !f)
|
607
|
-
throw new TypeError("Private accessor was defined without a setter");
|
608
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
609
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
610
|
-
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
611
|
-
}
|
612
1105
|
function processCreateParams(params) {
|
613
1106
|
if (!params)
|
614
1107
|
return {};
|
@@ -619,50 +1112,15 @@ function processCreateParams(params) {
|
|
619
1112
|
if (errorMap2)
|
620
1113
|
return { errorMap: errorMap2, description };
|
621
1114
|
const customMap = (iss, ctx) => {
|
622
|
-
var _a, _b;
|
623
|
-
const { message } = params;
|
624
|
-
if (iss.code === "invalid_enum_value") {
|
625
|
-
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
626
|
-
}
|
627
|
-
if (typeof ctx.data === "undefined") {
|
628
|
-
return { message: (_a = message !== null && message !== void 0 ? message : required_error) !== null && _a !== void 0 ? _a : ctx.defaultError };
|
629
|
-
}
|
630
1115
|
if (iss.code !== "invalid_type")
|
631
1116
|
return { message: ctx.defaultError };
|
632
|
-
|
1117
|
+
if (typeof ctx.data === "undefined") {
|
1118
|
+
return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };
|
1119
|
+
}
|
1120
|
+
return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };
|
633
1121
|
};
|
634
1122
|
return { errorMap: customMap, description };
|
635
1123
|
}
|
636
|
-
function timeRegexSource(args) {
|
637
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
638
|
-
if (args.precision) {
|
639
|
-
regex = `${regex}\\.\\d{${args.precision}}`;
|
640
|
-
} else if (args.precision == null) {
|
641
|
-
regex = `${regex}(\\.\\d+)?`;
|
642
|
-
}
|
643
|
-
return regex;
|
644
|
-
}
|
645
|
-
function timeRegex(args) {
|
646
|
-
return new RegExp(`^${timeRegexSource(args)}$`);
|
647
|
-
}
|
648
|
-
function datetimeRegex(args) {
|
649
|
-
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
650
|
-
const opts = [];
|
651
|
-
opts.push(args.local ? `Z?` : `Z`);
|
652
|
-
if (args.offset)
|
653
|
-
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
654
|
-
regex = `${regex}(${opts.join("|")})`;
|
655
|
-
return new RegExp(`^${regex}$`);
|
656
|
-
}
|
657
|
-
function isValidIP(ip, version) {
|
658
|
-
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
659
|
-
return true;
|
660
|
-
}
|
661
|
-
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
|
662
|
-
return true;
|
663
|
-
}
|
664
|
-
return false;
|
665
|
-
}
|
666
1124
|
function floatSafeRemainder(val, step) {
|
667
1125
|
const valDecCount = (val.toString().split(".")[1] || "").length;
|
668
1126
|
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
@@ -683,10 +1141,7 @@ function deepPartialify(schema3) {
|
|
683
1141
|
shape: () => newShape
|
684
1142
|
});
|
685
1143
|
} else if (schema3 instanceof ZodArray) {
|
686
|
-
return
|
687
|
-
...schema3._def,
|
688
|
-
type: deepPartialify(schema3.element)
|
689
|
-
});
|
1144
|
+
return ZodArray.create(deepPartialify(schema3.element));
|
690
1145
|
} else if (schema3 instanceof ZodOptional) {
|
691
1146
|
return ZodOptional.create(deepPartialify(schema3.unwrap()));
|
692
1147
|
} else if (schema3 instanceof ZodNullable) {
|
@@ -742,9 +1197,9 @@ function createZodEnum(values, params) {
|
|
742
1197
|
...processCreateParams(params)
|
743
1198
|
});
|
744
1199
|
}
|
745
|
-
var util,
|
1200
|
+
var util, ZodParsedType, getParsedType, ZodIssueCode, ZodError, errorMap, overrideErrorMap, makeIssue, ParseStatus, INVALID, DIRTY, OK, isAborted, isDirty, isValid, isAsync, errorUtil, ParseInputLazyPath, handleResult, ZodType, cuidRegex, uuidRegex, emailRegex, datetimeRegex, ZodString, ZodNumber, ZodBigInt, ZodBoolean, ZodDate, ZodSymbol, ZodUndefined, ZodNull, ZodAny, ZodUnknown, ZodNever, ZodVoid, ZodArray, objectUtil, AugmentFactory, ZodObject, ZodUnion, getDiscriminator, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodMap, ZodSet, ZodFunction, ZodLazy, ZodLiteral, ZodEnum, ZodNativeEnum, ZodPromise, ZodEffects, ZodOptional, ZodNullable, ZodDefault, ZodCatch, ZodNaN, BRAND, ZodBranded, ZodPipeline, 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;
|
746
1201
|
var init_lib = __esm({
|
747
|
-
"node_modules/.pnpm/zod@3.
|
1202
|
+
"node_modules/.pnpm/zod@3.20.2/node_modules/zod/lib/index.mjs"() {
|
748
1203
|
(function(util2) {
|
749
1204
|
util2.assertEqual = (val) => val;
|
750
1205
|
function assertIs(_arg) {
|
@@ -802,15 +1257,6 @@ var init_lib = __esm({
|
|
802
1257
|
return value;
|
803
1258
|
};
|
804
1259
|
})(util || (util = {}));
|
805
|
-
(function(objectUtil2) {
|
806
|
-
objectUtil2.mergeShapes = (first, second) => {
|
807
|
-
return {
|
808
|
-
...first,
|
809
|
-
...second
|
810
|
-
// second overwrites first
|
811
|
-
};
|
812
|
-
};
|
813
|
-
})(objectUtil || (objectUtil = {}));
|
814
1260
|
ZodParsedType = util.arrayToEnum([
|
815
1261
|
"string",
|
816
1262
|
"nan",
|
@@ -892,7 +1338,7 @@ var init_lib = __esm({
|
|
892
1338
|
"not_multiple_of",
|
893
1339
|
"not_finite"
|
894
1340
|
]);
|
895
|
-
ZodError = class
|
1341
|
+
ZodError = class extends Error {
|
896
1342
|
constructor(issues) {
|
897
1343
|
super();
|
898
1344
|
this.issues = [];
|
@@ -950,11 +1396,6 @@ var init_lib = __esm({
|
|
950
1396
|
processError(this);
|
951
1397
|
return fieldErrors;
|
952
1398
|
}
|
953
|
-
static assert(value) {
|
954
|
-
if (!(value instanceof _ZodError)) {
|
955
|
-
throw new Error(`Not a ZodError: ${value}`);
|
956
|
-
}
|
957
|
-
}
|
958
1399
|
toString() {
|
959
1400
|
return this.message;
|
960
1401
|
}
|
@@ -1021,12 +1462,7 @@ var init_lib = __esm({
|
|
1021
1462
|
break;
|
1022
1463
|
case ZodIssueCode.invalid_string:
|
1023
1464
|
if (typeof issue.validation === "object") {
|
1024
|
-
if ("
|
1025
|
-
message = `Invalid input: must include "${issue.validation.includes}"`;
|
1026
|
-
if (typeof issue.validation.position === "number") {
|
1027
|
-
message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
|
1028
|
-
}
|
1029
|
-
} else if ("startsWith" in issue.validation) {
|
1465
|
+
if ("startsWith" in issue.validation) {
|
1030
1466
|
message = `Invalid input: must start with "${issue.validation.startsWith}"`;
|
1031
1467
|
} else if ("endsWith" in issue.validation) {
|
1032
1468
|
message = `Invalid input: must end with "${issue.validation.endsWith}"`;
|
@@ -1047,7 +1483,7 @@ var init_lib = __esm({
|
|
1047
1483
|
else if (issue.type === "number")
|
1048
1484
|
message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
|
1049
1485
|
else if (issue.type === "date")
|
1050
|
-
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(
|
1486
|
+
message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(issue.minimum)}`;
|
1051
1487
|
else
|
1052
1488
|
message = "Invalid input";
|
1053
1489
|
break;
|
@@ -1058,10 +1494,8 @@ var init_lib = __esm({
|
|
1058
1494
|
message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
|
1059
1495
|
else if (issue.type === "number")
|
1060
1496
|
message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
1061
|
-
else if (issue.type === "bigint")
|
1062
|
-
message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
|
1063
1497
|
else if (issue.type === "date")
|
1064
|
-
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(
|
1498
|
+
message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(issue.maximum)}`;
|
1065
1499
|
else
|
1066
1500
|
message = "Invalid input";
|
1067
1501
|
break;
|
@@ -1091,13 +1525,6 @@ var init_lib = __esm({
|
|
1091
1525
|
...issueData,
|
1092
1526
|
path: fullPath
|
1093
1527
|
};
|
1094
|
-
if (issueData.message !== void 0) {
|
1095
|
-
return {
|
1096
|
-
...issueData,
|
1097
|
-
path: fullPath,
|
1098
|
-
message: issueData.message
|
1099
|
-
};
|
1100
|
-
}
|
1101
1528
|
let errorMessage = "";
|
1102
1529
|
const maps = errorMaps.filter((m) => !!m).slice().reverse();
|
1103
1530
|
for (const map of maps) {
|
@@ -1106,7 +1533,7 @@ var init_lib = __esm({
|
|
1106
1533
|
return {
|
1107
1534
|
...issueData,
|
1108
1535
|
path: fullPath,
|
1109
|
-
message: errorMessage
|
1536
|
+
message: issueData.message || errorMessage
|
1110
1537
|
};
|
1111
1538
|
};
|
1112
1539
|
ParseStatus = class _ParseStatus {
|
@@ -1135,11 +1562,9 @@ var init_lib = __esm({
|
|
1135
1562
|
static async mergeObjectAsync(status, pairs) {
|
1136
1563
|
const syncPairs = [];
|
1137
1564
|
for (const pair of pairs) {
|
1138
|
-
const key = await pair.key;
|
1139
|
-
const value = await pair.value;
|
1140
1565
|
syncPairs.push({
|
1141
|
-
key,
|
1142
|
-
value
|
1566
|
+
key: await pair.key,
|
1567
|
+
value: await pair.value
|
1143
1568
|
});
|
1144
1569
|
}
|
1145
1570
|
return _ParseStatus.mergeObjectSync(status, syncPairs);
|
@@ -1156,7 +1581,7 @@ var init_lib = __esm({
|
|
1156
1581
|
status.dirty();
|
1157
1582
|
if (value.status === "dirty")
|
1158
1583
|
status.dirty();
|
1159
|
-
if (
|
1584
|
+
if (typeof value.value !== "undefined" || pair.alwaysSet) {
|
1160
1585
|
finalObject[key.value] = value.value;
|
1161
1586
|
}
|
1162
1587
|
}
|
@@ -1171,28 +1596,20 @@ var init_lib = __esm({
|
|
1171
1596
|
isAborted = (x) => x.status === "aborted";
|
1172
1597
|
isDirty = (x) => x.status === "dirty";
|
1173
1598
|
isValid = (x) => x.status === "valid";
|
1174
|
-
isAsync = (x) => typeof Promise !==
|
1599
|
+
isAsync = (x) => typeof Promise !== void 0 && x instanceof Promise;
|
1175
1600
|
(function(errorUtil2) {
|
1176
1601
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
1177
1602
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message;
|
1178
1603
|
})(errorUtil || (errorUtil = {}));
|
1179
1604
|
ParseInputLazyPath = class {
|
1180
1605
|
constructor(parent, value, path2, key) {
|
1181
|
-
this._cachedPath = [];
|
1182
1606
|
this.parent = parent;
|
1183
1607
|
this.data = value;
|
1184
1608
|
this._path = path2;
|
1185
1609
|
this._key = key;
|
1186
1610
|
}
|
1187
1611
|
get path() {
|
1188
|
-
|
1189
|
-
if (this._key instanceof Array) {
|
1190
|
-
this._cachedPath.push(...this._path, ...this._key);
|
1191
|
-
} else {
|
1192
|
-
this._cachedPath.push(...this._path, this._key);
|
1193
|
-
}
|
1194
|
-
}
|
1195
|
-
return this._cachedPath;
|
1612
|
+
return this._path.concat(this._key);
|
1196
1613
|
}
|
1197
1614
|
};
|
1198
1615
|
handleResult = (ctx, result) => {
|
@@ -1202,16 +1619,8 @@ var init_lib = __esm({
|
|
1202
1619
|
if (!ctx.common.issues.length) {
|
1203
1620
|
throw new Error("Validation failed but no issues detected.");
|
1204
1621
|
}
|
1205
|
-
|
1206
|
-
|
1207
|
-
get error() {
|
1208
|
-
if (this._error)
|
1209
|
-
return this._error;
|
1210
|
-
const error2 = new ZodError(ctx.common.issues);
|
1211
|
-
this._error = error2;
|
1212
|
-
return this._error;
|
1213
|
-
}
|
1214
|
-
};
|
1622
|
+
const error2 = new ZodError(ctx.common.issues);
|
1623
|
+
return { success: false, error: error2 };
|
1215
1624
|
}
|
1216
1625
|
};
|
1217
1626
|
ZodType = class {
|
@@ -1239,7 +1648,6 @@ var init_lib = __esm({
|
|
1239
1648
|
this.catch = this.catch.bind(this);
|
1240
1649
|
this.describe = this.describe.bind(this);
|
1241
1650
|
this.pipe = this.pipe.bind(this);
|
1242
|
-
this.readonly = this.readonly.bind(this);
|
1243
1651
|
this.isNullable = this.isNullable.bind(this);
|
1244
1652
|
this.isOptional = this.isOptional.bind(this);
|
1245
1653
|
}
|
@@ -1384,29 +1792,28 @@ var init_lib = __esm({
|
|
1384
1792
|
return this._refinement(refinement);
|
1385
1793
|
}
|
1386
1794
|
optional() {
|
1387
|
-
return ZodOptional.create(this
|
1795
|
+
return ZodOptional.create(this);
|
1388
1796
|
}
|
1389
1797
|
nullable() {
|
1390
|
-
return ZodNullable.create(this
|
1798
|
+
return ZodNullable.create(this);
|
1391
1799
|
}
|
1392
1800
|
nullish() {
|
1393
|
-
return this.
|
1801
|
+
return this.optional().nullable();
|
1394
1802
|
}
|
1395
1803
|
array() {
|
1396
|
-
return ZodArray.create(this
|
1804
|
+
return ZodArray.create(this);
|
1397
1805
|
}
|
1398
1806
|
promise() {
|
1399
|
-
return ZodPromise.create(this
|
1807
|
+
return ZodPromise.create(this);
|
1400
1808
|
}
|
1401
1809
|
or(option) {
|
1402
|
-
return ZodUnion.create([this, option]
|
1810
|
+
return ZodUnion.create([this, option]);
|
1403
1811
|
}
|
1404
1812
|
and(incoming) {
|
1405
|
-
return ZodIntersection.create(this, incoming
|
1813
|
+
return ZodIntersection.create(this, incoming);
|
1406
1814
|
}
|
1407
1815
|
transform(transform) {
|
1408
1816
|
return new ZodEffects({
|
1409
|
-
...processCreateParams(this._def),
|
1410
1817
|
schema: this,
|
1411
1818
|
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
1412
1819
|
effect: { type: "transform", transform }
|
@@ -1415,7 +1822,6 @@ var init_lib = __esm({
|
|
1415
1822
|
default(def) {
|
1416
1823
|
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
1417
1824
|
return new ZodDefault({
|
1418
|
-
...processCreateParams(this._def),
|
1419
1825
|
innerType: this,
|
1420
1826
|
defaultValue: defaultValueFunc,
|
1421
1827
|
typeName: ZodFirstPartyTypeKind.ZodDefault
|
@@ -1425,15 +1831,14 @@ var init_lib = __esm({
|
|
1425
1831
|
return new ZodBranded({
|
1426
1832
|
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
1427
1833
|
type: this,
|
1428
|
-
...processCreateParams(
|
1834
|
+
...processCreateParams(void 0)
|
1429
1835
|
});
|
1430
1836
|
}
|
1431
1837
|
catch(def) {
|
1432
|
-
const
|
1838
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
1433
1839
|
return new ZodCatch({
|
1434
|
-
...processCreateParams(this._def),
|
1435
1840
|
innerType: this,
|
1436
|
-
|
1841
|
+
defaultValue: defaultValueFunc,
|
1437
1842
|
typeName: ZodFirstPartyTypeKind.ZodCatch
|
1438
1843
|
});
|
1439
1844
|
}
|
@@ -1447,9 +1852,6 @@ var init_lib = __esm({
|
|
1447
1852
|
pipe(target) {
|
1448
1853
|
return ZodPipeline.create(this, target);
|
1449
1854
|
}
|
1450
|
-
readonly() {
|
1451
|
-
return ZodReadonly.create(this);
|
1452
|
-
}
|
1453
1855
|
isOptional() {
|
1454
1856
|
return this.safeParse(void 0).success;
|
1455
1857
|
}
|
@@ -1458,19 +1860,43 @@ var init_lib = __esm({
|
|
1458
1860
|
}
|
1459
1861
|
};
|
1460
1862
|
cuidRegex = /^c[^\s-]{8,}$/i;
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1863
|
+
uuidRegex = /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
1864
|
+
emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i;
|
1865
|
+
datetimeRegex = (args) => {
|
1866
|
+
if (args.precision) {
|
1867
|
+
if (args.offset) {
|
1868
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}:\\d{2})|Z)$`);
|
1869
|
+
} else {
|
1870
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`);
|
1871
|
+
}
|
1872
|
+
} else if (args.precision === 0) {
|
1873
|
+
if (args.offset) {
|
1874
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}:\\d{2})|Z)$`);
|
1875
|
+
} else {
|
1876
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`);
|
1877
|
+
}
|
1878
|
+
} else {
|
1879
|
+
if (args.offset) {
|
1880
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}:\\d{2})|Z)$`);
|
1881
|
+
} else {
|
1882
|
+
return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`);
|
1883
|
+
}
|
1884
|
+
}
|
1885
|
+
};
|
1473
1886
|
ZodString = class _ZodString extends ZodType {
|
1887
|
+
constructor() {
|
1888
|
+
super(...arguments);
|
1889
|
+
this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
|
1890
|
+
validation,
|
1891
|
+
code: ZodIssueCode.invalid_string,
|
1892
|
+
...errorUtil.errToObj(message)
|
1893
|
+
});
|
1894
|
+
this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
|
1895
|
+
this.trim = () => new _ZodString({
|
1896
|
+
...this._def,
|
1897
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
1898
|
+
});
|
1899
|
+
}
|
1474
1900
|
_parse(input) {
|
1475
1901
|
if (this._def.coerce) {
|
1476
1902
|
input.data = String(input.data);
|
@@ -1478,11 +1904,15 @@ var init_lib = __esm({
|
|
1478
1904
|
const parsedType = this._getType(input);
|
1479
1905
|
if (parsedType !== ZodParsedType.string) {
|
1480
1906
|
const ctx2 = this._getOrReturnCtx(input);
|
1481
|
-
addIssueToContext(
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1907
|
+
addIssueToContext(
|
1908
|
+
ctx2,
|
1909
|
+
{
|
1910
|
+
code: ZodIssueCode.invalid_type,
|
1911
|
+
expected: ZodParsedType.string,
|
1912
|
+
received: ctx2.parsedType
|
1913
|
+
}
|
1914
|
+
//
|
1915
|
+
);
|
1486
1916
|
return INVALID;
|
1487
1917
|
}
|
1488
1918
|
const status = new ParseStatus();
|
@@ -1550,19 +1980,6 @@ var init_lib = __esm({
|
|
1550
1980
|
});
|
1551
1981
|
status.dirty();
|
1552
1982
|
}
|
1553
|
-
} else if (check.kind === "emoji") {
|
1554
|
-
if (!emojiRegex) {
|
1555
|
-
emojiRegex = new RegExp(_emojiRegex, "u");
|
1556
|
-
}
|
1557
|
-
if (!emojiRegex.test(input.data)) {
|
1558
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1559
|
-
addIssueToContext(ctx, {
|
1560
|
-
validation: "emoji",
|
1561
|
-
code: ZodIssueCode.invalid_string,
|
1562
|
-
message: check.message
|
1563
|
-
});
|
1564
|
-
status.dirty();
|
1565
|
-
}
|
1566
1983
|
} else if (check.kind === "uuid") {
|
1567
1984
|
if (!uuidRegex.test(input.data)) {
|
1568
1985
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1573,16 +1990,6 @@ var init_lib = __esm({
|
|
1573
1990
|
});
|
1574
1991
|
status.dirty();
|
1575
1992
|
}
|
1576
|
-
} else if (check.kind === "nanoid") {
|
1577
|
-
if (!nanoidRegex.test(input.data)) {
|
1578
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1579
|
-
addIssueToContext(ctx, {
|
1580
|
-
validation: "nanoid",
|
1581
|
-
code: ZodIssueCode.invalid_string,
|
1582
|
-
message: check.message
|
1583
|
-
});
|
1584
|
-
status.dirty();
|
1585
|
-
}
|
1586
1993
|
} else if (check.kind === "cuid") {
|
1587
1994
|
if (!cuidRegex.test(input.data)) {
|
1588
1995
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1593,26 +2000,6 @@ var init_lib = __esm({
|
|
1593
2000
|
});
|
1594
2001
|
status.dirty();
|
1595
2002
|
}
|
1596
|
-
} else if (check.kind === "cuid2") {
|
1597
|
-
if (!cuid2Regex.test(input.data)) {
|
1598
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1599
|
-
addIssueToContext(ctx, {
|
1600
|
-
validation: "cuid2",
|
1601
|
-
code: ZodIssueCode.invalid_string,
|
1602
|
-
message: check.message
|
1603
|
-
});
|
1604
|
-
status.dirty();
|
1605
|
-
}
|
1606
|
-
} else if (check.kind === "ulid") {
|
1607
|
-
if (!ulidRegex.test(input.data)) {
|
1608
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1609
|
-
addIssueToContext(ctx, {
|
1610
|
-
validation: "ulid",
|
1611
|
-
code: ZodIssueCode.invalid_string,
|
1612
|
-
message: check.message
|
1613
|
-
});
|
1614
|
-
status.dirty();
|
1615
|
-
}
|
1616
2003
|
} else if (check.kind === "url") {
|
1617
2004
|
try {
|
1618
2005
|
new URL(input.data);
|
@@ -1639,20 +2026,6 @@ var init_lib = __esm({
|
|
1639
2026
|
}
|
1640
2027
|
} else if (check.kind === "trim") {
|
1641
2028
|
input.data = input.data.trim();
|
1642
|
-
} else if (check.kind === "includes") {
|
1643
|
-
if (!input.data.includes(check.value, check.position)) {
|
1644
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1645
|
-
addIssueToContext(ctx, {
|
1646
|
-
code: ZodIssueCode.invalid_string,
|
1647
|
-
validation: { includes: check.value, position: check.position },
|
1648
|
-
message: check.message
|
1649
|
-
});
|
1650
|
-
status.dirty();
|
1651
|
-
}
|
1652
|
-
} else if (check.kind === "toLowerCase") {
|
1653
|
-
input.data = input.data.toLowerCase();
|
1654
|
-
} else if (check.kind === "toUpperCase") {
|
1655
|
-
input.data = input.data.toUpperCase();
|
1656
2029
|
} else if (check.kind === "startsWith") {
|
1657
2030
|
if (!input.data.startsWith(check.value)) {
|
1658
2031
|
ctx = this._getOrReturnCtx(input, ctx);
|
@@ -1684,71 +2057,12 @@ var init_lib = __esm({
|
|
1684
2057
|
});
|
1685
2058
|
status.dirty();
|
1686
2059
|
}
|
1687
|
-
} else if (check.kind === "date") {
|
1688
|
-
const regex = dateRegex;
|
1689
|
-
if (!regex.test(input.data)) {
|
1690
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1691
|
-
addIssueToContext(ctx, {
|
1692
|
-
code: ZodIssueCode.invalid_string,
|
1693
|
-
validation: "date",
|
1694
|
-
message: check.message
|
1695
|
-
});
|
1696
|
-
status.dirty();
|
1697
|
-
}
|
1698
|
-
} else if (check.kind === "time") {
|
1699
|
-
const regex = timeRegex(check);
|
1700
|
-
if (!regex.test(input.data)) {
|
1701
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1702
|
-
addIssueToContext(ctx, {
|
1703
|
-
code: ZodIssueCode.invalid_string,
|
1704
|
-
validation: "time",
|
1705
|
-
message: check.message
|
1706
|
-
});
|
1707
|
-
status.dirty();
|
1708
|
-
}
|
1709
|
-
} else if (check.kind === "duration") {
|
1710
|
-
if (!durationRegex.test(input.data)) {
|
1711
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1712
|
-
addIssueToContext(ctx, {
|
1713
|
-
validation: "duration",
|
1714
|
-
code: ZodIssueCode.invalid_string,
|
1715
|
-
message: check.message
|
1716
|
-
});
|
1717
|
-
status.dirty();
|
1718
|
-
}
|
1719
|
-
} else if (check.kind === "ip") {
|
1720
|
-
if (!isValidIP(input.data, check.version)) {
|
1721
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1722
|
-
addIssueToContext(ctx, {
|
1723
|
-
validation: "ip",
|
1724
|
-
code: ZodIssueCode.invalid_string,
|
1725
|
-
message: check.message
|
1726
|
-
});
|
1727
|
-
status.dirty();
|
1728
|
-
}
|
1729
|
-
} else if (check.kind === "base64") {
|
1730
|
-
if (!base64Regex.test(input.data)) {
|
1731
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
1732
|
-
addIssueToContext(ctx, {
|
1733
|
-
validation: "base64",
|
1734
|
-
code: ZodIssueCode.invalid_string,
|
1735
|
-
message: check.message
|
1736
|
-
});
|
1737
|
-
status.dirty();
|
1738
|
-
}
|
1739
2060
|
} else {
|
1740
2061
|
util.assertNever(check);
|
1741
2062
|
}
|
1742
2063
|
}
|
1743
2064
|
return { status: status.value, value: input.data };
|
1744
2065
|
}
|
1745
|
-
_regex(regex, validation, message) {
|
1746
|
-
return this.refinement((data) => regex.test(data), {
|
1747
|
-
validation,
|
1748
|
-
code: ZodIssueCode.invalid_string,
|
1749
|
-
...errorUtil.errToObj(message)
|
1750
|
-
});
|
1751
|
-
}
|
1752
2066
|
_addCheck(check) {
|
1753
2067
|
return new _ZodString({
|
1754
2068
|
...this._def,
|
@@ -1761,38 +2075,19 @@ var init_lib = __esm({
|
|
1761
2075
|
url(message) {
|
1762
2076
|
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
|
1763
2077
|
}
|
1764
|
-
emoji(message) {
|
1765
|
-
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
|
1766
|
-
}
|
1767
2078
|
uuid(message) {
|
1768
2079
|
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
1769
2080
|
}
|
1770
|
-
nanoid(message) {
|
1771
|
-
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
1772
|
-
}
|
1773
2081
|
cuid(message) {
|
1774
2082
|
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
1775
2083
|
}
|
1776
|
-
cuid2(message) {
|
1777
|
-
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
1778
|
-
}
|
1779
|
-
ulid(message) {
|
1780
|
-
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
1781
|
-
}
|
1782
|
-
base64(message) {
|
1783
|
-
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
1784
|
-
}
|
1785
|
-
ip(options) {
|
1786
|
-
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
1787
|
-
}
|
1788
2084
|
datetime(options) {
|
1789
|
-
var _a
|
2085
|
+
var _a;
|
1790
2086
|
if (typeof options === "string") {
|
1791
2087
|
return this._addCheck({
|
1792
2088
|
kind: "datetime",
|
1793
2089
|
precision: null,
|
1794
2090
|
offset: false,
|
1795
|
-
local: false,
|
1796
2091
|
message: options
|
1797
2092
|
});
|
1798
2093
|
}
|
@@ -1800,30 +2095,9 @@ var init_lib = __esm({
|
|
1800
2095
|
kind: "datetime",
|
1801
2096
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
1802
2097
|
offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,
|
1803
|
-
local: (_b = options === null || options === void 0 ? void 0 : options.local) !== null && _b !== void 0 ? _b : false,
|
1804
|
-
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1805
|
-
});
|
1806
|
-
}
|
1807
|
-
date(message) {
|
1808
|
-
return this._addCheck({ kind: "date", message });
|
1809
|
-
}
|
1810
|
-
time(options) {
|
1811
|
-
if (typeof options === "string") {
|
1812
|
-
return this._addCheck({
|
1813
|
-
kind: "time",
|
1814
|
-
precision: null,
|
1815
|
-
message: options
|
1816
|
-
});
|
1817
|
-
}
|
1818
|
-
return this._addCheck({
|
1819
|
-
kind: "time",
|
1820
|
-
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
1821
2098
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1822
2099
|
});
|
1823
2100
|
}
|
1824
|
-
duration(message) {
|
1825
|
-
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
1826
|
-
}
|
1827
2101
|
regex(regex, message) {
|
1828
2102
|
return this._addCheck({
|
1829
2103
|
kind: "regex",
|
@@ -1831,14 +2105,6 @@ var init_lib = __esm({
|
|
1831
2105
|
...errorUtil.errToObj(message)
|
1832
2106
|
});
|
1833
2107
|
}
|
1834
|
-
includes(value, options) {
|
1835
|
-
return this._addCheck({
|
1836
|
-
kind: "includes",
|
1837
|
-
value,
|
1838
|
-
position: options === null || options === void 0 ? void 0 : options.position,
|
1839
|
-
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
1840
|
-
});
|
1841
|
-
}
|
1842
2108
|
startsWith(value, message) {
|
1843
2109
|
return this._addCheck({
|
1844
2110
|
kind: "startsWith",
|
@@ -1874,288 +2140,22 @@ var init_lib = __esm({
|
|
1874
2140
|
...errorUtil.errToObj(message)
|
1875
2141
|
});
|
1876
2142
|
}
|
1877
|
-
/**
|
1878
|
-
* @deprecated Use z.string().min(1) instead.
|
1879
|
-
* @see {@link ZodString.min}
|
1880
|
-
*/
|
1881
|
-
nonempty(message) {
|
1882
|
-
return this.min(1, errorUtil.errToObj(message));
|
1883
|
-
}
|
1884
|
-
trim() {
|
1885
|
-
return new _ZodString({
|
1886
|
-
...this._def,
|
1887
|
-
checks: [...this._def.checks, { kind: "trim" }]
|
1888
|
-
});
|
1889
|
-
}
|
1890
|
-
toLowerCase() {
|
1891
|
-
return new _ZodString({
|
1892
|
-
...this._def,
|
1893
|
-
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
1894
|
-
});
|
1895
|
-
}
|
1896
|
-
toUpperCase() {
|
1897
|
-
return new _ZodString({
|
1898
|
-
...this._def,
|
1899
|
-
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
1900
|
-
});
|
1901
|
-
}
|
1902
2143
|
get isDatetime() {
|
1903
2144
|
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
1904
2145
|
}
|
1905
|
-
get isDate() {
|
1906
|
-
return !!this._def.checks.find((ch) => ch.kind === "date");
|
1907
|
-
}
|
1908
|
-
get isTime() {
|
1909
|
-
return !!this._def.checks.find((ch) => ch.kind === "time");
|
1910
|
-
}
|
1911
|
-
get isDuration() {
|
1912
|
-
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
1913
|
-
}
|
1914
2146
|
get isEmail() {
|
1915
2147
|
return !!this._def.checks.find((ch) => ch.kind === "email");
|
1916
2148
|
}
|
1917
2149
|
get isURL() {
|
1918
2150
|
return !!this._def.checks.find((ch) => ch.kind === "url");
|
1919
2151
|
}
|
1920
|
-
get isEmoji() {
|
1921
|
-
return !!this._def.checks.find((ch) => ch.kind === "emoji");
|
1922
|
-
}
|
1923
2152
|
get isUUID() {
|
1924
|
-
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
1925
|
-
}
|
1926
|
-
get isNANOID() {
|
1927
|
-
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
1928
|
-
}
|
1929
|
-
get isCUID() {
|
1930
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
1931
|
-
}
|
1932
|
-
get isCUID2() {
|
1933
|
-
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
1934
|
-
}
|
1935
|
-
get isULID() {
|
1936
|
-
return !!this._def.checks.find((ch) => ch.kind === "ulid");
|
1937
|
-
}
|
1938
|
-
get isIP() {
|
1939
|
-
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
1940
|
-
}
|
1941
|
-
get isBase64() {
|
1942
|
-
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
1943
|
-
}
|
1944
|
-
get minLength() {
|
1945
|
-
let min = null;
|
1946
|
-
for (const ch of this._def.checks) {
|
1947
|
-
if (ch.kind === "min") {
|
1948
|
-
if (min === null || ch.value > min)
|
1949
|
-
min = ch.value;
|
1950
|
-
}
|
1951
|
-
}
|
1952
|
-
return min;
|
1953
|
-
}
|
1954
|
-
get maxLength() {
|
1955
|
-
let max = null;
|
1956
|
-
for (const ch of this._def.checks) {
|
1957
|
-
if (ch.kind === "max") {
|
1958
|
-
if (max === null || ch.value < max)
|
1959
|
-
max = ch.value;
|
1960
|
-
}
|
1961
|
-
}
|
1962
|
-
return max;
|
1963
|
-
}
|
1964
|
-
};
|
1965
|
-
ZodString.create = (params) => {
|
1966
|
-
var _a;
|
1967
|
-
return new ZodString({
|
1968
|
-
checks: [],
|
1969
|
-
typeName: ZodFirstPartyTypeKind.ZodString,
|
1970
|
-
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
1971
|
-
...processCreateParams(params)
|
1972
|
-
});
|
1973
|
-
};
|
1974
|
-
ZodNumber = class _ZodNumber extends ZodType {
|
1975
|
-
constructor() {
|
1976
|
-
super(...arguments);
|
1977
|
-
this.min = this.gte;
|
1978
|
-
this.max = this.lte;
|
1979
|
-
this.step = this.multipleOf;
|
1980
|
-
}
|
1981
|
-
_parse(input) {
|
1982
|
-
if (this._def.coerce) {
|
1983
|
-
input.data = Number(input.data);
|
1984
|
-
}
|
1985
|
-
const parsedType = this._getType(input);
|
1986
|
-
if (parsedType !== ZodParsedType.number) {
|
1987
|
-
const ctx2 = this._getOrReturnCtx(input);
|
1988
|
-
addIssueToContext(ctx2, {
|
1989
|
-
code: ZodIssueCode.invalid_type,
|
1990
|
-
expected: ZodParsedType.number,
|
1991
|
-
received: ctx2.parsedType
|
1992
|
-
});
|
1993
|
-
return INVALID;
|
1994
|
-
}
|
1995
|
-
let ctx = void 0;
|
1996
|
-
const status = new ParseStatus();
|
1997
|
-
for (const check of this._def.checks) {
|
1998
|
-
if (check.kind === "int") {
|
1999
|
-
if (!util.isInteger(input.data)) {
|
2000
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2001
|
-
addIssueToContext(ctx, {
|
2002
|
-
code: ZodIssueCode.invalid_type,
|
2003
|
-
expected: "integer",
|
2004
|
-
received: "float",
|
2005
|
-
message: check.message
|
2006
|
-
});
|
2007
|
-
status.dirty();
|
2008
|
-
}
|
2009
|
-
} else if (check.kind === "min") {
|
2010
|
-
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
2011
|
-
if (tooSmall) {
|
2012
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2013
|
-
addIssueToContext(ctx, {
|
2014
|
-
code: ZodIssueCode.too_small,
|
2015
|
-
minimum: check.value,
|
2016
|
-
type: "number",
|
2017
|
-
inclusive: check.inclusive,
|
2018
|
-
exact: false,
|
2019
|
-
message: check.message
|
2020
|
-
});
|
2021
|
-
status.dirty();
|
2022
|
-
}
|
2023
|
-
} else if (check.kind === "max") {
|
2024
|
-
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
2025
|
-
if (tooBig) {
|
2026
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2027
|
-
addIssueToContext(ctx, {
|
2028
|
-
code: ZodIssueCode.too_big,
|
2029
|
-
maximum: check.value,
|
2030
|
-
type: "number",
|
2031
|
-
inclusive: check.inclusive,
|
2032
|
-
exact: false,
|
2033
|
-
message: check.message
|
2034
|
-
});
|
2035
|
-
status.dirty();
|
2036
|
-
}
|
2037
|
-
} else if (check.kind === "multipleOf") {
|
2038
|
-
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
2039
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2040
|
-
addIssueToContext(ctx, {
|
2041
|
-
code: ZodIssueCode.not_multiple_of,
|
2042
|
-
multipleOf: check.value,
|
2043
|
-
message: check.message
|
2044
|
-
});
|
2045
|
-
status.dirty();
|
2046
|
-
}
|
2047
|
-
} else if (check.kind === "finite") {
|
2048
|
-
if (!Number.isFinite(input.data)) {
|
2049
|
-
ctx = this._getOrReturnCtx(input, ctx);
|
2050
|
-
addIssueToContext(ctx, {
|
2051
|
-
code: ZodIssueCode.not_finite,
|
2052
|
-
message: check.message
|
2053
|
-
});
|
2054
|
-
status.dirty();
|
2055
|
-
}
|
2056
|
-
} else {
|
2057
|
-
util.assertNever(check);
|
2058
|
-
}
|
2059
|
-
}
|
2060
|
-
return { status: status.value, value: input.data };
|
2061
|
-
}
|
2062
|
-
gte(value, message) {
|
2063
|
-
return this.setLimit("min", value, true, errorUtil.toString(message));
|
2064
|
-
}
|
2065
|
-
gt(value, message) {
|
2066
|
-
return this.setLimit("min", value, false, errorUtil.toString(message));
|
2067
|
-
}
|
2068
|
-
lte(value, message) {
|
2069
|
-
return this.setLimit("max", value, true, errorUtil.toString(message));
|
2070
|
-
}
|
2071
|
-
lt(value, message) {
|
2072
|
-
return this.setLimit("max", value, false, errorUtil.toString(message));
|
2073
|
-
}
|
2074
|
-
setLimit(kind, value, inclusive, message) {
|
2075
|
-
return new _ZodNumber({
|
2076
|
-
...this._def,
|
2077
|
-
checks: [
|
2078
|
-
...this._def.checks,
|
2079
|
-
{
|
2080
|
-
kind,
|
2081
|
-
value,
|
2082
|
-
inclusive,
|
2083
|
-
message: errorUtil.toString(message)
|
2084
|
-
}
|
2085
|
-
]
|
2086
|
-
});
|
2087
|
-
}
|
2088
|
-
_addCheck(check) {
|
2089
|
-
return new _ZodNumber({
|
2090
|
-
...this._def,
|
2091
|
-
checks: [...this._def.checks, check]
|
2092
|
-
});
|
2093
|
-
}
|
2094
|
-
int(message) {
|
2095
|
-
return this._addCheck({
|
2096
|
-
kind: "int",
|
2097
|
-
message: errorUtil.toString(message)
|
2098
|
-
});
|
2099
|
-
}
|
2100
|
-
positive(message) {
|
2101
|
-
return this._addCheck({
|
2102
|
-
kind: "min",
|
2103
|
-
value: 0,
|
2104
|
-
inclusive: false,
|
2105
|
-
message: errorUtil.toString(message)
|
2106
|
-
});
|
2107
|
-
}
|
2108
|
-
negative(message) {
|
2109
|
-
return this._addCheck({
|
2110
|
-
kind: "max",
|
2111
|
-
value: 0,
|
2112
|
-
inclusive: false,
|
2113
|
-
message: errorUtil.toString(message)
|
2114
|
-
});
|
2115
|
-
}
|
2116
|
-
nonpositive(message) {
|
2117
|
-
return this._addCheck({
|
2118
|
-
kind: "max",
|
2119
|
-
value: 0,
|
2120
|
-
inclusive: true,
|
2121
|
-
message: errorUtil.toString(message)
|
2122
|
-
});
|
2123
|
-
}
|
2124
|
-
nonnegative(message) {
|
2125
|
-
return this._addCheck({
|
2126
|
-
kind: "min",
|
2127
|
-
value: 0,
|
2128
|
-
inclusive: true,
|
2129
|
-
message: errorUtil.toString(message)
|
2130
|
-
});
|
2131
|
-
}
|
2132
|
-
multipleOf(value, message) {
|
2133
|
-
return this._addCheck({
|
2134
|
-
kind: "multipleOf",
|
2135
|
-
value,
|
2136
|
-
message: errorUtil.toString(message)
|
2137
|
-
});
|
2138
|
-
}
|
2139
|
-
finite(message) {
|
2140
|
-
return this._addCheck({
|
2141
|
-
kind: "finite",
|
2142
|
-
message: errorUtil.toString(message)
|
2143
|
-
});
|
2153
|
+
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
2144
2154
|
}
|
2145
|
-
|
2146
|
-
return this.
|
2147
|
-
kind: "min",
|
2148
|
-
inclusive: true,
|
2149
|
-
value: Number.MIN_SAFE_INTEGER,
|
2150
|
-
message: errorUtil.toString(message)
|
2151
|
-
})._addCheck({
|
2152
|
-
kind: "max",
|
2153
|
-
inclusive: true,
|
2154
|
-
value: Number.MAX_SAFE_INTEGER,
|
2155
|
-
message: errorUtil.toString(message)
|
2156
|
-
});
|
2155
|
+
get isCUID() {
|
2156
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
2157
2157
|
}
|
2158
|
-
get
|
2158
|
+
get minLength() {
|
2159
2159
|
let min = null;
|
2160
2160
|
for (const ch of this._def.checks) {
|
2161
2161
|
if (ch.kind === "min") {
|
@@ -2165,7 +2165,7 @@ var init_lib = __esm({
|
|
2165
2165
|
}
|
2166
2166
|
return min;
|
2167
2167
|
}
|
2168
|
-
get
|
2168
|
+
get maxLength() {
|
2169
2169
|
let max = null;
|
2170
2170
|
for (const ch of this._def.checks) {
|
2171
2171
|
if (ch.kind === "max") {
|
@@ -2175,49 +2175,33 @@ var init_lib = __esm({
|
|
2175
2175
|
}
|
2176
2176
|
return max;
|
2177
2177
|
}
|
2178
|
-
get isInt() {
|
2179
|
-
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
2180
|
-
}
|
2181
|
-
get isFinite() {
|
2182
|
-
let max = null, min = null;
|
2183
|
-
for (const ch of this._def.checks) {
|
2184
|
-
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
2185
|
-
return true;
|
2186
|
-
} else if (ch.kind === "min") {
|
2187
|
-
if (min === null || ch.value > min)
|
2188
|
-
min = ch.value;
|
2189
|
-
} else if (ch.kind === "max") {
|
2190
|
-
if (max === null || ch.value < max)
|
2191
|
-
max = ch.value;
|
2192
|
-
}
|
2193
|
-
}
|
2194
|
-
return Number.isFinite(min) && Number.isFinite(max);
|
2195
|
-
}
|
2196
2178
|
};
|
2197
|
-
|
2198
|
-
|
2179
|
+
ZodString.create = (params) => {
|
2180
|
+
var _a;
|
2181
|
+
return new ZodString({
|
2199
2182
|
checks: [],
|
2200
|
-
typeName: ZodFirstPartyTypeKind.
|
2201
|
-
coerce: (params === null || params === void 0 ? void 0 : params.coerce)
|
2183
|
+
typeName: ZodFirstPartyTypeKind.ZodString,
|
2184
|
+
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
2202
2185
|
...processCreateParams(params)
|
2203
2186
|
});
|
2204
2187
|
};
|
2205
|
-
|
2188
|
+
ZodNumber = class _ZodNumber extends ZodType {
|
2206
2189
|
constructor() {
|
2207
2190
|
super(...arguments);
|
2208
2191
|
this.min = this.gte;
|
2209
2192
|
this.max = this.lte;
|
2193
|
+
this.step = this.multipleOf;
|
2210
2194
|
}
|
2211
2195
|
_parse(input) {
|
2212
2196
|
if (this._def.coerce) {
|
2213
|
-
input.data =
|
2197
|
+
input.data = Number(input.data);
|
2214
2198
|
}
|
2215
2199
|
const parsedType = this._getType(input);
|
2216
|
-
if (parsedType !== ZodParsedType.
|
2200
|
+
if (parsedType !== ZodParsedType.number) {
|
2217
2201
|
const ctx2 = this._getOrReturnCtx(input);
|
2218
2202
|
addIssueToContext(ctx2, {
|
2219
2203
|
code: ZodIssueCode.invalid_type,
|
2220
|
-
expected: ZodParsedType.
|
2204
|
+
expected: ZodParsedType.number,
|
2221
2205
|
received: ctx2.parsedType
|
2222
2206
|
});
|
2223
2207
|
return INVALID;
|
@@ -2225,15 +2209,27 @@ var init_lib = __esm({
|
|
2225
2209
|
let ctx = void 0;
|
2226
2210
|
const status = new ParseStatus();
|
2227
2211
|
for (const check of this._def.checks) {
|
2228
|
-
if (check.kind === "
|
2212
|
+
if (check.kind === "int") {
|
2213
|
+
if (!util.isInteger(input.data)) {
|
2214
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2215
|
+
addIssueToContext(ctx, {
|
2216
|
+
code: ZodIssueCode.invalid_type,
|
2217
|
+
expected: "integer",
|
2218
|
+
received: "float",
|
2219
|
+
message: check.message
|
2220
|
+
});
|
2221
|
+
status.dirty();
|
2222
|
+
}
|
2223
|
+
} else if (check.kind === "min") {
|
2229
2224
|
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
2230
2225
|
if (tooSmall) {
|
2231
2226
|
ctx = this._getOrReturnCtx(input, ctx);
|
2232
2227
|
addIssueToContext(ctx, {
|
2233
2228
|
code: ZodIssueCode.too_small,
|
2234
|
-
type: "bigint",
|
2235
2229
|
minimum: check.value,
|
2230
|
+
type: "number",
|
2236
2231
|
inclusive: check.inclusive,
|
2232
|
+
exact: false,
|
2237
2233
|
message: check.message
|
2238
2234
|
});
|
2239
2235
|
status.dirty();
|
@@ -2244,15 +2240,16 @@ var init_lib = __esm({
|
|
2244
2240
|
ctx = this._getOrReturnCtx(input, ctx);
|
2245
2241
|
addIssueToContext(ctx, {
|
2246
2242
|
code: ZodIssueCode.too_big,
|
2247
|
-
type: "bigint",
|
2248
2243
|
maximum: check.value,
|
2244
|
+
type: "number",
|
2249
2245
|
inclusive: check.inclusive,
|
2246
|
+
exact: false,
|
2250
2247
|
message: check.message
|
2251
2248
|
});
|
2252
2249
|
status.dirty();
|
2253
2250
|
}
|
2254
2251
|
} else if (check.kind === "multipleOf") {
|
2255
|
-
if (input.data
|
2252
|
+
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
2256
2253
|
ctx = this._getOrReturnCtx(input, ctx);
|
2257
2254
|
addIssueToContext(ctx, {
|
2258
2255
|
code: ZodIssueCode.not_multiple_of,
|
@@ -2261,6 +2258,15 @@ var init_lib = __esm({
|
|
2261
2258
|
});
|
2262
2259
|
status.dirty();
|
2263
2260
|
}
|
2261
|
+
} else if (check.kind === "finite") {
|
2262
|
+
if (!Number.isFinite(input.data)) {
|
2263
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
2264
|
+
addIssueToContext(ctx, {
|
2265
|
+
code: ZodIssueCode.not_finite,
|
2266
|
+
message: check.message
|
2267
|
+
});
|
2268
|
+
status.dirty();
|
2269
|
+
}
|
2264
2270
|
} else {
|
2265
2271
|
util.assertNever(check);
|
2266
2272
|
}
|
@@ -2280,7 +2286,7 @@ var init_lib = __esm({
|
|
2280
2286
|
return this.setLimit("max", value, false, errorUtil.toString(message));
|
2281
2287
|
}
|
2282
2288
|
setLimit(kind, value, inclusive, message) {
|
2283
|
-
return new
|
2289
|
+
return new _ZodNumber({
|
2284
2290
|
...this._def,
|
2285
2291
|
checks: [
|
2286
2292
|
...this._def.checks,
|
@@ -2294,15 +2300,21 @@ var init_lib = __esm({
|
|
2294
2300
|
});
|
2295
2301
|
}
|
2296
2302
|
_addCheck(check) {
|
2297
|
-
return new
|
2303
|
+
return new _ZodNumber({
|
2298
2304
|
...this._def,
|
2299
2305
|
checks: [...this._def.checks, check]
|
2300
2306
|
});
|
2301
2307
|
}
|
2308
|
+
int(message) {
|
2309
|
+
return this._addCheck({
|
2310
|
+
kind: "int",
|
2311
|
+
message: errorUtil.toString(message)
|
2312
|
+
});
|
2313
|
+
}
|
2302
2314
|
positive(message) {
|
2303
2315
|
return this._addCheck({
|
2304
2316
|
kind: "min",
|
2305
|
-
value:
|
2317
|
+
value: 0,
|
2306
2318
|
inclusive: false,
|
2307
2319
|
message: errorUtil.toString(message)
|
2308
2320
|
});
|
@@ -2310,7 +2322,7 @@ var init_lib = __esm({
|
|
2310
2322
|
negative(message) {
|
2311
2323
|
return this._addCheck({
|
2312
2324
|
kind: "max",
|
2313
|
-
value:
|
2325
|
+
value: 0,
|
2314
2326
|
inclusive: false,
|
2315
2327
|
message: errorUtil.toString(message)
|
2316
2328
|
});
|
@@ -2318,7 +2330,7 @@ var init_lib = __esm({
|
|
2318
2330
|
nonpositive(message) {
|
2319
2331
|
return this._addCheck({
|
2320
2332
|
kind: "max",
|
2321
|
-
value:
|
2333
|
+
value: 0,
|
2322
2334
|
inclusive: true,
|
2323
2335
|
message: errorUtil.toString(message)
|
2324
2336
|
});
|
@@ -2326,7 +2338,7 @@ var init_lib = __esm({
|
|
2326
2338
|
nonnegative(message) {
|
2327
2339
|
return this._addCheck({
|
2328
2340
|
kind: "min",
|
2329
|
-
value:
|
2341
|
+
value: 0,
|
2330
2342
|
inclusive: true,
|
2331
2343
|
message: errorUtil.toString(message)
|
2332
2344
|
});
|
@@ -2338,6 +2350,12 @@ var init_lib = __esm({
|
|
2338
2350
|
message: errorUtil.toString(message)
|
2339
2351
|
});
|
2340
2352
|
}
|
2353
|
+
finite(message) {
|
2354
|
+
return this._addCheck({
|
2355
|
+
kind: "finite",
|
2356
|
+
message: errorUtil.toString(message)
|
2357
|
+
});
|
2358
|
+
}
|
2341
2359
|
get minValue() {
|
2342
2360
|
let min = null;
|
2343
2361
|
for (const ch of this._def.checks) {
|
@@ -2358,11 +2376,39 @@ var init_lib = __esm({
|
|
2358
2376
|
}
|
2359
2377
|
return max;
|
2360
2378
|
}
|
2379
|
+
get isInt() {
|
2380
|
+
return !!this._def.checks.find((ch) => ch.kind === "int");
|
2381
|
+
}
|
2382
|
+
};
|
2383
|
+
ZodNumber.create = (params) => {
|
2384
|
+
return new ZodNumber({
|
2385
|
+
checks: [],
|
2386
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
2387
|
+
coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,
|
2388
|
+
...processCreateParams(params)
|
2389
|
+
});
|
2390
|
+
};
|
2391
|
+
ZodBigInt = class extends ZodType {
|
2392
|
+
_parse(input) {
|
2393
|
+
if (this._def.coerce) {
|
2394
|
+
input.data = BigInt(input.data);
|
2395
|
+
}
|
2396
|
+
const parsedType = this._getType(input);
|
2397
|
+
if (parsedType !== ZodParsedType.bigint) {
|
2398
|
+
const ctx = this._getOrReturnCtx(input);
|
2399
|
+
addIssueToContext(ctx, {
|
2400
|
+
code: ZodIssueCode.invalid_type,
|
2401
|
+
expected: ZodParsedType.bigint,
|
2402
|
+
received: ctx.parsedType
|
2403
|
+
});
|
2404
|
+
return INVALID;
|
2405
|
+
}
|
2406
|
+
return OK(input.data);
|
2407
|
+
}
|
2361
2408
|
};
|
2362
2409
|
ZodBigInt.create = (params) => {
|
2363
2410
|
var _a;
|
2364
2411
|
return new ZodBigInt({
|
2365
|
-
checks: [],
|
2366
2412
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
2367
2413
|
coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,
|
2368
2414
|
...processCreateParams(params)
|
@@ -2688,13 +2734,13 @@ var init_lib = __esm({
|
|
2688
2734
|
}
|
2689
2735
|
}
|
2690
2736
|
if (ctx.common.async) {
|
2691
|
-
return Promise.all(
|
2737
|
+
return Promise.all(ctx.data.map((item, i) => {
|
2692
2738
|
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
2693
2739
|
})).then((result2) => {
|
2694
2740
|
return ParseStatus.mergeArray(status, result2);
|
2695
2741
|
});
|
2696
2742
|
}
|
2697
|
-
const result =
|
2743
|
+
const result = ctx.data.map((item, i) => {
|
2698
2744
|
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
2699
2745
|
});
|
2700
2746
|
return ParseStatus.mergeArray(status, result);
|
@@ -2734,12 +2780,31 @@ var init_lib = __esm({
|
|
2734
2780
|
...processCreateParams(params)
|
2735
2781
|
});
|
2736
2782
|
};
|
2783
|
+
(function(objectUtil2) {
|
2784
|
+
objectUtil2.mergeShapes = (first, second) => {
|
2785
|
+
return {
|
2786
|
+
...first,
|
2787
|
+
...second
|
2788
|
+
// second overwrites first
|
2789
|
+
};
|
2790
|
+
};
|
2791
|
+
})(objectUtil || (objectUtil = {}));
|
2792
|
+
AugmentFactory = (def) => (augmentation) => {
|
2793
|
+
return new ZodObject({
|
2794
|
+
...def,
|
2795
|
+
shape: () => ({
|
2796
|
+
...def.shape(),
|
2797
|
+
...augmentation
|
2798
|
+
})
|
2799
|
+
});
|
2800
|
+
};
|
2737
2801
|
ZodObject = class _ZodObject extends ZodType {
|
2738
2802
|
constructor() {
|
2739
2803
|
super(...arguments);
|
2740
2804
|
this._cached = null;
|
2741
2805
|
this.nonstrict = this.passthrough;
|
2742
|
-
this.augment = this.
|
2806
|
+
this.augment = AugmentFactory(this._def);
|
2807
|
+
this.extend = AugmentFactory(this._def);
|
2743
2808
|
}
|
2744
2809
|
_getCached() {
|
2745
2810
|
if (this._cached !== null)
|
@@ -2820,10 +2885,9 @@ var init_lib = __esm({
|
|
2820
2885
|
const syncPairs = [];
|
2821
2886
|
for (const pair of pairs) {
|
2822
2887
|
const key = await pair.key;
|
2823
|
-
const value = await pair.value;
|
2824
2888
|
syncPairs.push({
|
2825
2889
|
key,
|
2826
|
-
value,
|
2890
|
+
value: await pair.value,
|
2827
2891
|
alwaysSet: pair.alwaysSet
|
2828
2892
|
});
|
2829
2893
|
}
|
@@ -2870,31 +2934,8 @@ var init_lib = __esm({
|
|
2870
2934
|
unknownKeys: "passthrough"
|
2871
2935
|
});
|
2872
2936
|
}
|
2873
|
-
|
2874
|
-
|
2875
|
-
// <Augmentation extends ZodRawShape>(
|
2876
|
-
// augmentation: Augmentation
|
2877
|
-
// ): ZodObject<
|
2878
|
-
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
2879
|
-
// Def["unknownKeys"],
|
2880
|
-
// Def["catchall"]
|
2881
|
-
// > => {
|
2882
|
-
// return new ZodObject({
|
2883
|
-
// ...def,
|
2884
|
-
// shape: () => ({
|
2885
|
-
// ...def.shape(),
|
2886
|
-
// ...augmentation,
|
2887
|
-
// }),
|
2888
|
-
// }) as any;
|
2889
|
-
// };
|
2890
|
-
extend(augmentation) {
|
2891
|
-
return new _ZodObject({
|
2892
|
-
...this._def,
|
2893
|
-
shape: () => ({
|
2894
|
-
...this._def.shape(),
|
2895
|
-
...augmentation
|
2896
|
-
})
|
2897
|
-
});
|
2937
|
+
setKey(key, schema3) {
|
2938
|
+
return this.augment({ [key]: schema3 });
|
2898
2939
|
}
|
2899
2940
|
/**
|
2900
2941
|
* Prior to zod@1.0.12 there was a bug in the
|
@@ -2905,73 +2946,11 @@ var init_lib = __esm({
|
|
2905
2946
|
const merged = new _ZodObject({
|
2906
2947
|
unknownKeys: merging._def.unknownKeys,
|
2907
2948
|
catchall: merging._def.catchall,
|
2908
|
-
shape: () => (
|
2909
|
-
...this._def.shape(),
|
2910
|
-
...merging._def.shape()
|
2911
|
-
}),
|
2949
|
+
shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2912
2950
|
typeName: ZodFirstPartyTypeKind.ZodObject
|
2913
2951
|
});
|
2914
2952
|
return merged;
|
2915
2953
|
}
|
2916
|
-
// merge<
|
2917
|
-
// Incoming extends AnyZodObject,
|
2918
|
-
// Augmentation extends Incoming["shape"],
|
2919
|
-
// NewOutput extends {
|
2920
|
-
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
2921
|
-
// ? Augmentation[k]["_output"]
|
2922
|
-
// : k extends keyof Output
|
2923
|
-
// ? Output[k]
|
2924
|
-
// : never;
|
2925
|
-
// },
|
2926
|
-
// NewInput extends {
|
2927
|
-
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
2928
|
-
// ? Augmentation[k]["_input"]
|
2929
|
-
// : k extends keyof Input
|
2930
|
-
// ? Input[k]
|
2931
|
-
// : never;
|
2932
|
-
// }
|
2933
|
-
// >(
|
2934
|
-
// merging: Incoming
|
2935
|
-
// ): ZodObject<
|
2936
|
-
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
2937
|
-
// Incoming["_def"]["unknownKeys"],
|
2938
|
-
// Incoming["_def"]["catchall"],
|
2939
|
-
// NewOutput,
|
2940
|
-
// NewInput
|
2941
|
-
// > {
|
2942
|
-
// const merged: any = new ZodObject({
|
2943
|
-
// unknownKeys: merging._def.unknownKeys,
|
2944
|
-
// catchall: merging._def.catchall,
|
2945
|
-
// shape: () =>
|
2946
|
-
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2947
|
-
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
2948
|
-
// }) as any;
|
2949
|
-
// return merged;
|
2950
|
-
// }
|
2951
|
-
setKey(key, schema3) {
|
2952
|
-
return this.augment({ [key]: schema3 });
|
2953
|
-
}
|
2954
|
-
// merge<Incoming extends AnyZodObject>(
|
2955
|
-
// merging: Incoming
|
2956
|
-
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
2957
|
-
// ZodObject<
|
2958
|
-
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
2959
|
-
// Incoming["_def"]["unknownKeys"],
|
2960
|
-
// Incoming["_def"]["catchall"]
|
2961
|
-
// > {
|
2962
|
-
// // const mergedShape = objectUtil.mergeShapes(
|
2963
|
-
// // this._def.shape(),
|
2964
|
-
// // merging._def.shape()
|
2965
|
-
// // );
|
2966
|
-
// const merged: any = new ZodObject({
|
2967
|
-
// unknownKeys: merging._def.unknownKeys,
|
2968
|
-
// catchall: merging._def.catchall,
|
2969
|
-
// shape: () =>
|
2970
|
-
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
2971
|
-
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
2972
|
-
// }) as any;
|
2973
|
-
// return merged;
|
2974
|
-
// }
|
2975
2954
|
catchall(index4) {
|
2976
2955
|
return new _ZodObject({
|
2977
2956
|
...this._def,
|
@@ -2980,10 +2959,9 @@ var init_lib = __esm({
|
|
2980
2959
|
}
|
2981
2960
|
pick(mask) {
|
2982
2961
|
const shape = {};
|
2983
|
-
util.objectKeys(mask).
|
2984
|
-
if (
|
2962
|
+
util.objectKeys(mask).map((key) => {
|
2963
|
+
if (this.shape[key])
|
2985
2964
|
shape[key] = this.shape[key];
|
2986
|
-
}
|
2987
2965
|
});
|
2988
2966
|
return new _ZodObject({
|
2989
2967
|
...this._def,
|
@@ -2992,8 +2970,8 @@ var init_lib = __esm({
|
|
2992
2970
|
}
|
2993
2971
|
omit(mask) {
|
2994
2972
|
const shape = {};
|
2995
|
-
util.objectKeys(this.shape).
|
2996
|
-
if (
|
2973
|
+
util.objectKeys(this.shape).map((key) => {
|
2974
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2997
2975
|
shape[key] = this.shape[key];
|
2998
2976
|
}
|
2999
2977
|
});
|
@@ -3002,22 +2980,29 @@ var init_lib = __esm({
|
|
3002
2980
|
shape: () => shape
|
3003
2981
|
});
|
3004
2982
|
}
|
3005
|
-
/**
|
3006
|
-
* @deprecated
|
3007
|
-
*/
|
3008
2983
|
deepPartial() {
|
3009
2984
|
return deepPartialify(this);
|
3010
2985
|
}
|
3011
2986
|
partial(mask) {
|
3012
2987
|
const newShape = {};
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
2988
|
+
if (mask) {
|
2989
|
+
util.objectKeys(this.shape).map((key) => {
|
2990
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
2991
|
+
newShape[key] = this.shape[key];
|
2992
|
+
} else {
|
2993
|
+
newShape[key] = this.shape[key].optional();
|
2994
|
+
}
|
2995
|
+
});
|
2996
|
+
return new _ZodObject({
|
2997
|
+
...this._def,
|
2998
|
+
shape: () => newShape
|
2999
|
+
});
|
3000
|
+
} else {
|
3001
|
+
for (const key in this.shape) {
|
3002
|
+
const fieldSchema = this.shape[key];
|
3018
3003
|
newShape[key] = fieldSchema.optional();
|
3019
3004
|
}
|
3020
|
-
}
|
3005
|
+
}
|
3021
3006
|
return new _ZodObject({
|
3022
3007
|
...this._def,
|
3023
3008
|
shape: () => newShape
|
@@ -3025,10 +3010,21 @@ var init_lib = __esm({
|
|
3025
3010
|
}
|
3026
3011
|
required(mask) {
|
3027
3012
|
const newShape = {};
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3013
|
+
if (mask) {
|
3014
|
+
util.objectKeys(this.shape).map((key) => {
|
3015
|
+
if (util.objectKeys(mask).indexOf(key) === -1) {
|
3016
|
+
newShape[key] = this.shape[key];
|
3017
|
+
} else {
|
3018
|
+
const fieldSchema = this.shape[key];
|
3019
|
+
let newField = fieldSchema;
|
3020
|
+
while (newField instanceof ZodOptional) {
|
3021
|
+
newField = newField._def.innerType;
|
3022
|
+
}
|
3023
|
+
newShape[key] = newField;
|
3024
|
+
}
|
3025
|
+
});
|
3026
|
+
} else {
|
3027
|
+
for (const key in this.shape) {
|
3032
3028
|
const fieldSchema = this.shape[key];
|
3033
3029
|
let newField = fieldSchema;
|
3034
3030
|
while (newField instanceof ZodOptional) {
|
@@ -3036,7 +3032,7 @@ var init_lib = __esm({
|
|
3036
3032
|
}
|
3037
3033
|
newShape[key] = newField;
|
3038
3034
|
}
|
3039
|
-
}
|
3035
|
+
}
|
3040
3036
|
return new _ZodObject({
|
3041
3037
|
...this._def,
|
3042
3038
|
shape: () => newShape
|
@@ -3174,25 +3170,15 @@ var init_lib = __esm({
|
|
3174
3170
|
} else if (type instanceof ZodEnum) {
|
3175
3171
|
return type.options;
|
3176
3172
|
} else if (type instanceof ZodNativeEnum) {
|
3177
|
-
return
|
3173
|
+
return Object.keys(type.enum);
|
3178
3174
|
} else if (type instanceof ZodDefault) {
|
3179
3175
|
return getDiscriminator(type._def.innerType);
|
3180
3176
|
} else if (type instanceof ZodUndefined) {
|
3181
3177
|
return [void 0];
|
3182
3178
|
} else if (type instanceof ZodNull) {
|
3183
3179
|
return [null];
|
3184
|
-
} else if (type instanceof ZodOptional) {
|
3185
|
-
return [void 0, ...getDiscriminator(type.unwrap())];
|
3186
|
-
} else if (type instanceof ZodNullable) {
|
3187
|
-
return [null, ...getDiscriminator(type.unwrap())];
|
3188
|
-
} else if (type instanceof ZodBranded) {
|
3189
|
-
return getDiscriminator(type.unwrap());
|
3190
|
-
} else if (type instanceof ZodReadonly) {
|
3191
|
-
return getDiscriminator(type.unwrap());
|
3192
|
-
} else if (type instanceof ZodCatch) {
|
3193
|
-
return getDiscriminator(type._def.innerType);
|
3194
3180
|
} else {
|
3195
|
-
return
|
3181
|
+
return null;
|
3196
3182
|
}
|
3197
3183
|
};
|
3198
3184
|
ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
@@ -3252,7 +3238,7 @@ var init_lib = __esm({
|
|
3252
3238
|
const optionsMap = /* @__PURE__ */ new Map();
|
3253
3239
|
for (const type of options) {
|
3254
3240
|
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
3255
|
-
if (!discriminatorValues
|
3241
|
+
if (!discriminatorValues) {
|
3256
3242
|
throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
3257
3243
|
}
|
3258
3244
|
for (const value of discriminatorValues) {
|
@@ -3356,7 +3342,7 @@ var init_lib = __esm({
|
|
3356
3342
|
});
|
3357
3343
|
status.dirty();
|
3358
3344
|
}
|
3359
|
-
const items =
|
3345
|
+
const items = ctx.data.map((item, itemIndex) => {
|
3360
3346
|
const schema3 = this._def.items[itemIndex] || this._def.rest;
|
3361
3347
|
if (!schema3)
|
3362
3348
|
return null;
|
@@ -3414,8 +3400,7 @@ var init_lib = __esm({
|
|
3414
3400
|
for (const key in ctx.data) {
|
3415
3401
|
pairs.push({
|
3416
3402
|
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
|
3417
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
3418
|
-
alwaysSet: key in ctx.data
|
3403
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))
|
3419
3404
|
});
|
3420
3405
|
}
|
3421
3406
|
if (ctx.common.async) {
|
@@ -3445,12 +3430,6 @@ var init_lib = __esm({
|
|
3445
3430
|
}
|
3446
3431
|
};
|
3447
3432
|
ZodMap = class extends ZodType {
|
3448
|
-
get keySchema() {
|
3449
|
-
return this._def.keyType;
|
3450
|
-
}
|
3451
|
-
get valueSchema() {
|
3452
|
-
return this._def.valueType;
|
3453
|
-
}
|
3454
3433
|
_parse(input) {
|
3455
3434
|
const { status, ctx } = this._processInputParams(input);
|
3456
3435
|
if (ctx.parsedType !== ZodParsedType.map) {
|
@@ -3645,29 +3624,27 @@ var init_lib = __esm({
|
|
3645
3624
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
3646
3625
|
const fn = ctx.data;
|
3647
3626
|
if (this._def.returns instanceof ZodPromise) {
|
3648
|
-
|
3649
|
-
return OK(async function(...args) {
|
3627
|
+
return OK(async (...args) => {
|
3650
3628
|
const error2 = new ZodError([]);
|
3651
|
-
const parsedArgs = await
|
3629
|
+
const parsedArgs = await this._def.args.parseAsync(args, params).catch((e) => {
|
3652
3630
|
error2.addIssue(makeArgsIssue(args, e));
|
3653
3631
|
throw error2;
|
3654
3632
|
});
|
3655
|
-
const result = await
|
3656
|
-
const parsedReturns = await
|
3633
|
+
const result = await fn(...parsedArgs);
|
3634
|
+
const parsedReturns = await this._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
3657
3635
|
error2.addIssue(makeReturnsIssue(result, e));
|
3658
3636
|
throw error2;
|
3659
3637
|
});
|
3660
3638
|
return parsedReturns;
|
3661
3639
|
});
|
3662
3640
|
} else {
|
3663
|
-
|
3664
|
-
|
3665
|
-
const parsedArgs = me._def.args.safeParse(args, params);
|
3641
|
+
return OK((...args) => {
|
3642
|
+
const parsedArgs = this._def.args.safeParse(args, params);
|
3666
3643
|
if (!parsedArgs.success) {
|
3667
3644
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
3668
3645
|
}
|
3669
|
-
const result =
|
3670
|
-
const parsedReturns =
|
3646
|
+
const result = fn(...parsedArgs.data);
|
3647
|
+
const parsedReturns = this._def.returns.safeParse(result, params);
|
3671
3648
|
if (!parsedReturns.success) {
|
3672
3649
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
3673
3650
|
}
|
@@ -3732,7 +3709,6 @@ var init_lib = __esm({
|
|
3732
3709
|
if (input.data !== this._def.value) {
|
3733
3710
|
const ctx = this._getOrReturnCtx(input);
|
3734
3711
|
addIssueToContext(ctx, {
|
3735
|
-
received: ctx.data,
|
3736
3712
|
code: ZodIssueCode.invalid_literal,
|
3737
3713
|
expected: this._def.value
|
3738
3714
|
});
|
@@ -3751,11 +3727,7 @@ var init_lib = __esm({
|
|
3751
3727
|
...processCreateParams(params)
|
3752
3728
|
});
|
3753
3729
|
};
|
3754
|
-
ZodEnum = class
|
3755
|
-
constructor() {
|
3756
|
-
super(...arguments);
|
3757
|
-
_ZodEnum_cache.set(this, void 0);
|
3758
|
-
}
|
3730
|
+
ZodEnum = class extends ZodType {
|
3759
3731
|
_parse(input) {
|
3760
3732
|
if (typeof input.data !== "string") {
|
3761
3733
|
const ctx = this._getOrReturnCtx(input);
|
@@ -3767,10 +3739,7 @@ var init_lib = __esm({
|
|
3767
3739
|
});
|
3768
3740
|
return INVALID;
|
3769
3741
|
}
|
3770
|
-
if (
|
3771
|
-
__classPrivateFieldSet(this, _ZodEnum_cache, new Set(this._def.values), "f");
|
3772
|
-
}
|
3773
|
-
if (!__classPrivateFieldGet(this, _ZodEnum_cache, "f").has(input.data)) {
|
3742
|
+
if (this._def.values.indexOf(input.data) === -1) {
|
3774
3743
|
const ctx = this._getOrReturnCtx(input);
|
3775
3744
|
const expectedValues = this._def.values;
|
3776
3745
|
addIssueToContext(ctx, {
|
@@ -3806,26 +3775,9 @@ var init_lib = __esm({
|
|
3806
3775
|
}
|
3807
3776
|
return enumValues;
|
3808
3777
|
}
|
3809
|
-
extract(values, newDef = this._def) {
|
3810
|
-
return _ZodEnum.create(values, {
|
3811
|
-
...this._def,
|
3812
|
-
...newDef
|
3813
|
-
});
|
3814
|
-
}
|
3815
|
-
exclude(values, newDef = this._def) {
|
3816
|
-
return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
3817
|
-
...this._def,
|
3818
|
-
...newDef
|
3819
|
-
});
|
3820
|
-
}
|
3821
3778
|
};
|
3822
|
-
_ZodEnum_cache = /* @__PURE__ */ new WeakMap();
|
3823
3779
|
ZodEnum.create = createZodEnum;
|
3824
3780
|
ZodNativeEnum = class extends ZodType {
|
3825
|
-
constructor() {
|
3826
|
-
super(...arguments);
|
3827
|
-
_ZodNativeEnum_cache.set(this, void 0);
|
3828
|
-
}
|
3829
3781
|
_parse(input) {
|
3830
3782
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
3831
3783
|
const ctx = this._getOrReturnCtx(input);
|
@@ -3838,10 +3790,7 @@ var init_lib = __esm({
|
|
3838
3790
|
});
|
3839
3791
|
return INVALID;
|
3840
3792
|
}
|
3841
|
-
if (
|
3842
|
-
__classPrivateFieldSet(this, _ZodNativeEnum_cache, new Set(util.getValidEnumValues(this._def.values)), "f");
|
3843
|
-
}
|
3844
|
-
if (!__classPrivateFieldGet(this, _ZodNativeEnum_cache, "f").has(input.data)) {
|
3793
|
+
if (nativeEnumValues.indexOf(input.data) === -1) {
|
3845
3794
|
const expectedValues = util.objectValues(nativeEnumValues);
|
3846
3795
|
addIssueToContext(ctx, {
|
3847
3796
|
received: ctx.data,
|
@@ -3856,7 +3805,6 @@ var init_lib = __esm({
|
|
3856
3805
|
return this._def.values;
|
3857
3806
|
}
|
3858
3807
|
};
|
3859
|
-
_ZodNativeEnum_cache = /* @__PURE__ */ new WeakMap();
|
3860
3808
|
ZodNativeEnum.create = (values, params) => {
|
3861
3809
|
return new ZodNativeEnum({
|
3862
3810
|
values,
|
@@ -3865,9 +3813,6 @@ var init_lib = __esm({
|
|
3865
3813
|
});
|
3866
3814
|
};
|
3867
3815
|
ZodPromise = class extends ZodType {
|
3868
|
-
unwrap() {
|
3869
|
-
return this._def.type;
|
3870
|
-
}
|
3871
3816
|
_parse(input) {
|
3872
3817
|
const { ctx } = this._processInputParams(input);
|
3873
3818
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
@@ -3904,56 +3849,38 @@ var init_lib = __esm({
|
|
3904
3849
|
_parse(input) {
|
3905
3850
|
const { status, ctx } = this._processInputParams(input);
|
3906
3851
|
const effect = this._def.effect || null;
|
3907
|
-
const checkCtx = {
|
3908
|
-
addIssue: (arg) => {
|
3909
|
-
addIssueToContext(ctx, arg);
|
3910
|
-
if (arg.fatal) {
|
3911
|
-
status.abort();
|
3912
|
-
} else {
|
3913
|
-
status.dirty();
|
3914
|
-
}
|
3915
|
-
},
|
3916
|
-
get path() {
|
3917
|
-
return ctx.path;
|
3918
|
-
}
|
3919
|
-
};
|
3920
|
-
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
3921
3852
|
if (effect.type === "preprocess") {
|
3922
|
-
const processed = effect.transform(ctx.data
|
3853
|
+
const processed = effect.transform(ctx.data);
|
3923
3854
|
if (ctx.common.async) {
|
3924
|
-
return Promise.resolve(processed).then(
|
3925
|
-
|
3926
|
-
return INVALID;
|
3927
|
-
const result = await this._def.schema._parseAsync({
|
3855
|
+
return Promise.resolve(processed).then((processed2) => {
|
3856
|
+
return this._def.schema._parseAsync({
|
3928
3857
|
data: processed2,
|
3929
3858
|
path: ctx.path,
|
3930
3859
|
parent: ctx
|
3931
3860
|
});
|
3932
|
-
if (result.status === "aborted")
|
3933
|
-
return INVALID;
|
3934
|
-
if (result.status === "dirty")
|
3935
|
-
return DIRTY(result.value);
|
3936
|
-
if (status.value === "dirty")
|
3937
|
-
return DIRTY(result.value);
|
3938
|
-
return result;
|
3939
3861
|
});
|
3940
3862
|
} else {
|
3941
|
-
|
3942
|
-
return INVALID;
|
3943
|
-
const result = this._def.schema._parseSync({
|
3863
|
+
return this._def.schema._parseSync({
|
3944
3864
|
data: processed,
|
3945
3865
|
path: ctx.path,
|
3946
3866
|
parent: ctx
|
3947
3867
|
});
|
3948
|
-
if (result.status === "aborted")
|
3949
|
-
return INVALID;
|
3950
|
-
if (result.status === "dirty")
|
3951
|
-
return DIRTY(result.value);
|
3952
|
-
if (status.value === "dirty")
|
3953
|
-
return DIRTY(result.value);
|
3954
|
-
return result;
|
3955
3868
|
}
|
3956
3869
|
}
|
3870
|
+
const checkCtx = {
|
3871
|
+
addIssue: (arg) => {
|
3872
|
+
addIssueToContext(ctx, arg);
|
3873
|
+
if (arg.fatal) {
|
3874
|
+
status.abort();
|
3875
|
+
} else {
|
3876
|
+
status.dirty();
|
3877
|
+
}
|
3878
|
+
},
|
3879
|
+
get path() {
|
3880
|
+
return ctx.path;
|
3881
|
+
}
|
3882
|
+
};
|
3883
|
+
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
3957
3884
|
if (effect.type === "refinement") {
|
3958
3885
|
const executeRefinement = (acc) => {
|
3959
3886
|
const result = effect.refinement(acc, checkCtx);
|
@@ -4096,45 +4023,26 @@ var init_lib = __esm({
|
|
4096
4023
|
ZodCatch = class extends ZodType {
|
4097
4024
|
_parse(input) {
|
4098
4025
|
const { ctx } = this._processInputParams(input);
|
4099
|
-
const newCtx = {
|
4100
|
-
...ctx,
|
4101
|
-
common: {
|
4102
|
-
...ctx.common,
|
4103
|
-
issues: []
|
4104
|
-
}
|
4105
|
-
};
|
4106
4026
|
const result = this._def.innerType._parse({
|
4107
|
-
data:
|
4108
|
-
path:
|
4109
|
-
parent:
|
4110
|
-
...newCtx
|
4111
|
-
}
|
4027
|
+
data: ctx.data,
|
4028
|
+
path: ctx.path,
|
4029
|
+
parent: ctx
|
4112
4030
|
});
|
4113
4031
|
if (isAsync(result)) {
|
4114
4032
|
return result.then((result2) => {
|
4115
4033
|
return {
|
4116
4034
|
status: "valid",
|
4117
|
-
value: result2.status === "valid" ? result2.value : this._def.
|
4118
|
-
get error() {
|
4119
|
-
return new ZodError(newCtx.common.issues);
|
4120
|
-
},
|
4121
|
-
input: newCtx.data
|
4122
|
-
})
|
4035
|
+
value: result2.status === "valid" ? result2.value : this._def.defaultValue()
|
4123
4036
|
};
|
4124
4037
|
});
|
4125
4038
|
} else {
|
4126
4039
|
return {
|
4127
4040
|
status: "valid",
|
4128
|
-
value: result.status === "valid" ? result.value : this._def.
|
4129
|
-
get error() {
|
4130
|
-
return new ZodError(newCtx.common.issues);
|
4131
|
-
},
|
4132
|
-
input: newCtx.data
|
4133
|
-
})
|
4041
|
+
value: result.status === "valid" ? result.value : this._def.defaultValue()
|
4134
4042
|
};
|
4135
4043
|
}
|
4136
4044
|
}
|
4137
|
-
|
4045
|
+
removeDefault() {
|
4138
4046
|
return this._def.innerType;
|
4139
4047
|
}
|
4140
4048
|
};
|
@@ -4142,7 +4050,7 @@ var init_lib = __esm({
|
|
4142
4050
|
return new ZodCatch({
|
4143
4051
|
innerType: type,
|
4144
4052
|
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
4145
|
-
|
4053
|
+
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
4146
4054
|
...processCreateParams(params)
|
4147
4055
|
});
|
4148
4056
|
};
|
@@ -4237,25 +4145,6 @@ var init_lib = __esm({
|
|
4237
4145
|
});
|
4238
4146
|
}
|
4239
4147
|
};
|
4240
|
-
ZodReadonly = class extends ZodType {
|
4241
|
-
_parse(input) {
|
4242
|
-
const result = this._def.innerType._parse(input);
|
4243
|
-
if (isValid(result)) {
|
4244
|
-
result.value = Object.freeze(result.value);
|
4245
|
-
}
|
4246
|
-
return result;
|
4247
|
-
}
|
4248
|
-
unwrap() {
|
4249
|
-
return this._def.innerType;
|
4250
|
-
}
|
4251
|
-
};
|
4252
|
-
ZodReadonly.create = (type, params) => {
|
4253
|
-
return new ZodReadonly({
|
4254
|
-
innerType: type,
|
4255
|
-
typeName: ZodFirstPartyTypeKind.ZodReadonly,
|
4256
|
-
...processCreateParams(params)
|
4257
|
-
});
|
4258
|
-
};
|
4259
4148
|
late = {
|
4260
4149
|
object: ZodObject.lazycreate
|
4261
4150
|
};
|
@@ -4295,7 +4184,6 @@ var init_lib = __esm({
|
|
4295
4184
|
ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
|
4296
4185
|
ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
|
4297
4186
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
4298
|
-
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
4299
4187
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
4300
4188
|
stringType = ZodString.create;
|
4301
4189
|
numberType = ZodNumber.create;
|
@@ -4335,7 +4223,7 @@ var init_lib = __esm({
|
|
4335
4223
|
});
|
4336
4224
|
|
4337
4225
|
// src/serializer/mysqlSchema.ts
|
4338
|
-
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5,
|
4226
|
+
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5, schemaInternal, schemaV3, schemaV4, schemaV5, schema, tableSquashedV4, tableSquashed, schemaSquashed, schemaSquashedV4, mysqlSchema, mysqlSchemaV5, backwardCompatibleMysqlSchema, dryMySql;
|
4339
4227
|
var init_mysqlSchema = __esm({
|
4340
4228
|
"src/serializer/mysqlSchema.ts"() {
|
4341
4229
|
"use strict";
|
@@ -4435,18 +4323,8 @@ var init_mysqlSchema = __esm({
|
|
4435
4323
|
}),
|
4436
4324
|
internal: kitInternals
|
4437
4325
|
}).strict();
|
4438
|
-
schemaInternalV6 = objectType({
|
4439
|
-
version: literalType("6"),
|
4440
|
-
dialect,
|
4441
|
-
tables: recordType(stringType(), table),
|
4442
|
-
_meta: objectType({
|
4443
|
-
tables: recordType(stringType(), stringType()),
|
4444
|
-
columns: recordType(stringType(), stringType())
|
4445
|
-
}),
|
4446
|
-
internal: kitInternals
|
4447
|
-
}).strict();
|
4448
4326
|
schemaInternal = objectType({
|
4449
|
-
version: literalType("
|
4327
|
+
version: literalType("5"),
|
4450
4328
|
dialect,
|
4451
4329
|
tables: recordType(stringType(), table),
|
4452
4330
|
_meta: objectType({
|
@@ -4475,7 +4353,7 @@ var init_mysqlSchema = __esm({
|
|
4475
4353
|
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
4476
4354
|
}).strict();
|
4477
4355
|
schemaSquashed = objectType({
|
4478
|
-
version: literalType("
|
4356
|
+
version: literalType("5"),
|
4479
4357
|
dialect,
|
4480
4358
|
tables: recordType(stringType(), tableSquashed)
|
4481
4359
|
}).strict();
|
@@ -4489,7 +4367,7 @@ var init_mysqlSchema = __esm({
|
|
4489
4367
|
mysqlSchemaV5 = schemaV5;
|
4490
4368
|
backwardCompatibleMysqlSchema = unionType([mysqlSchemaV5, schema]);
|
4491
4369
|
dryMySql = mysqlSchema.parse({
|
4492
|
-
version:
|
4370
|
+
version: "5",
|
4493
4371
|
dialect: "mysql",
|
4494
4372
|
id: originUUID,
|
4495
4373
|
prevId: "",
|
@@ -4872,6 +4750,7 @@ var init_utils = __esm({
|
|
4872
4750
|
init_mysqlSchema();
|
4873
4751
|
init_pgSchema();
|
4874
4752
|
init_sqliteSchema();
|
4753
|
+
init_source();
|
4875
4754
|
init_global();
|
4876
4755
|
}
|
4877
4756
|
});
|
@@ -4881,14 +4760,15 @@ var import_hanji;
|
|
4881
4760
|
var init_views = __esm({
|
4882
4761
|
"src/cli/views.ts"() {
|
4883
4762
|
"use strict";
|
4763
|
+
init_source();
|
4884
4764
|
import_hanji = __toESM(require_hanji());
|
4885
4765
|
init_utils();
|
4886
4766
|
}
|
4887
4767
|
});
|
4888
4768
|
|
4889
|
-
// node_modules/.pnpm/semver@7.
|
4769
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js
|
4890
4770
|
var require_constants = __commonJS({
|
4891
|
-
"node_modules/.pnpm/semver@7.
|
4771
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/constants.js"(exports, module2) {
|
4892
4772
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
4893
4773
|
var MAX_LENGTH = 256;
|
4894
4774
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
@@ -4917,29 +4797,29 @@ var require_constants = __commonJS({
|
|
4917
4797
|
}
|
4918
4798
|
});
|
4919
4799
|
|
4920
|
-
// node_modules/.pnpm/semver@7.
|
4800
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js
|
4921
4801
|
var require_debug = __commonJS({
|
4922
|
-
"node_modules/.pnpm/semver@7.
|
4802
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/debug.js"(exports, module2) {
|
4923
4803
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
4924
4804
|
};
|
4925
4805
|
module2.exports = debug;
|
4926
4806
|
}
|
4927
4807
|
});
|
4928
4808
|
|
4929
|
-
// node_modules/.pnpm/semver@7.
|
4809
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js
|
4930
4810
|
var require_re = __commonJS({
|
4931
|
-
"node_modules/.pnpm/semver@7.
|
4811
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/re.js"(exports, module2) {
|
4932
4812
|
var {
|
4933
4813
|
MAX_SAFE_COMPONENT_LENGTH,
|
4934
4814
|
MAX_SAFE_BUILD_LENGTH,
|
4935
4815
|
MAX_LENGTH
|
4936
4816
|
} = require_constants();
|
4937
4817
|
var debug = require_debug();
|
4938
|
-
|
4939
|
-
var re =
|
4940
|
-
var safeRe =
|
4941
|
-
var src =
|
4942
|
-
var t =
|
4818
|
+
exports = module2.exports = {};
|
4819
|
+
var re = exports.re = [];
|
4820
|
+
var safeRe = exports.safeRe = [];
|
4821
|
+
var src = exports.src = [];
|
4822
|
+
var t = exports.t = {};
|
4943
4823
|
var R = 0;
|
4944
4824
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
4945
4825
|
var safeRegexReplacements = [
|
@@ -4984,25 +4864,22 @@ var require_re = __commonJS({
|
|
4984
4864
|
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
4985
4865
|
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
4986
4866
|
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
4987
|
-
createToken("
|
4988
|
-
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
4989
|
-
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
4867
|
+
createToken("COERCE", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:$|[^\\d])`);
|
4990
4868
|
createToken("COERCERTL", src[t.COERCE], true);
|
4991
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
4992
4869
|
createToken("LONETILDE", "(?:~>?)");
|
4993
4870
|
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
4994
|
-
|
4871
|
+
exports.tildeTrimReplace = "$1~";
|
4995
4872
|
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
4996
4873
|
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
4997
4874
|
createToken("LONECARET", "(?:\\^)");
|
4998
4875
|
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
4999
|
-
|
4876
|
+
exports.caretTrimReplace = "$1^";
|
5000
4877
|
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
5001
4878
|
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
5002
4879
|
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
5003
4880
|
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
5004
4881
|
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
5005
|
-
|
4882
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
5006
4883
|
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
5007
4884
|
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
5008
4885
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
@@ -5011,9 +4888,9 @@ var require_re = __commonJS({
|
|
5011
4888
|
}
|
5012
4889
|
});
|
5013
4890
|
|
5014
|
-
// node_modules/.pnpm/semver@7.
|
4891
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js
|
5015
4892
|
var require_parse_options = __commonJS({
|
5016
|
-
"node_modules/.pnpm/semver@7.
|
4893
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/parse-options.js"(exports, module2) {
|
5017
4894
|
var looseOption = Object.freeze({ loose: true });
|
5018
4895
|
var emptyOpts = Object.freeze({});
|
5019
4896
|
var parseOptions = (options) => {
|
@@ -5029,9 +4906,9 @@ var require_parse_options = __commonJS({
|
|
5029
4906
|
}
|
5030
4907
|
});
|
5031
4908
|
|
5032
|
-
// node_modules/.pnpm/semver@7.
|
4909
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js
|
5033
4910
|
var require_identifiers = __commonJS({
|
5034
|
-
"node_modules/.pnpm/semver@7.
|
4911
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/internal/identifiers.js"(exports, module2) {
|
5035
4912
|
var numeric = /^[0-9]+$/;
|
5036
4913
|
var compareIdentifiers = (a, b) => {
|
5037
4914
|
const anum = numeric.test(a);
|
@@ -5050,9 +4927,9 @@ var require_identifiers = __commonJS({
|
|
5050
4927
|
}
|
5051
4928
|
});
|
5052
4929
|
|
5053
|
-
// node_modules/.pnpm/semver@7.
|
4930
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js
|
5054
4931
|
var require_semver = __commonJS({
|
5055
|
-
"node_modules/.pnpm/semver@7.
|
4932
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/semver.js"(exports, module2) {
|
5056
4933
|
var debug = require_debug();
|
5057
4934
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
5058
4935
|
var { safeRe: re, t } = require_re();
|
@@ -5292,9 +5169,9 @@ var require_semver = __commonJS({
|
|
5292
5169
|
}
|
5293
5170
|
});
|
5294
5171
|
|
5295
|
-
// node_modules/.pnpm/semver@7.
|
5172
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js
|
5296
5173
|
var require_parse = __commonJS({
|
5297
|
-
"node_modules/.pnpm/semver@7.
|
5174
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/parse.js"(exports, module2) {
|
5298
5175
|
var SemVer = require_semver();
|
5299
5176
|
var parse = (version, options, throwErrors = false) => {
|
5300
5177
|
if (version instanceof SemVer) {
|
@@ -5313,9 +5190,9 @@ var require_parse = __commonJS({
|
|
5313
5190
|
}
|
5314
5191
|
});
|
5315
5192
|
|
5316
|
-
// node_modules/.pnpm/semver@7.
|
5193
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js
|
5317
5194
|
var require_valid = __commonJS({
|
5318
|
-
"node_modules/.pnpm/semver@7.
|
5195
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/valid.js"(exports, module2) {
|
5319
5196
|
var parse = require_parse();
|
5320
5197
|
var valid = (version, options) => {
|
5321
5198
|
const v = parse(version, options);
|
@@ -5325,9 +5202,9 @@ var require_valid = __commonJS({
|
|
5325
5202
|
}
|
5326
5203
|
});
|
5327
5204
|
|
5328
|
-
// node_modules/.pnpm/semver@7.
|
5205
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js
|
5329
5206
|
var require_clean = __commonJS({
|
5330
|
-
"node_modules/.pnpm/semver@7.
|
5207
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/clean.js"(exports, module2) {
|
5331
5208
|
var parse = require_parse();
|
5332
5209
|
var clean = (version, options) => {
|
5333
5210
|
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
@@ -5337,9 +5214,9 @@ var require_clean = __commonJS({
|
|
5337
5214
|
}
|
5338
5215
|
});
|
5339
5216
|
|
5340
|
-
// node_modules/.pnpm/semver@7.
|
5217
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js
|
5341
5218
|
var require_inc = __commonJS({
|
5342
|
-
"node_modules/.pnpm/semver@7.
|
5219
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/inc.js"(exports, module2) {
|
5343
5220
|
var SemVer = require_semver();
|
5344
5221
|
var inc = (version, release, options, identifier, identifierBase) => {
|
5345
5222
|
if (typeof options === "string") {
|
@@ -5360,9 +5237,9 @@ var require_inc = __commonJS({
|
|
5360
5237
|
}
|
5361
5238
|
});
|
5362
5239
|
|
5363
|
-
// node_modules/.pnpm/semver@7.
|
5240
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js
|
5364
5241
|
var require_diff = __commonJS({
|
5365
|
-
"node_modules/.pnpm/semver@7.
|
5242
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/diff.js"(exports, module2) {
|
5366
5243
|
var parse = require_parse();
|
5367
5244
|
var diff = (version1, version2) => {
|
5368
5245
|
const v1 = parse(version1, null, true);
|
@@ -5404,36 +5281,36 @@ var require_diff = __commonJS({
|
|
5404
5281
|
}
|
5405
5282
|
});
|
5406
5283
|
|
5407
|
-
// node_modules/.pnpm/semver@7.
|
5284
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js
|
5408
5285
|
var require_major = __commonJS({
|
5409
|
-
"node_modules/.pnpm/semver@7.
|
5286
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/major.js"(exports, module2) {
|
5410
5287
|
var SemVer = require_semver();
|
5411
5288
|
var major = (a, loose) => new SemVer(a, loose).major;
|
5412
5289
|
module2.exports = major;
|
5413
5290
|
}
|
5414
5291
|
});
|
5415
5292
|
|
5416
|
-
// node_modules/.pnpm/semver@7.
|
5293
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js
|
5417
5294
|
var require_minor = __commonJS({
|
5418
|
-
"node_modules/.pnpm/semver@7.
|
5295
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/minor.js"(exports, module2) {
|
5419
5296
|
var SemVer = require_semver();
|
5420
5297
|
var minor = (a, loose) => new SemVer(a, loose).minor;
|
5421
5298
|
module2.exports = minor;
|
5422
5299
|
}
|
5423
5300
|
});
|
5424
5301
|
|
5425
|
-
// node_modules/.pnpm/semver@7.
|
5302
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js
|
5426
5303
|
var require_patch = __commonJS({
|
5427
|
-
"node_modules/.pnpm/semver@7.
|
5304
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/patch.js"(exports, module2) {
|
5428
5305
|
var SemVer = require_semver();
|
5429
5306
|
var patch = (a, loose) => new SemVer(a, loose).patch;
|
5430
5307
|
module2.exports = patch;
|
5431
5308
|
}
|
5432
5309
|
});
|
5433
5310
|
|
5434
|
-
// node_modules/.pnpm/semver@7.
|
5311
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js
|
5435
5312
|
var require_prerelease = __commonJS({
|
5436
|
-
"node_modules/.pnpm/semver@7.
|
5313
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/prerelease.js"(exports, module2) {
|
5437
5314
|
var parse = require_parse();
|
5438
5315
|
var prerelease = (version, options) => {
|
5439
5316
|
const parsed = parse(version, options);
|
@@ -5443,36 +5320,36 @@ var require_prerelease = __commonJS({
|
|
5443
5320
|
}
|
5444
5321
|
});
|
5445
5322
|
|
5446
|
-
// node_modules/.pnpm/semver@7.
|
5323
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js
|
5447
5324
|
var require_compare = __commonJS({
|
5448
|
-
"node_modules/.pnpm/semver@7.
|
5325
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare.js"(exports, module2) {
|
5449
5326
|
var SemVer = require_semver();
|
5450
5327
|
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
5451
5328
|
module2.exports = compare;
|
5452
5329
|
}
|
5453
5330
|
});
|
5454
5331
|
|
5455
|
-
// node_modules/.pnpm/semver@7.
|
5332
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js
|
5456
5333
|
var require_rcompare = __commonJS({
|
5457
|
-
"node_modules/.pnpm/semver@7.
|
5334
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rcompare.js"(exports, module2) {
|
5458
5335
|
var compare = require_compare();
|
5459
5336
|
var rcompare = (a, b, loose) => compare(b, a, loose);
|
5460
5337
|
module2.exports = rcompare;
|
5461
5338
|
}
|
5462
5339
|
});
|
5463
5340
|
|
5464
|
-
// node_modules/.pnpm/semver@7.
|
5341
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js
|
5465
5342
|
var require_compare_loose = __commonJS({
|
5466
|
-
"node_modules/.pnpm/semver@7.
|
5343
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-loose.js"(exports, module2) {
|
5467
5344
|
var compare = require_compare();
|
5468
5345
|
var compareLoose = (a, b) => compare(a, b, true);
|
5469
5346
|
module2.exports = compareLoose;
|
5470
5347
|
}
|
5471
5348
|
});
|
5472
5349
|
|
5473
|
-
// node_modules/.pnpm/semver@7.
|
5350
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js
|
5474
5351
|
var require_compare_build = __commonJS({
|
5475
|
-
"node_modules/.pnpm/semver@7.
|
5352
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/compare-build.js"(exports, module2) {
|
5476
5353
|
var SemVer = require_semver();
|
5477
5354
|
var compareBuild = (a, b, loose) => {
|
5478
5355
|
const versionA = new SemVer(a, loose);
|
@@ -5483,81 +5360,81 @@ var require_compare_build = __commonJS({
|
|
5483
5360
|
}
|
5484
5361
|
});
|
5485
5362
|
|
5486
|
-
// node_modules/.pnpm/semver@7.
|
5363
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js
|
5487
5364
|
var require_sort = __commonJS({
|
5488
|
-
"node_modules/.pnpm/semver@7.
|
5365
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/sort.js"(exports, module2) {
|
5489
5366
|
var compareBuild = require_compare_build();
|
5490
5367
|
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
5491
5368
|
module2.exports = sort;
|
5492
5369
|
}
|
5493
5370
|
});
|
5494
5371
|
|
5495
|
-
// node_modules/.pnpm/semver@7.
|
5372
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js
|
5496
5373
|
var require_rsort = __commonJS({
|
5497
|
-
"node_modules/.pnpm/semver@7.
|
5374
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/rsort.js"(exports, module2) {
|
5498
5375
|
var compareBuild = require_compare_build();
|
5499
5376
|
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
5500
5377
|
module2.exports = rsort;
|
5501
5378
|
}
|
5502
5379
|
});
|
5503
5380
|
|
5504
|
-
// node_modules/.pnpm/semver@7.
|
5381
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js
|
5505
5382
|
var require_gt = __commonJS({
|
5506
|
-
"node_modules/.pnpm/semver@7.
|
5383
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gt.js"(exports, module2) {
|
5507
5384
|
var compare = require_compare();
|
5508
5385
|
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
5509
5386
|
module2.exports = gt;
|
5510
5387
|
}
|
5511
5388
|
});
|
5512
5389
|
|
5513
|
-
// node_modules/.pnpm/semver@7.
|
5390
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js
|
5514
5391
|
var require_lt = __commonJS({
|
5515
|
-
"node_modules/.pnpm/semver@7.
|
5392
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lt.js"(exports, module2) {
|
5516
5393
|
var compare = require_compare();
|
5517
5394
|
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
5518
5395
|
module2.exports = lt;
|
5519
5396
|
}
|
5520
5397
|
});
|
5521
5398
|
|
5522
|
-
// node_modules/.pnpm/semver@7.
|
5399
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js
|
5523
5400
|
var require_eq = __commonJS({
|
5524
|
-
"node_modules/.pnpm/semver@7.
|
5401
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/eq.js"(exports, module2) {
|
5525
5402
|
var compare = require_compare();
|
5526
5403
|
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
5527
5404
|
module2.exports = eq;
|
5528
5405
|
}
|
5529
5406
|
});
|
5530
5407
|
|
5531
|
-
// node_modules/.pnpm/semver@7.
|
5408
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js
|
5532
5409
|
var require_neq = __commonJS({
|
5533
|
-
"node_modules/.pnpm/semver@7.
|
5410
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/neq.js"(exports, module2) {
|
5534
5411
|
var compare = require_compare();
|
5535
5412
|
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
5536
5413
|
module2.exports = neq;
|
5537
5414
|
}
|
5538
5415
|
});
|
5539
5416
|
|
5540
|
-
// node_modules/.pnpm/semver@7.
|
5417
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js
|
5541
5418
|
var require_gte = __commonJS({
|
5542
|
-
"node_modules/.pnpm/semver@7.
|
5419
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/gte.js"(exports, module2) {
|
5543
5420
|
var compare = require_compare();
|
5544
5421
|
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
5545
5422
|
module2.exports = gte;
|
5546
5423
|
}
|
5547
5424
|
});
|
5548
5425
|
|
5549
|
-
// node_modules/.pnpm/semver@7.
|
5426
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js
|
5550
5427
|
var require_lte = __commonJS({
|
5551
|
-
"node_modules/.pnpm/semver@7.
|
5428
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/lte.js"(exports, module2) {
|
5552
5429
|
var compare = require_compare();
|
5553
5430
|
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
5554
5431
|
module2.exports = lte;
|
5555
5432
|
}
|
5556
5433
|
});
|
5557
5434
|
|
5558
|
-
// node_modules/.pnpm/semver@7.
|
5435
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js
|
5559
5436
|
var require_cmp = __commonJS({
|
5560
|
-
"node_modules/.pnpm/semver@7.
|
5437
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/cmp.js"(exports, module2) {
|
5561
5438
|
var eq = require_eq();
|
5562
5439
|
var neq = require_neq();
|
5563
5440
|
var gt = require_gt();
|
@@ -5604,9 +5481,9 @@ var require_cmp = __commonJS({
|
|
5604
5481
|
}
|
5605
5482
|
});
|
5606
5483
|
|
5607
|
-
// node_modules/.pnpm/semver@7.
|
5484
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js
|
5608
5485
|
var require_coerce = __commonJS({
|
5609
|
-
"node_modules/.pnpm/semver@7.
|
5486
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/coerce.js"(exports, module2) {
|
5610
5487
|
var SemVer = require_semver();
|
5611
5488
|
var parse = require_parse();
|
5612
5489
|
var { safeRe: re, t } = require_re();
|
@@ -5623,27 +5500,21 @@ var require_coerce = __commonJS({
|
|
5623
5500
|
options = options || {};
|
5624
5501
|
let match2 = null;
|
5625
5502
|
if (!options.rtl) {
|
5626
|
-
match2 = version.match(
|
5503
|
+
match2 = version.match(re[t.COERCE]);
|
5627
5504
|
} else {
|
5628
|
-
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
5629
5505
|
let next;
|
5630
|
-
while ((next =
|
5506
|
+
while ((next = re[t.COERCERTL].exec(version)) && (!match2 || match2.index + match2[0].length !== version.length)) {
|
5631
5507
|
if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
|
5632
5508
|
match2 = next;
|
5633
5509
|
}
|
5634
|
-
|
5510
|
+
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
|
5635
5511
|
}
|
5636
|
-
|
5512
|
+
re[t.COERCERTL].lastIndex = -1;
|
5637
5513
|
}
|
5638
5514
|
if (match2 === null) {
|
5639
5515
|
return null;
|
5640
5516
|
}
|
5641
|
-
|
5642
|
-
const minor = match2[3] || "0";
|
5643
|
-
const patch = match2[4] || "0";
|
5644
|
-
const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
|
5645
|
-
const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
|
5646
|
-
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
5517
|
+
return parse(`${match2[2]}.${match2[3] || "0"}.${match2[4] || "0"}`, options);
|
5647
5518
|
};
|
5648
5519
|
module2.exports = coerce;
|
5649
5520
|
}
|
@@ -5651,7 +5522,7 @@ var require_coerce = __commonJS({
|
|
5651
5522
|
|
5652
5523
|
// node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js
|
5653
5524
|
var require_iterator = __commonJS({
|
5654
|
-
"node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js"(
|
5525
|
+
"node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/iterator.js"(exports, module2) {
|
5655
5526
|
"use strict";
|
5656
5527
|
module2.exports = function(Yallist) {
|
5657
5528
|
Yallist.prototype[Symbol.iterator] = function* () {
|
@@ -5665,7 +5536,7 @@ var require_iterator = __commonJS({
|
|
5665
5536
|
|
5666
5537
|
// node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js
|
5667
5538
|
var require_yallist = __commonJS({
|
5668
|
-
"node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js"(
|
5539
|
+
"node_modules/.pnpm/yallist@4.0.0/node_modules/yallist/yallist.js"(exports, module2) {
|
5669
5540
|
"use strict";
|
5670
5541
|
module2.exports = Yallist;
|
5671
5542
|
Yallist.Node = Node;
|
@@ -6034,7 +5905,7 @@ var require_yallist = __commonJS({
|
|
6034
5905
|
|
6035
5906
|
// node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js
|
6036
5907
|
var require_lru_cache = __commonJS({
|
6037
|
-
"node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js"(
|
5908
|
+
"node_modules/.pnpm/lru-cache@6.0.0/node_modules/lru-cache/index.js"(exports, module2) {
|
6038
5909
|
"use strict";
|
6039
5910
|
var Yallist = require_yallist();
|
6040
5911
|
var MAX = Symbol("max");
|
@@ -6302,9 +6173,9 @@ var require_lru_cache = __commonJS({
|
|
6302
6173
|
}
|
6303
6174
|
});
|
6304
6175
|
|
6305
|
-
// node_modules/.pnpm/semver@7.
|
6176
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js
|
6306
6177
|
var require_range = __commonJS({
|
6307
|
-
"node_modules/.pnpm/semver@7.
|
6178
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/range.js"(exports, module2) {
|
6308
6179
|
var Range = class _Range {
|
6309
6180
|
constructor(range, options) {
|
6310
6181
|
options = parseOptions(options);
|
@@ -6659,9 +6530,9 @@ var require_range = __commonJS({
|
|
6659
6530
|
}
|
6660
6531
|
});
|
6661
6532
|
|
6662
|
-
// node_modules/.pnpm/semver@7.
|
6533
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js
|
6663
6534
|
var require_comparator = __commonJS({
|
6664
|
-
"node_modules/.pnpm/semver@7.
|
6535
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/classes/comparator.js"(exports, module2) {
|
6665
6536
|
var ANY = Symbol("SemVer ANY");
|
6666
6537
|
var Comparator = class _Comparator {
|
6667
6538
|
static get ANY() {
|
@@ -6771,9 +6642,9 @@ var require_comparator = __commonJS({
|
|
6771
6642
|
}
|
6772
6643
|
});
|
6773
6644
|
|
6774
|
-
// node_modules/.pnpm/semver@7.
|
6645
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js
|
6775
6646
|
var require_satisfies = __commonJS({
|
6776
|
-
"node_modules/.pnpm/semver@7.
|
6647
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/functions/satisfies.js"(exports, module2) {
|
6777
6648
|
var Range = require_range();
|
6778
6649
|
var satisfies = (version, range, options) => {
|
6779
6650
|
try {
|
@@ -6787,18 +6658,18 @@ var require_satisfies = __commonJS({
|
|
6787
6658
|
}
|
6788
6659
|
});
|
6789
6660
|
|
6790
|
-
// node_modules/.pnpm/semver@7.
|
6661
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js
|
6791
6662
|
var require_to_comparators = __commonJS({
|
6792
|
-
"node_modules/.pnpm/semver@7.
|
6663
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/to-comparators.js"(exports, module2) {
|
6793
6664
|
var Range = require_range();
|
6794
6665
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
6795
6666
|
module2.exports = toComparators;
|
6796
6667
|
}
|
6797
6668
|
});
|
6798
6669
|
|
6799
|
-
// node_modules/.pnpm/semver@7.
|
6670
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js
|
6800
6671
|
var require_max_satisfying = __commonJS({
|
6801
|
-
"node_modules/.pnpm/semver@7.
|
6672
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/max-satisfying.js"(exports, module2) {
|
6802
6673
|
var SemVer = require_semver();
|
6803
6674
|
var Range = require_range();
|
6804
6675
|
var maxSatisfying = (versions, range, options) => {
|
@@ -6824,9 +6695,9 @@ var require_max_satisfying = __commonJS({
|
|
6824
6695
|
}
|
6825
6696
|
});
|
6826
6697
|
|
6827
|
-
// node_modules/.pnpm/semver@7.
|
6698
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js
|
6828
6699
|
var require_min_satisfying = __commonJS({
|
6829
|
-
"node_modules/.pnpm/semver@7.
|
6700
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-satisfying.js"(exports, module2) {
|
6830
6701
|
var SemVer = require_semver();
|
6831
6702
|
var Range = require_range();
|
6832
6703
|
var minSatisfying = (versions, range, options) => {
|
@@ -6852,9 +6723,9 @@ var require_min_satisfying = __commonJS({
|
|
6852
6723
|
}
|
6853
6724
|
});
|
6854
6725
|
|
6855
|
-
// node_modules/.pnpm/semver@7.
|
6726
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js
|
6856
6727
|
var require_min_version = __commonJS({
|
6857
|
-
"node_modules/.pnpm/semver@7.
|
6728
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/min-version.js"(exports, module2) {
|
6858
6729
|
var SemVer = require_semver();
|
6859
6730
|
var Range = require_range();
|
6860
6731
|
var gt = require_gt();
|
@@ -6908,9 +6779,9 @@ var require_min_version = __commonJS({
|
|
6908
6779
|
}
|
6909
6780
|
});
|
6910
6781
|
|
6911
|
-
// node_modules/.pnpm/semver@7.
|
6782
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js
|
6912
6783
|
var require_valid2 = __commonJS({
|
6913
|
-
"node_modules/.pnpm/semver@7.
|
6784
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/valid.js"(exports, module2) {
|
6914
6785
|
var Range = require_range();
|
6915
6786
|
var validRange = (range, options) => {
|
6916
6787
|
try {
|
@@ -6923,9 +6794,9 @@ var require_valid2 = __commonJS({
|
|
6923
6794
|
}
|
6924
6795
|
});
|
6925
6796
|
|
6926
|
-
// node_modules/.pnpm/semver@7.
|
6797
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js
|
6927
6798
|
var require_outside = __commonJS({
|
6928
|
-
"node_modules/.pnpm/semver@7.
|
6799
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/outside.js"(exports, module2) {
|
6929
6800
|
var SemVer = require_semver();
|
6930
6801
|
var Comparator = require_comparator();
|
6931
6802
|
var { ANY } = Comparator;
|
@@ -6991,27 +6862,27 @@ var require_outside = __commonJS({
|
|
6991
6862
|
}
|
6992
6863
|
});
|
6993
6864
|
|
6994
|
-
// node_modules/.pnpm/semver@7.
|
6865
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js
|
6995
6866
|
var require_gtr = __commonJS({
|
6996
|
-
"node_modules/.pnpm/semver@7.
|
6867
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/gtr.js"(exports, module2) {
|
6997
6868
|
var outside = require_outside();
|
6998
6869
|
var gtr = (version, range, options) => outside(version, range, ">", options);
|
6999
6870
|
module2.exports = gtr;
|
7000
6871
|
}
|
7001
6872
|
});
|
7002
6873
|
|
7003
|
-
// node_modules/.pnpm/semver@7.
|
6874
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js
|
7004
6875
|
var require_ltr = __commonJS({
|
7005
|
-
"node_modules/.pnpm/semver@7.
|
6876
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/ltr.js"(exports, module2) {
|
7006
6877
|
var outside = require_outside();
|
7007
6878
|
var ltr = (version, range, options) => outside(version, range, "<", options);
|
7008
6879
|
module2.exports = ltr;
|
7009
6880
|
}
|
7010
6881
|
});
|
7011
6882
|
|
7012
|
-
// node_modules/.pnpm/semver@7.
|
6883
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js
|
7013
6884
|
var require_intersects = __commonJS({
|
7014
|
-
"node_modules/.pnpm/semver@7.
|
6885
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/intersects.js"(exports, module2) {
|
7015
6886
|
var Range = require_range();
|
7016
6887
|
var intersects = (r1, r2, options) => {
|
7017
6888
|
r1 = new Range(r1, options);
|
@@ -7022,9 +6893,9 @@ var require_intersects = __commonJS({
|
|
7022
6893
|
}
|
7023
6894
|
});
|
7024
6895
|
|
7025
|
-
// node_modules/.pnpm/semver@7.
|
6896
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/simplify.js
|
7026
6897
|
var require_simplify = __commonJS({
|
7027
|
-
"node_modules/.pnpm/semver@7.
|
6898
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/simplify.js"(exports, module2) {
|
7028
6899
|
var satisfies = require_satisfies();
|
7029
6900
|
var compare = require_compare();
|
7030
6901
|
module2.exports = (versions, range, options) => {
|
@@ -7071,9 +6942,9 @@ var require_simplify = __commonJS({
|
|
7071
6942
|
}
|
7072
6943
|
});
|
7073
6944
|
|
7074
|
-
// node_modules/.pnpm/semver@7.
|
6945
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/subset.js
|
7075
6946
|
var require_subset = __commonJS({
|
7076
|
-
"node_modules/.pnpm/semver@7.
|
6947
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/ranges/subset.js"(exports, module2) {
|
7077
6948
|
var Range = require_range();
|
7078
6949
|
var Comparator = require_comparator();
|
7079
6950
|
var { ANY } = Comparator;
|
@@ -7233,9 +7104,9 @@ var require_subset = __commonJS({
|
|
7233
7104
|
}
|
7234
7105
|
});
|
7235
7106
|
|
7236
|
-
// node_modules/.pnpm/semver@7.
|
7107
|
+
// node_modules/.pnpm/semver@7.5.4/node_modules/semver/index.js
|
7237
7108
|
var require_semver2 = __commonJS({
|
7238
|
-
"node_modules/.pnpm/semver@7.
|
7109
|
+
"node_modules/.pnpm/semver@7.5.4/node_modules/semver/index.js"(exports, module2) {
|
7239
7110
|
var internalRe = require_re();
|
7240
7111
|
var constants = require_constants();
|
7241
7112
|
var SemVer = require_semver();
|
@@ -7333,6 +7204,7 @@ var init_serializer = __esm({
|
|
7333
7204
|
"src/serializer/index.ts"() {
|
7334
7205
|
"use strict";
|
7335
7206
|
glob = __toESM(require("glob"));
|
7207
|
+
init_source();
|
7336
7208
|
init_views();
|
7337
7209
|
}
|
7338
7210
|
});
|
@@ -7341,6 +7213,7 @@ var init_serializer = __esm({
|
|
7341
7213
|
var init_outputs = __esm({
|
7342
7214
|
"src/cli/validations/outputs.ts"() {
|
7343
7215
|
"use strict";
|
7216
|
+
init_source();
|
7344
7217
|
}
|
7345
7218
|
});
|
7346
7219
|
|
@@ -7392,6 +7265,7 @@ var init_sqliteSerializer = __esm({
|
|
7392
7265
|
import_sqlite_core2 = require("drizzle-orm/sqlite-core");
|
7393
7266
|
init_serializer();
|
7394
7267
|
init_outputs();
|
7268
|
+
init_source();
|
7395
7269
|
dialect3 = new import_sqlite_core2.SQLiteSyncDialect();
|
7396
7270
|
fromDatabase = async (db, tablesFilter = (table4) => true, progressCallback) => {
|
7397
7271
|
const result = {};
|
@@ -7592,7 +7466,7 @@ WHERE
|
|
7592
7466
|
|
7593
7467
|
// node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js
|
7594
7468
|
var require_balanced_match = __commonJS({
|
7595
|
-
"node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(
|
7469
|
+
"node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js"(exports, module2) {
|
7596
7470
|
"use strict";
|
7597
7471
|
module2.exports = balanced;
|
7598
7472
|
function balanced(a, b, str) {
|
@@ -7652,7 +7526,7 @@ var require_balanced_match = __commonJS({
|
|
7652
7526
|
|
7653
7527
|
// node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
|
7654
7528
|
var require_brace_expansion = __commonJS({
|
7655
|
-
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(
|
7529
|
+
"node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
|
7656
7530
|
var balanced = require_balanced_match();
|
7657
7531
|
module2.exports = expandTop;
|
7658
7532
|
var escSlash = "\0SLASH" + Math.random() + "\0";
|
@@ -7810,6 +7684,7 @@ var init_pgSerializer = __esm({
|
|
7810
7684
|
import_pg_core3 = require("drizzle-orm/pg-core");
|
7811
7685
|
import_drizzle_orm2 = require("drizzle-orm");
|
7812
7686
|
init_serializer();
|
7687
|
+
init_source();
|
7813
7688
|
init_outputs();
|
7814
7689
|
dialect4 = new import_pg_core2.PgDialect();
|
7815
7690
|
trimChar = (str, char) => {
|
@@ -8501,10 +8376,10 @@ Array.prototype.random = function() {
|
|
8501
8376
|
return this[~~(Math.random() * this.length)];
|
8502
8377
|
};
|
8503
8378
|
|
8504
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8379
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/index.js
|
8505
8380
|
var import_brace_expansion = __toESM(require_brace_expansion(), 1);
|
8506
8381
|
|
8507
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8382
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/brace-expressions.js
|
8508
8383
|
var posixClasses = {
|
8509
8384
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
8510
8385
|
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
@@ -8614,17 +8489,17 @@ var parseClass = (glob2, position) => {
|
|
8614
8489
|
return [comb, uflag, endPos - pos, true];
|
8615
8490
|
};
|
8616
8491
|
|
8617
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8492
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/escape.js
|
8618
8493
|
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
8619
8494
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
8620
8495
|
};
|
8621
8496
|
|
8622
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8497
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/unescape.js
|
8623
8498
|
var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
8624
8499
|
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
8625
8500
|
};
|
8626
8501
|
|
8627
|
-
// node_modules/.pnpm/minimatch@7.4.
|
8502
|
+
// node_modules/.pnpm/minimatch@7.4.3/node_modules/minimatch/dist/mjs/index.js
|
8628
8503
|
var minimatch = (p, pattern, options = {}) => {
|
8629
8504
|
assertValidPattern(pattern);
|
8630
8505
|
if (!options.nocomment && pattern.charAt(0) === "#") {
|