@eslint-react/core 1.48.2 → 1.48.3-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +518 -31
- package/dist/index.mjs +518 -31
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -7,9 +7,13 @@ import * as VAR3 from '@eslint-react/var';
|
|
|
7
7
|
import { isMatching, P, match } from 'ts-pattern';
|
|
8
8
|
import birecord from 'birecord';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
11
15
|
|
|
12
|
-
// ../../node_modules/.pnpm/@zod+core@0.1
|
|
16
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/core.js
|
|
13
17
|
// @__NO_SIDE_EFFECTS__
|
|
14
18
|
function $constructor(name, initializer) {
|
|
15
19
|
class _6 {
|
|
@@ -50,6 +54,87 @@ var globalConfig = {};
|
|
|
50
54
|
function config(config2) {
|
|
51
55
|
return globalConfig;
|
|
52
56
|
}
|
|
57
|
+
|
|
58
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/util.js
|
|
59
|
+
var util_exports = {};
|
|
60
|
+
__export(util_exports, {
|
|
61
|
+
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
62
|
+
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
63
|
+
aborted: () => aborted,
|
|
64
|
+
allowsEval: () => allowsEval,
|
|
65
|
+
assert: () => assert,
|
|
66
|
+
assertEqual: () => assertEqual,
|
|
67
|
+
assertIs: () => assertIs,
|
|
68
|
+
assertNever: () => assertNever,
|
|
69
|
+
assertNotEqual: () => assertNotEqual,
|
|
70
|
+
assignProp: () => assignProp,
|
|
71
|
+
cached: () => cached,
|
|
72
|
+
cleanInterfaceKey: () => cleanInterfaceKey,
|
|
73
|
+
cleanInterfaceShape: () => cleanInterfaceShape,
|
|
74
|
+
cleanRegex: () => cleanRegex,
|
|
75
|
+
clone: () => clone,
|
|
76
|
+
createTransparentProxy: () => createTransparentProxy,
|
|
77
|
+
defineLazy: () => defineLazy,
|
|
78
|
+
esc: () => esc,
|
|
79
|
+
escapeRegex: () => escapeRegex,
|
|
80
|
+
extend: () => extend,
|
|
81
|
+
extendObjectLike: () => extendObjectLike,
|
|
82
|
+
finalizeIssue: () => finalizeIssue,
|
|
83
|
+
floatSafeRemainder: () => floatSafeRemainder,
|
|
84
|
+
getElementAtPath: () => getElementAtPath,
|
|
85
|
+
getLengthableOrigin: () => getLengthableOrigin,
|
|
86
|
+
getParsedType: () => getParsedType,
|
|
87
|
+
getSizableOrigin: () => getSizableOrigin,
|
|
88
|
+
getValidEnumValues: () => getValidEnumValues,
|
|
89
|
+
isObject: () => isObject,
|
|
90
|
+
isPlainObject: () => isPlainObject,
|
|
91
|
+
issue: () => issue,
|
|
92
|
+
joinValues: () => joinValues,
|
|
93
|
+
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
94
|
+
mergeObjectLike: () => mergeObjectLike,
|
|
95
|
+
normalizeObjectLikeDef: () => normalizeObjectLikeDef,
|
|
96
|
+
normalizeParams: () => normalizeParams,
|
|
97
|
+
nullish: () => nullish,
|
|
98
|
+
numKeys: () => numKeys,
|
|
99
|
+
omit: () => omit,
|
|
100
|
+
optionalInterfaceKeys: () => optionalInterfaceKeys,
|
|
101
|
+
optionalObjectKeys: () => optionalObjectKeys,
|
|
102
|
+
partialObjectLike: () => partialObjectLike,
|
|
103
|
+
pick: () => pick,
|
|
104
|
+
prefixIssues: () => prefixIssues,
|
|
105
|
+
primitiveTypes: () => primitiveTypes,
|
|
106
|
+
promiseAllObject: () => promiseAllObject,
|
|
107
|
+
propertyKeyTypes: () => propertyKeyTypes,
|
|
108
|
+
randomString: () => randomString,
|
|
109
|
+
requiredObjectLike: () => requiredObjectLike,
|
|
110
|
+
splitChecksAndParams: () => splitChecksAndParams,
|
|
111
|
+
stringifyPrimitive: () => stringifyPrimitive,
|
|
112
|
+
unwrapMessage: () => unwrapMessage
|
|
113
|
+
});
|
|
114
|
+
function assertEqual(val) {
|
|
115
|
+
return val;
|
|
116
|
+
}
|
|
117
|
+
function assertNotEqual(val) {
|
|
118
|
+
return val;
|
|
119
|
+
}
|
|
120
|
+
function assertIs(_arg) {
|
|
121
|
+
}
|
|
122
|
+
function assertNever(_x) {
|
|
123
|
+
throw new Error();
|
|
124
|
+
}
|
|
125
|
+
function assert(_6) {
|
|
126
|
+
}
|
|
127
|
+
function getValidEnumValues(obj) {
|
|
128
|
+
const validKeys = Object.keys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
129
|
+
const filtered = {};
|
|
130
|
+
for (const k of validKeys) {
|
|
131
|
+
filtered[k] = obj[k];
|
|
132
|
+
}
|
|
133
|
+
return Object.values(filtered);
|
|
134
|
+
}
|
|
135
|
+
function joinValues(array2, separator = "|") {
|
|
136
|
+
return array2.map((val) => stringifyPrimitive(val)).join(separator);
|
|
137
|
+
}
|
|
53
138
|
function jsonStringifyReplacer(_6, value) {
|
|
54
139
|
if (typeof value === "bigint")
|
|
55
140
|
return value.toString();
|
|
@@ -66,11 +151,22 @@ function cached(getter) {
|
|
|
66
151
|
}
|
|
67
152
|
};
|
|
68
153
|
}
|
|
154
|
+
function nullish(input) {
|
|
155
|
+
return input === null || input === void 0;
|
|
156
|
+
}
|
|
69
157
|
function cleanRegex(source) {
|
|
70
158
|
const start = source.startsWith("^") ? 1 : 0;
|
|
71
159
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
72
160
|
return source.slice(start, end);
|
|
73
161
|
}
|
|
162
|
+
function floatSafeRemainder(val, step) {
|
|
163
|
+
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
164
|
+
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
165
|
+
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
166
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
167
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
168
|
+
return valInt % stepInt / 10 ** decCount;
|
|
169
|
+
}
|
|
74
170
|
function defineLazy(object2, key, getter) {
|
|
75
171
|
Object.defineProperty(object2, key, {
|
|
76
172
|
get() {
|
|
@@ -89,6 +185,30 @@ function defineLazy(object2, key, getter) {
|
|
|
89
185
|
configurable: true
|
|
90
186
|
});
|
|
91
187
|
}
|
|
188
|
+
function assignProp(target, prop, value) {
|
|
189
|
+
Object.defineProperty(target, prop, {
|
|
190
|
+
value,
|
|
191
|
+
writable: true,
|
|
192
|
+
enumerable: true,
|
|
193
|
+
configurable: true
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
function getElementAtPath(obj, path) {
|
|
197
|
+
if (!path)
|
|
198
|
+
return obj;
|
|
199
|
+
return path.reduce((acc, key) => acc?.[key], obj);
|
|
200
|
+
}
|
|
201
|
+
function promiseAllObject(promisesObj) {
|
|
202
|
+
const keys = Object.keys(promisesObj);
|
|
203
|
+
const promises = keys.map((key) => promisesObj[key]);
|
|
204
|
+
return Promise.all(promises).then((results) => {
|
|
205
|
+
const resolvedObj = {};
|
|
206
|
+
for (let i = 0; i < keys.length; i++) {
|
|
207
|
+
resolvedObj[keys[i]] = results[i];
|
|
208
|
+
}
|
|
209
|
+
return resolvedObj;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
92
212
|
function randomString(length = 10) {
|
|
93
213
|
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
94
214
|
let str = "";
|
|
@@ -111,9 +231,78 @@ var allowsEval = cached(() => {
|
|
|
111
231
|
return false;
|
|
112
232
|
}
|
|
113
233
|
});
|
|
234
|
+
function isPlainObject(data) {
|
|
235
|
+
return typeof data === "object" && data !== null && Object.getPrototypeOf(data) === Object.prototype;
|
|
236
|
+
}
|
|
237
|
+
function numKeys(data) {
|
|
238
|
+
let keyCount = 0;
|
|
239
|
+
for (const key in data) {
|
|
240
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
241
|
+
keyCount++;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return keyCount;
|
|
245
|
+
}
|
|
246
|
+
var getParsedType = (data) => {
|
|
247
|
+
const t = typeof data;
|
|
248
|
+
switch (t) {
|
|
249
|
+
case "undefined":
|
|
250
|
+
return "undefined";
|
|
251
|
+
case "string":
|
|
252
|
+
return "string";
|
|
253
|
+
case "number":
|
|
254
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
255
|
+
case "boolean":
|
|
256
|
+
return "boolean";
|
|
257
|
+
case "function":
|
|
258
|
+
return "function";
|
|
259
|
+
case "bigint":
|
|
260
|
+
return "bigint";
|
|
261
|
+
case "symbol":
|
|
262
|
+
return "symbol";
|
|
263
|
+
case "object":
|
|
264
|
+
if (Array.isArray(data)) {
|
|
265
|
+
return "array";
|
|
266
|
+
}
|
|
267
|
+
if (data === null) {
|
|
268
|
+
return "null";
|
|
269
|
+
}
|
|
270
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
271
|
+
return "promise";
|
|
272
|
+
}
|
|
273
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
274
|
+
return "map";
|
|
275
|
+
}
|
|
276
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
277
|
+
return "set";
|
|
278
|
+
}
|
|
279
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
280
|
+
return "date";
|
|
281
|
+
}
|
|
282
|
+
if (typeof File !== "undefined" && data instanceof File) {
|
|
283
|
+
return "file";
|
|
284
|
+
}
|
|
285
|
+
return "object";
|
|
286
|
+
default:
|
|
287
|
+
throw new Error(`Unknown data type: ${t}`);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
291
|
+
var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
|
|
292
|
+
function escapeRegex(str) {
|
|
293
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
294
|
+
}
|
|
114
295
|
function clone(inst, def) {
|
|
115
296
|
return new inst._zod.constr(def);
|
|
116
297
|
}
|
|
298
|
+
function splitChecksAndParams(_paramsOrChecks, _checks) {
|
|
299
|
+
const params = Array.isArray(_paramsOrChecks) ? {} : _paramsOrChecks ?? {};
|
|
300
|
+
const checks = Array.isArray(_paramsOrChecks) ? _paramsOrChecks : _checks ?? [];
|
|
301
|
+
return {
|
|
302
|
+
checks,
|
|
303
|
+
params
|
|
304
|
+
};
|
|
305
|
+
}
|
|
117
306
|
function normalizeParams(_params) {
|
|
118
307
|
const params = _params;
|
|
119
308
|
if (!params)
|
|
@@ -130,11 +319,267 @@ function normalizeParams(_params) {
|
|
|
130
319
|
return { ...params, error: () => params.error };
|
|
131
320
|
return params;
|
|
132
321
|
}
|
|
322
|
+
function createTransparentProxy(getter) {
|
|
323
|
+
let target;
|
|
324
|
+
return new Proxy({}, {
|
|
325
|
+
get(_6, prop, receiver) {
|
|
326
|
+
target ?? (target = getter());
|
|
327
|
+
return Reflect.get(target, prop, receiver);
|
|
328
|
+
},
|
|
329
|
+
set(_6, prop, value, receiver) {
|
|
330
|
+
target ?? (target = getter());
|
|
331
|
+
return Reflect.set(target, prop, value, receiver);
|
|
332
|
+
},
|
|
333
|
+
has(_6, prop) {
|
|
334
|
+
target ?? (target = getter());
|
|
335
|
+
return Reflect.has(target, prop);
|
|
336
|
+
},
|
|
337
|
+
deleteProperty(_6, prop) {
|
|
338
|
+
target ?? (target = getter());
|
|
339
|
+
return Reflect.deleteProperty(target, prop);
|
|
340
|
+
},
|
|
341
|
+
ownKeys(_6) {
|
|
342
|
+
target ?? (target = getter());
|
|
343
|
+
return Reflect.ownKeys(target);
|
|
344
|
+
},
|
|
345
|
+
getOwnPropertyDescriptor(_6, prop) {
|
|
346
|
+
target ?? (target = getter());
|
|
347
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
348
|
+
},
|
|
349
|
+
defineProperty(_6, prop, descriptor) {
|
|
350
|
+
target ?? (target = getter());
|
|
351
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
352
|
+
}
|
|
353
|
+
// apply(target, thisArg, args) {
|
|
354
|
+
// return Reflect.apply(target, thisArg, args);
|
|
355
|
+
// },
|
|
356
|
+
// construct(target, args, newTarget) {
|
|
357
|
+
// return Reflect.construct(target, args, newTarget);
|
|
358
|
+
// },
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
function stringifyPrimitive(value) {
|
|
362
|
+
if (typeof value === "bigint")
|
|
363
|
+
return value.toString() + "n";
|
|
364
|
+
if (typeof value === "string")
|
|
365
|
+
return `"${value}"`;
|
|
366
|
+
return `${value}`;
|
|
367
|
+
}
|
|
133
368
|
function optionalObjectKeys(shape) {
|
|
134
369
|
return Object.keys(shape).filter((k) => {
|
|
135
370
|
return shape[k]._zod.qout === "true";
|
|
136
371
|
});
|
|
137
372
|
}
|
|
373
|
+
function optionalInterfaceKeys(shape) {
|
|
374
|
+
return Object.keys(shape).filter((k) => {
|
|
375
|
+
return k.endsWith("?");
|
|
376
|
+
}).map((k) => k.replace(/\?$/, ""));
|
|
377
|
+
}
|
|
378
|
+
function cleanInterfaceKey(key) {
|
|
379
|
+
return key.replace(/^\?/, "").replace(/\?$/, "");
|
|
380
|
+
}
|
|
381
|
+
function cleanInterfaceShape(_shape) {
|
|
382
|
+
const keyMap = {};
|
|
383
|
+
const shape = {};
|
|
384
|
+
const optional2 = [];
|
|
385
|
+
const defaulted = [];
|
|
386
|
+
for (const [key, value] of Object.entries(_shape)) {
|
|
387
|
+
if (key.endsWith("?"))
|
|
388
|
+
optional2.push(key.slice(0, -1));
|
|
389
|
+
if (key.startsWith("?"))
|
|
390
|
+
defaulted.push(key.slice(1));
|
|
391
|
+
const cleanKey = cleanInterfaceKey(key);
|
|
392
|
+
shape[cleanKey] = value;
|
|
393
|
+
keyMap[cleanKey] = key;
|
|
394
|
+
}
|
|
395
|
+
return { shape, keyMap, optional: optional2, defaulted };
|
|
396
|
+
}
|
|
397
|
+
var NUMBER_FORMAT_RANGES = {
|
|
398
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
399
|
+
int32: [-2147483648, 2147483647],
|
|
400
|
+
uint32: [0, 4294967295],
|
|
401
|
+
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
402
|
+
float64: [-17976931348623157e292, 17976931348623157e292]
|
|
403
|
+
};
|
|
404
|
+
var BIGINT_FORMAT_RANGES = {
|
|
405
|
+
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
406
|
+
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
407
|
+
};
|
|
408
|
+
function pick(schema, mask) {
|
|
409
|
+
const newShape = {};
|
|
410
|
+
const newOptional = [];
|
|
411
|
+
const currShape = schema._zod.def.shape;
|
|
412
|
+
const currOptional = new Set(schema._zod.def.optional);
|
|
413
|
+
for (const key in mask) {
|
|
414
|
+
if (!(key in currShape)) {
|
|
415
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
416
|
+
}
|
|
417
|
+
if (!mask[key])
|
|
418
|
+
continue;
|
|
419
|
+
newShape[key] = currShape[key];
|
|
420
|
+
if (currOptional.has(key)) {
|
|
421
|
+
newOptional.push(key);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return clone(schema, {
|
|
425
|
+
...schema._zod.def,
|
|
426
|
+
shape: newShape,
|
|
427
|
+
optional: newOptional,
|
|
428
|
+
checks: []
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
function omit(schema, mask) {
|
|
432
|
+
const newShape = { ...schema._zod.def.shape };
|
|
433
|
+
const newOptional = new Set(schema._zod.def.optional);
|
|
434
|
+
for (const key in mask) {
|
|
435
|
+
if (!(key in schema._zod.def.shape)) {
|
|
436
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
437
|
+
}
|
|
438
|
+
if (!mask[key])
|
|
439
|
+
continue;
|
|
440
|
+
delete newShape[key];
|
|
441
|
+
newOptional.delete(key);
|
|
442
|
+
}
|
|
443
|
+
return clone(schema, {
|
|
444
|
+
...schema._zod.def,
|
|
445
|
+
shape: newShape,
|
|
446
|
+
optional: [...newOptional],
|
|
447
|
+
checks: []
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
function extend(schema, shape) {
|
|
451
|
+
const def = {
|
|
452
|
+
...schema._zod.def,
|
|
453
|
+
get shape() {
|
|
454
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
455
|
+
assignProp(this, "shape", _shape);
|
|
456
|
+
return _shape;
|
|
457
|
+
},
|
|
458
|
+
checks: []
|
|
459
|
+
// delete existing checks
|
|
460
|
+
};
|
|
461
|
+
defineLazy(def, "shape", () => ({ ...schema._zod.def.shape, ...shape }));
|
|
462
|
+
return clone(schema, def);
|
|
463
|
+
}
|
|
464
|
+
function mergeObjectLike(a, b) {
|
|
465
|
+
const bKeys = new Set(Object.keys(b._zod.def.shape));
|
|
466
|
+
const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
|
|
467
|
+
return clone(a, {
|
|
468
|
+
...a._zod.def,
|
|
469
|
+
get shape() {
|
|
470
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
471
|
+
assignProp(this, "shape", _shape);
|
|
472
|
+
return _shape;
|
|
473
|
+
},
|
|
474
|
+
optional: optional2,
|
|
475
|
+
catchall: b._zod.def.catchall,
|
|
476
|
+
checks: []
|
|
477
|
+
// delete existing checks
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function extendObjectLike(a, b) {
|
|
481
|
+
const bKeys = new Set(Object.keys(b._zod.def.shape));
|
|
482
|
+
const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
|
|
483
|
+
return clone(a, {
|
|
484
|
+
...a._zod.def,
|
|
485
|
+
get shape() {
|
|
486
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
487
|
+
assignProp(this, "shape", _shape);
|
|
488
|
+
return _shape;
|
|
489
|
+
},
|
|
490
|
+
optional: optional2,
|
|
491
|
+
checks: []
|
|
492
|
+
// delete existent checks
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
function partialObjectLike(Class, schema, mask) {
|
|
496
|
+
const shape = { ...schema._zod.def.shape };
|
|
497
|
+
const optional2 = new Set(schema._zod.def.optional);
|
|
498
|
+
if (mask) {
|
|
499
|
+
for (const key in mask) {
|
|
500
|
+
if (!(key in shape)) {
|
|
501
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
502
|
+
}
|
|
503
|
+
if (!mask[key])
|
|
504
|
+
continue;
|
|
505
|
+
shape[key] = new Class({
|
|
506
|
+
type: "optional",
|
|
507
|
+
innerType: schema._zod.def.shape[key]
|
|
508
|
+
});
|
|
509
|
+
optional2.add(key);
|
|
510
|
+
}
|
|
511
|
+
} else {
|
|
512
|
+
for (const key in schema._zod.def.shape) {
|
|
513
|
+
shape[key] = new Class({
|
|
514
|
+
type: "optional",
|
|
515
|
+
innerType: schema._zod.def.shape[key]
|
|
516
|
+
});
|
|
517
|
+
optional2.add(key);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return clone(schema, {
|
|
521
|
+
...schema._zod.def,
|
|
522
|
+
shape,
|
|
523
|
+
optional: [...optional2],
|
|
524
|
+
checks: []
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
function requiredObjectLike(Class, schema, mask) {
|
|
528
|
+
const shape = { ...schema._zod.def.shape };
|
|
529
|
+
if (mask) {
|
|
530
|
+
for (const key in mask) {
|
|
531
|
+
if (!(key in shape)) {
|
|
532
|
+
throw new Error(`Unrecognized key: "${key}"`);
|
|
533
|
+
}
|
|
534
|
+
if (!mask[key])
|
|
535
|
+
continue;
|
|
536
|
+
shape[key] = new Class({
|
|
537
|
+
type: "nonoptional",
|
|
538
|
+
innerType: schema._zod.def.shape[key]
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
} else {
|
|
542
|
+
for (const key in schema._zod.def.shape) {
|
|
543
|
+
shape[key] = new Class({
|
|
544
|
+
type: "nonoptional",
|
|
545
|
+
innerType: schema._zod.def.shape[key]
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return clone(schema, {
|
|
550
|
+
...schema._zod.def,
|
|
551
|
+
shape,
|
|
552
|
+
optional: [],
|
|
553
|
+
checks: []
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
function normalizeObjectLikeDef(def) {
|
|
557
|
+
if (def.type === "interface") {
|
|
558
|
+
const keys = Object.keys(def.shape);
|
|
559
|
+
const keySet = new Set(Object.keys(def.shape));
|
|
560
|
+
return {
|
|
561
|
+
shape: { ...def.shape },
|
|
562
|
+
// resolve getters
|
|
563
|
+
keys,
|
|
564
|
+
keySet,
|
|
565
|
+
numKeys: keys.length,
|
|
566
|
+
optionalKeys: new Set(def.optional)
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
if (def.type === "object") {
|
|
570
|
+
const keys = Object.keys(def.shape);
|
|
571
|
+
const keySet = new Set(Object.keys(def.shape));
|
|
572
|
+
return {
|
|
573
|
+
shape: { ...def.shape },
|
|
574
|
+
// resolve getters
|
|
575
|
+
keys,
|
|
576
|
+
keySet,
|
|
577
|
+
numKeys: keys.length,
|
|
578
|
+
optionalKeys: new Set(def.optional)
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
throw new Error("Invalid object-like type");
|
|
582
|
+
}
|
|
138
583
|
function aborted(x, startIndex = 0) {
|
|
139
584
|
for (let i = startIndex; i < x.issues.length; i++) {
|
|
140
585
|
if (x.issues[i].continue !== true)
|
|
@@ -166,8 +611,36 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
166
611
|
}
|
|
167
612
|
return full;
|
|
168
613
|
}
|
|
614
|
+
function getSizableOrigin(input) {
|
|
615
|
+
if (input instanceof Set)
|
|
616
|
+
return "set";
|
|
617
|
+
if (input instanceof Map)
|
|
618
|
+
return "map";
|
|
619
|
+
if (input instanceof File)
|
|
620
|
+
return "file";
|
|
621
|
+
return "unknown";
|
|
622
|
+
}
|
|
623
|
+
function getLengthableOrigin(input) {
|
|
624
|
+
if (Array.isArray(input))
|
|
625
|
+
return "array";
|
|
626
|
+
if (typeof input === "string")
|
|
627
|
+
return "string";
|
|
628
|
+
return "unknown";
|
|
629
|
+
}
|
|
630
|
+
function issue(...args) {
|
|
631
|
+
const [iss, input, inst] = args;
|
|
632
|
+
if (typeof iss === "string") {
|
|
633
|
+
return {
|
|
634
|
+
message: iss,
|
|
635
|
+
code: "custom",
|
|
636
|
+
input,
|
|
637
|
+
inst
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
return { ...iss };
|
|
641
|
+
}
|
|
169
642
|
|
|
170
|
-
// ../../node_modules/.pnpm/@zod+core@0.1
|
|
643
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/errors.js
|
|
171
644
|
var ZOD_ERROR = Symbol.for("{{zod.error}}");
|
|
172
645
|
var $ZodError = class {
|
|
173
646
|
get message() {
|
|
@@ -184,7 +657,7 @@ var $ZodError = class {
|
|
|
184
657
|
}
|
|
185
658
|
};
|
|
186
659
|
|
|
187
|
-
// ../../node_modules/.pnpm/@zod+core@0.1
|
|
660
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/parse.js
|
|
188
661
|
function _parse(schema, value, _ctx) {
|
|
189
662
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
190
663
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -236,12 +709,13 @@ var string = (params) => {
|
|
|
236
709
|
};
|
|
237
710
|
var boolean = /true|false/i;
|
|
238
711
|
|
|
239
|
-
// ../../node_modules/.pnpm/@zod+core@0.1
|
|
712
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/doc.js
|
|
240
713
|
var Doc = class {
|
|
241
|
-
constructor(args) {
|
|
714
|
+
constructor(args = []) {
|
|
242
715
|
this.content = [];
|
|
243
716
|
this.indent = 0;
|
|
244
|
-
this
|
|
717
|
+
if (this)
|
|
718
|
+
this.args = args;
|
|
245
719
|
}
|
|
246
720
|
indented(fn) {
|
|
247
721
|
this.indent += 1;
|
|
@@ -263,18 +737,28 @@ var Doc = class {
|
|
|
263
737
|
}
|
|
264
738
|
}
|
|
265
739
|
compile() {
|
|
266
|
-
const
|
|
267
|
-
|
|
740
|
+
const args = this?.args;
|
|
741
|
+
const content = this?.content ?? [``];
|
|
742
|
+
const lines = [...content.map((x) => ` ${x}`)];
|
|
743
|
+
return new Function(...args, lines.join("\n"));
|
|
268
744
|
}
|
|
269
745
|
};
|
|
270
746
|
|
|
271
|
-
// ../../node_modules/.pnpm/@zod+core@0.1
|
|
747
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/versions.js
|
|
748
|
+
var version = {
|
|
749
|
+
major: 0,
|
|
750
|
+
minor: 5,
|
|
751
|
+
patch: 1
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/schemas.js
|
|
272
755
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
273
756
|
var _a;
|
|
274
757
|
inst ?? (inst = {});
|
|
275
758
|
inst._zod.id = def.type + "_" + randomString(10);
|
|
276
759
|
inst._zod.def = def;
|
|
277
760
|
inst._zod.computed = inst._zod.computed || {};
|
|
761
|
+
inst._zod.version = version;
|
|
278
762
|
const checks = [...inst._zod.def.checks ?? []];
|
|
279
763
|
def.type;
|
|
280
764
|
if (inst._zod.traits.has("$ZodCheck")) {
|
|
@@ -308,8 +792,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
308
792
|
throw new $ZodAsyncError();
|
|
309
793
|
}
|
|
310
794
|
if (asyncResult || _6 instanceof Promise) {
|
|
311
|
-
asyncResult = asyncResult ?? Promise.resolve()
|
|
312
|
-
asyncResult.then(async () => {
|
|
795
|
+
asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
|
|
313
796
|
await _6;
|
|
314
797
|
const nextLen = payload.issues.length;
|
|
315
798
|
if (nextLen === currLen)
|
|
@@ -342,23 +825,23 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
342
825
|
return runChecks(result, checks, ctx);
|
|
343
826
|
};
|
|
344
827
|
}
|
|
345
|
-
|
|
828
|
+
inst["~standard"] = {
|
|
346
829
|
validate: (value) => {
|
|
347
830
|
const result = inst._zod.run({ value, issues: [] }, {});
|
|
348
831
|
if (result instanceof Promise) {
|
|
349
832
|
return result.then(({ issues, value: value2 }) => {
|
|
350
833
|
if (issues.length === 0)
|
|
351
834
|
return { value: value2 };
|
|
352
|
-
return { issues };
|
|
835
|
+
return { issues: issues.map((iss) => finalizeIssue(iss, {}, config())) };
|
|
353
836
|
});
|
|
354
837
|
}
|
|
355
838
|
if (result.issues.length === 0)
|
|
356
839
|
return { value: result.value };
|
|
357
|
-
return { issues: result.issues };
|
|
840
|
+
return { issues: result.issues.map((iss) => finalizeIssue(iss, {}, config())) };
|
|
358
841
|
},
|
|
359
842
|
vendor: "zod",
|
|
360
843
|
version: 1
|
|
361
|
-
}
|
|
844
|
+
};
|
|
362
845
|
});
|
|
363
846
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
364
847
|
$ZodType.init(inst, def);
|
|
@@ -469,7 +952,6 @@ function handleOptionalObjectResult(result, final, key, input) {
|
|
|
469
952
|
}
|
|
470
953
|
var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def) => {
|
|
471
954
|
$ZodType.init(inst, def);
|
|
472
|
-
defineLazy(inst._zod, "shape", () => def.shape);
|
|
473
955
|
const _normalized = cached(() => {
|
|
474
956
|
const keys = Object.keys(def.shape);
|
|
475
957
|
return {
|
|
@@ -567,7 +1049,9 @@ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def)
|
|
|
567
1049
|
const fastEnabled = allowsEval.value;
|
|
568
1050
|
const isObject2 = isObject;
|
|
569
1051
|
const { catchall } = def;
|
|
1052
|
+
let value;
|
|
570
1053
|
inst._zod.parse = (payload, ctx) => {
|
|
1054
|
+
value ?? (value = _normalized.value);
|
|
571
1055
|
const input = payload.value;
|
|
572
1056
|
if (!isObject2(input)) {
|
|
573
1057
|
payload.issues.push({
|
|
@@ -585,7 +1069,7 @@ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def)
|
|
|
585
1069
|
payload = fastpass(payload, ctx);
|
|
586
1070
|
} else {
|
|
587
1071
|
payload.value = {};
|
|
588
|
-
const { keys, shape, optionalKeys } =
|
|
1072
|
+
const { keys, shape, optionalKeys } = value;
|
|
589
1073
|
for (const key of keys) {
|
|
590
1074
|
const valueSchema = shape[key];
|
|
591
1075
|
const r = valueSchema._zod.run({ value: input[key], issues: [] }, ctx);
|
|
@@ -605,14 +1089,17 @@ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def)
|
|
|
605
1089
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
606
1090
|
}
|
|
607
1091
|
const unrecognized = [];
|
|
1092
|
+
const keySet = value.keySet;
|
|
1093
|
+
const _catchall = catchall._zod;
|
|
1094
|
+
const t = _catchall.def.type;
|
|
608
1095
|
for (const key of Object.keys(input)) {
|
|
609
|
-
if (
|
|
1096
|
+
if (keySet.has(key))
|
|
610
1097
|
continue;
|
|
611
|
-
if (
|
|
1098
|
+
if (t === "never") {
|
|
612
1099
|
unrecognized.push(key);
|
|
613
1100
|
continue;
|
|
614
1101
|
}
|
|
615
|
-
const r =
|
|
1102
|
+
const r = _catchall.run({ value: input[key], issues: [] }, ctx);
|
|
616
1103
|
if (r instanceof Promise) {
|
|
617
1104
|
proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
|
|
618
1105
|
} else {
|
|
@@ -653,7 +1140,7 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
653
1140
|
};
|
|
654
1141
|
});
|
|
655
1142
|
|
|
656
|
-
// ../../node_modules/.pnpm/@zod+core@0.1
|
|
1143
|
+
// ../../node_modules/.pnpm/@zod+core@0.5.1/node_modules/@zod/core/dist/esm/api.js
|
|
657
1144
|
function _string(Class, params) {
|
|
658
1145
|
return new Class({
|
|
659
1146
|
type: "string",
|
|
@@ -673,7 +1160,7 @@ function _unknown(Class, params) {
|
|
|
673
1160
|
});
|
|
674
1161
|
}
|
|
675
1162
|
|
|
676
|
-
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.
|
|
1163
|
+
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.20250415T232143_a6e9e9ac6408e2c9467a9c53ed9f86b4/node_modules/@zod/mini/dist/esm/parse.js
|
|
677
1164
|
var parse2 = /* @__PURE__ */ _parse.bind({ Error: $ZodError });
|
|
678
1165
|
var safeParse = /* @__PURE__ */ _safeParse.bind({ Error: $ZodError });
|
|
679
1166
|
var parseAsync2 = /* @__PURE__ */ _parseAsync.bind({ Error: $ZodError });
|
|
@@ -681,7 +1168,7 @@ var safeParseAsync = /* @__PURE__ */ _safeParseAsync.bind({
|
|
|
681
1168
|
Error: $ZodError
|
|
682
1169
|
});
|
|
683
1170
|
|
|
684
|
-
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.
|
|
1171
|
+
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.20250415T232143_a6e9e9ac6408e2c9467a9c53ed9f86b4/node_modules/@zod/mini/dist/esm/schemas.js
|
|
685
1172
|
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
686
1173
|
if (!inst._zod)
|
|
687
1174
|
throw new Error("Uninitialized schema in mixin ZodMiniType.");
|
|
@@ -739,7 +1226,7 @@ function array(element, params) {
|
|
|
739
1226
|
// get element() {
|
|
740
1227
|
// return element;
|
|
741
1228
|
// },
|
|
742
|
-
...normalizeParams(params)
|
|
1229
|
+
...util_exports.normalizeParams(params)
|
|
743
1230
|
});
|
|
744
1231
|
}
|
|
745
1232
|
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
@@ -751,9 +1238,9 @@ function object(shape, params) {
|
|
|
751
1238
|
type: "object",
|
|
752
1239
|
shape: shape ?? {},
|
|
753
1240
|
get optional() {
|
|
754
|
-
return optionalObjectKeys(shape ?? {});
|
|
1241
|
+
return util_exports.optionalObjectKeys(shape ?? {});
|
|
755
1242
|
},
|
|
756
|
-
...normalizeParams(params)
|
|
1243
|
+
...util_exports.normalizeParams(params)
|
|
757
1244
|
};
|
|
758
1245
|
return new ZodMiniObject(def);
|
|
759
1246
|
}
|
|
@@ -765,7 +1252,7 @@ function optional(innerType, params) {
|
|
|
765
1252
|
return new ZodMiniOptional({
|
|
766
1253
|
type: "optional",
|
|
767
1254
|
innerType,
|
|
768
|
-
...normalizeParams(params)
|
|
1255
|
+
...util_exports.normalizeParams(params)
|
|
769
1256
|
});
|
|
770
1257
|
}
|
|
771
1258
|
|
|
@@ -1168,10 +1655,10 @@ function isFunctionOfUseEffectSetup(node) {
|
|
|
1168
1655
|
function isFunctionOfUseEffectCleanup(node) {
|
|
1169
1656
|
if (node == null) return false;
|
|
1170
1657
|
const pReturn = AST9.findParentNode(node, AST9.is(AST_NODE_TYPES.ReturnStatement));
|
|
1171
|
-
const
|
|
1658
|
+
const pFunction = AST9.findParentNode(node, AST9.isFunction);
|
|
1172
1659
|
const pFunctionOfReturn = AST9.findParentNode(pReturn, AST9.isFunction);
|
|
1173
|
-
if (
|
|
1174
|
-
return isFunctionOfUseEffectSetup(
|
|
1660
|
+
if (pFunction !== pFunctionOfReturn) return false;
|
|
1661
|
+
return isFunctionOfUseEffectSetup(pFunction);
|
|
1175
1662
|
}
|
|
1176
1663
|
function stringifyJsx(node) {
|
|
1177
1664
|
switch (node.type) {
|