@eslint-react/core 1.47.2-next.0 → 1.47.3-beta.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 +19 -505
- package/dist/index.mjs +19 -505
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -33,13 +33,9 @@ var AST8__namespace = /*#__PURE__*/_interopNamespace(AST8);
|
|
|
33
33
|
var VAR3__namespace = /*#__PURE__*/_interopNamespace(VAR3);
|
|
34
34
|
var birecord__default = /*#__PURE__*/_interopDefault(birecord);
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
-
};
|
|
36
|
+
// src/component/component-collector.ts
|
|
41
37
|
|
|
42
|
-
// ../../node_modules/.pnpm/@zod+core@0.
|
|
38
|
+
// ../../node_modules/.pnpm/@zod+core@0.1.0/node_modules/@zod/core/dist/esm/core.js
|
|
43
39
|
// @__NO_SIDE_EFFECTS__
|
|
44
40
|
function $constructor(name, initializer) {
|
|
45
41
|
class _6 {
|
|
@@ -80,87 +76,6 @@ var globalConfig = {};
|
|
|
80
76
|
function config(config2) {
|
|
81
77
|
return globalConfig;
|
|
82
78
|
}
|
|
83
|
-
|
|
84
|
-
// ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/util.js
|
|
85
|
-
var util_exports = {};
|
|
86
|
-
__export(util_exports, {
|
|
87
|
-
BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
|
|
88
|
-
NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES,
|
|
89
|
-
aborted: () => aborted,
|
|
90
|
-
allowsEval: () => allowsEval,
|
|
91
|
-
assert: () => assert,
|
|
92
|
-
assertEqual: () => assertEqual,
|
|
93
|
-
assertIs: () => assertIs,
|
|
94
|
-
assertNever: () => assertNever,
|
|
95
|
-
assertNotEqual: () => assertNotEqual,
|
|
96
|
-
assignProp: () => assignProp,
|
|
97
|
-
cached: () => cached,
|
|
98
|
-
cleanInterfaceKey: () => cleanInterfaceKey,
|
|
99
|
-
cleanInterfaceShape: () => cleanInterfaceShape,
|
|
100
|
-
cleanRegex: () => cleanRegex,
|
|
101
|
-
clone: () => clone,
|
|
102
|
-
createTransparentProxy: () => createTransparentProxy,
|
|
103
|
-
defineLazy: () => defineLazy,
|
|
104
|
-
esc: () => esc,
|
|
105
|
-
escapeRegex: () => escapeRegex,
|
|
106
|
-
extend: () => extend,
|
|
107
|
-
extendObjectLike: () => extendObjectLike,
|
|
108
|
-
finalizeIssue: () => finalizeIssue,
|
|
109
|
-
floatSafeRemainder: () => floatSafeRemainder,
|
|
110
|
-
getElementAtPath: () => getElementAtPath,
|
|
111
|
-
getLengthableOrigin: () => getLengthableOrigin,
|
|
112
|
-
getParsedType: () => getParsedType,
|
|
113
|
-
getSizableOrigin: () => getSizableOrigin,
|
|
114
|
-
getValidEnumValues: () => getValidEnumValues,
|
|
115
|
-
isObject: () => isObject,
|
|
116
|
-
isPlainObject: () => isPlainObject,
|
|
117
|
-
issue: () => issue,
|
|
118
|
-
joinValues: () => joinValues,
|
|
119
|
-
jsonStringifyReplacer: () => jsonStringifyReplacer,
|
|
120
|
-
mergeObjectLike: () => mergeObjectLike,
|
|
121
|
-
normalizeObjectLikeDef: () => normalizeObjectLikeDef,
|
|
122
|
-
normalizeParams: () => normalizeParams,
|
|
123
|
-
nullish: () => nullish,
|
|
124
|
-
numKeys: () => numKeys,
|
|
125
|
-
omit: () => omit,
|
|
126
|
-
optionalInterfaceKeys: () => optionalInterfaceKeys,
|
|
127
|
-
optionalObjectKeys: () => optionalObjectKeys,
|
|
128
|
-
partialObjectLike: () => partialObjectLike,
|
|
129
|
-
pick: () => pick,
|
|
130
|
-
prefixIssues: () => prefixIssues,
|
|
131
|
-
primitiveTypes: () => primitiveTypes,
|
|
132
|
-
promiseAllObject: () => promiseAllObject,
|
|
133
|
-
propertyKeyTypes: () => propertyKeyTypes,
|
|
134
|
-
randomString: () => randomString,
|
|
135
|
-
requiredObjectLike: () => requiredObjectLike,
|
|
136
|
-
splitChecksAndParams: () => splitChecksAndParams,
|
|
137
|
-
stringifyPrimitive: () => stringifyPrimitive,
|
|
138
|
-
unwrapMessage: () => unwrapMessage
|
|
139
|
-
});
|
|
140
|
-
function assertEqual(val) {
|
|
141
|
-
return val;
|
|
142
|
-
}
|
|
143
|
-
function assertNotEqual(val) {
|
|
144
|
-
return val;
|
|
145
|
-
}
|
|
146
|
-
function assertIs(_arg) {
|
|
147
|
-
}
|
|
148
|
-
function assertNever(_x) {
|
|
149
|
-
throw new Error();
|
|
150
|
-
}
|
|
151
|
-
function assert(_6) {
|
|
152
|
-
}
|
|
153
|
-
function getValidEnumValues(obj) {
|
|
154
|
-
const validKeys = Object.keys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
155
|
-
const filtered = {};
|
|
156
|
-
for (const k of validKeys) {
|
|
157
|
-
filtered[k] = obj[k];
|
|
158
|
-
}
|
|
159
|
-
return Object.values(filtered);
|
|
160
|
-
}
|
|
161
|
-
function joinValues(array2, separator = "|") {
|
|
162
|
-
return array2.map((val) => stringifyPrimitive(val)).join(separator);
|
|
163
|
-
}
|
|
164
79
|
function jsonStringifyReplacer(_6, value) {
|
|
165
80
|
if (typeof value === "bigint")
|
|
166
81
|
return value.toString();
|
|
@@ -177,22 +92,11 @@ function cached(getter) {
|
|
|
177
92
|
}
|
|
178
93
|
};
|
|
179
94
|
}
|
|
180
|
-
function nullish(input) {
|
|
181
|
-
return input === null || input === void 0;
|
|
182
|
-
}
|
|
183
95
|
function cleanRegex(source) {
|
|
184
96
|
const start = source.startsWith("^") ? 1 : 0;
|
|
185
97
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
186
98
|
return source.slice(start, end);
|
|
187
99
|
}
|
|
188
|
-
function floatSafeRemainder(val, step) {
|
|
189
|
-
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
190
|
-
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
191
|
-
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
192
|
-
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
193
|
-
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
194
|
-
return valInt % stepInt / 10 ** decCount;
|
|
195
|
-
}
|
|
196
100
|
function defineLazy(object2, key, getter) {
|
|
197
101
|
Object.defineProperty(object2, key, {
|
|
198
102
|
get() {
|
|
@@ -211,30 +115,6 @@ function defineLazy(object2, key, getter) {
|
|
|
211
115
|
configurable: true
|
|
212
116
|
});
|
|
213
117
|
}
|
|
214
|
-
function assignProp(target, prop, value) {
|
|
215
|
-
Object.defineProperty(target, prop, {
|
|
216
|
-
value,
|
|
217
|
-
writable: true,
|
|
218
|
-
enumerable: true,
|
|
219
|
-
configurable: true
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
function getElementAtPath(obj, path) {
|
|
223
|
-
if (!path)
|
|
224
|
-
return obj;
|
|
225
|
-
return path.reduce((acc, key) => acc?.[key], obj);
|
|
226
|
-
}
|
|
227
|
-
function promiseAllObject(promisesObj) {
|
|
228
|
-
const keys = Object.keys(promisesObj);
|
|
229
|
-
const promises = keys.map((key) => promisesObj[key]);
|
|
230
|
-
return Promise.all(promises).then((results) => {
|
|
231
|
-
const resolvedObj = {};
|
|
232
|
-
for (let i = 0; i < keys.length; i++) {
|
|
233
|
-
resolvedObj[keys[i]] = results[i];
|
|
234
|
-
}
|
|
235
|
-
return resolvedObj;
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
118
|
function randomString(length = 10) {
|
|
239
119
|
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
240
120
|
let str = "";
|
|
@@ -257,78 +137,9 @@ var allowsEval = cached(() => {
|
|
|
257
137
|
return false;
|
|
258
138
|
}
|
|
259
139
|
});
|
|
260
|
-
function isPlainObject(data) {
|
|
261
|
-
return typeof data === "object" && data !== null && Object.getPrototypeOf(data) === Object.prototype;
|
|
262
|
-
}
|
|
263
|
-
function numKeys(data) {
|
|
264
|
-
let keyCount = 0;
|
|
265
|
-
for (const key in data) {
|
|
266
|
-
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
267
|
-
keyCount++;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return keyCount;
|
|
271
|
-
}
|
|
272
|
-
var getParsedType = (data) => {
|
|
273
|
-
const t = typeof data;
|
|
274
|
-
switch (t) {
|
|
275
|
-
case "undefined":
|
|
276
|
-
return "undefined";
|
|
277
|
-
case "string":
|
|
278
|
-
return "string";
|
|
279
|
-
case "number":
|
|
280
|
-
return Number.isNaN(data) ? "nan" : "number";
|
|
281
|
-
case "boolean":
|
|
282
|
-
return "boolean";
|
|
283
|
-
case "function":
|
|
284
|
-
return "function";
|
|
285
|
-
case "bigint":
|
|
286
|
-
return "bigint";
|
|
287
|
-
case "symbol":
|
|
288
|
-
return "symbol";
|
|
289
|
-
case "object":
|
|
290
|
-
if (Array.isArray(data)) {
|
|
291
|
-
return "array";
|
|
292
|
-
}
|
|
293
|
-
if (data === null) {
|
|
294
|
-
return "null";
|
|
295
|
-
}
|
|
296
|
-
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
297
|
-
return "promise";
|
|
298
|
-
}
|
|
299
|
-
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
300
|
-
return "map";
|
|
301
|
-
}
|
|
302
|
-
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
303
|
-
return "set";
|
|
304
|
-
}
|
|
305
|
-
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
306
|
-
return "date";
|
|
307
|
-
}
|
|
308
|
-
if (typeof File !== "undefined" && data instanceof File) {
|
|
309
|
-
return "file";
|
|
310
|
-
}
|
|
311
|
-
return "object";
|
|
312
|
-
default:
|
|
313
|
-
throw new Error(`Unknown data type: ${t}`);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
317
|
-
var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
|
|
318
|
-
function escapeRegex(str) {
|
|
319
|
-
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
320
|
-
}
|
|
321
140
|
function clone(inst, def) {
|
|
322
141
|
return new inst._zod.constr(def);
|
|
323
142
|
}
|
|
324
|
-
function splitChecksAndParams(_paramsOrChecks, _checks) {
|
|
325
|
-
const params = Array.isArray(_paramsOrChecks) ? {} : _paramsOrChecks ?? {};
|
|
326
|
-
const checks = Array.isArray(_paramsOrChecks) ? _paramsOrChecks : _checks ?? [];
|
|
327
|
-
return {
|
|
328
|
-
checks,
|
|
329
|
-
params
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
143
|
function normalizeParams(_params) {
|
|
333
144
|
const params = _params;
|
|
334
145
|
if (!params)
|
|
@@ -345,267 +156,11 @@ function normalizeParams(_params) {
|
|
|
345
156
|
return { ...params, error: () => params.error };
|
|
346
157
|
return params;
|
|
347
158
|
}
|
|
348
|
-
function createTransparentProxy(getter) {
|
|
349
|
-
let target;
|
|
350
|
-
return new Proxy({}, {
|
|
351
|
-
get(_6, prop, receiver) {
|
|
352
|
-
target ?? (target = getter());
|
|
353
|
-
return Reflect.get(target, prop, receiver);
|
|
354
|
-
},
|
|
355
|
-
set(_6, prop, value, receiver) {
|
|
356
|
-
target ?? (target = getter());
|
|
357
|
-
return Reflect.set(target, prop, value, receiver);
|
|
358
|
-
},
|
|
359
|
-
has(_6, prop) {
|
|
360
|
-
target ?? (target = getter());
|
|
361
|
-
return Reflect.has(target, prop);
|
|
362
|
-
},
|
|
363
|
-
deleteProperty(_6, prop) {
|
|
364
|
-
target ?? (target = getter());
|
|
365
|
-
return Reflect.deleteProperty(target, prop);
|
|
366
|
-
},
|
|
367
|
-
ownKeys(_6) {
|
|
368
|
-
target ?? (target = getter());
|
|
369
|
-
return Reflect.ownKeys(target);
|
|
370
|
-
},
|
|
371
|
-
getOwnPropertyDescriptor(_6, prop) {
|
|
372
|
-
target ?? (target = getter());
|
|
373
|
-
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
374
|
-
},
|
|
375
|
-
defineProperty(_6, prop, descriptor) {
|
|
376
|
-
target ?? (target = getter());
|
|
377
|
-
return Reflect.defineProperty(target, prop, descriptor);
|
|
378
|
-
}
|
|
379
|
-
// apply(target, thisArg, args) {
|
|
380
|
-
// return Reflect.apply(target, thisArg, args);
|
|
381
|
-
// },
|
|
382
|
-
// construct(target, args, newTarget) {
|
|
383
|
-
// return Reflect.construct(target, args, newTarget);
|
|
384
|
-
// },
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
function stringifyPrimitive(value) {
|
|
388
|
-
if (typeof value === "bigint")
|
|
389
|
-
return value.toString() + "n";
|
|
390
|
-
if (typeof value === "string")
|
|
391
|
-
return `"${value}"`;
|
|
392
|
-
return `${value}`;
|
|
393
|
-
}
|
|
394
159
|
function optionalObjectKeys(shape) {
|
|
395
160
|
return Object.keys(shape).filter((k) => {
|
|
396
161
|
return shape[k]._zod.qout === "true";
|
|
397
162
|
});
|
|
398
163
|
}
|
|
399
|
-
function optionalInterfaceKeys(shape) {
|
|
400
|
-
return Object.keys(shape).filter((k) => {
|
|
401
|
-
return k.endsWith("?");
|
|
402
|
-
}).map((k) => k.replace(/\?$/, ""));
|
|
403
|
-
}
|
|
404
|
-
function cleanInterfaceKey(key) {
|
|
405
|
-
return key.replace(/^\?/, "").replace(/\?$/, "");
|
|
406
|
-
}
|
|
407
|
-
function cleanInterfaceShape(_shape) {
|
|
408
|
-
const keyMap = {};
|
|
409
|
-
const shape = {};
|
|
410
|
-
const optional2 = [];
|
|
411
|
-
const defaulted = [];
|
|
412
|
-
for (const [key, value] of Object.entries(_shape)) {
|
|
413
|
-
if (key.endsWith("?"))
|
|
414
|
-
optional2.push(key.slice(0, -1));
|
|
415
|
-
if (key.startsWith("?"))
|
|
416
|
-
defaulted.push(key.slice(1));
|
|
417
|
-
const cleanKey = cleanInterfaceKey(key);
|
|
418
|
-
shape[cleanKey] = value;
|
|
419
|
-
keyMap[cleanKey] = key;
|
|
420
|
-
}
|
|
421
|
-
return { shape, keyMap, optional: optional2, defaulted };
|
|
422
|
-
}
|
|
423
|
-
var NUMBER_FORMAT_RANGES = {
|
|
424
|
-
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
425
|
-
int32: [-2147483648, 2147483647],
|
|
426
|
-
uint32: [0, 4294967295],
|
|
427
|
-
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
428
|
-
float64: [-17976931348623157e292, 17976931348623157e292]
|
|
429
|
-
};
|
|
430
|
-
var BIGINT_FORMAT_RANGES = {
|
|
431
|
-
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
432
|
-
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
433
|
-
};
|
|
434
|
-
function pick(schema, mask) {
|
|
435
|
-
const newShape = {};
|
|
436
|
-
const newOptional = [];
|
|
437
|
-
const currShape = schema._zod.def.shape;
|
|
438
|
-
const currOptional = new Set(schema._zod.def.optional);
|
|
439
|
-
for (const key in mask) {
|
|
440
|
-
if (!(key in currShape)) {
|
|
441
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
442
|
-
}
|
|
443
|
-
if (!mask[key])
|
|
444
|
-
continue;
|
|
445
|
-
newShape[key] = currShape[key];
|
|
446
|
-
if (currOptional.has(key)) {
|
|
447
|
-
newOptional.push(key);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
return clone(schema, {
|
|
451
|
-
...schema._zod.def,
|
|
452
|
-
shape: newShape,
|
|
453
|
-
optional: newOptional,
|
|
454
|
-
checks: []
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
function omit(schema, mask) {
|
|
458
|
-
const newShape = { ...schema._zod.def.shape };
|
|
459
|
-
const newOptional = new Set(schema._zod.def.optional);
|
|
460
|
-
for (const key in mask) {
|
|
461
|
-
if (!(key in schema._zod.def.shape)) {
|
|
462
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
463
|
-
}
|
|
464
|
-
if (!mask[key])
|
|
465
|
-
continue;
|
|
466
|
-
delete newShape[key];
|
|
467
|
-
newOptional.delete(key);
|
|
468
|
-
}
|
|
469
|
-
return clone(schema, {
|
|
470
|
-
...schema._zod.def,
|
|
471
|
-
shape: newShape,
|
|
472
|
-
optional: [...newOptional],
|
|
473
|
-
checks: []
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
function extend(schema, shape) {
|
|
477
|
-
const def = {
|
|
478
|
-
...schema._zod.def,
|
|
479
|
-
get shape() {
|
|
480
|
-
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
481
|
-
assignProp(this, "shape", _shape);
|
|
482
|
-
return _shape;
|
|
483
|
-
},
|
|
484
|
-
checks: []
|
|
485
|
-
// delete existing checks
|
|
486
|
-
};
|
|
487
|
-
defineLazy(def, "shape", () => ({ ...schema._zod.def.shape, ...shape }));
|
|
488
|
-
return clone(schema, def);
|
|
489
|
-
}
|
|
490
|
-
function mergeObjectLike(a, b) {
|
|
491
|
-
const bKeys = new Set(Object.keys(b._zod.def.shape));
|
|
492
|
-
const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
|
|
493
|
-
return clone(a, {
|
|
494
|
-
...a._zod.def,
|
|
495
|
-
get shape() {
|
|
496
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
497
|
-
assignProp(this, "shape", _shape);
|
|
498
|
-
return _shape;
|
|
499
|
-
},
|
|
500
|
-
optional: optional2,
|
|
501
|
-
catchall: b._zod.def.catchall,
|
|
502
|
-
checks: []
|
|
503
|
-
// delete existing checks
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
function extendObjectLike(a, b) {
|
|
507
|
-
const bKeys = new Set(Object.keys(b._zod.def.shape));
|
|
508
|
-
const optional2 = [...a._zod.def.optional.filter((k) => !bKeys.has(k)), ...b._zod.def.optional];
|
|
509
|
-
return clone(a, {
|
|
510
|
-
...a._zod.def,
|
|
511
|
-
get shape() {
|
|
512
|
-
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
513
|
-
assignProp(this, "shape", _shape);
|
|
514
|
-
return _shape;
|
|
515
|
-
},
|
|
516
|
-
optional: optional2,
|
|
517
|
-
checks: []
|
|
518
|
-
// delete existent checks
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
function partialObjectLike(Class, schema, mask) {
|
|
522
|
-
const shape = { ...schema._zod.def.shape };
|
|
523
|
-
const optional2 = new Set(schema._zod.def.optional);
|
|
524
|
-
if (mask) {
|
|
525
|
-
for (const key in mask) {
|
|
526
|
-
if (!(key in shape)) {
|
|
527
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
528
|
-
}
|
|
529
|
-
if (!mask[key])
|
|
530
|
-
continue;
|
|
531
|
-
shape[key] = new Class({
|
|
532
|
-
type: "optional",
|
|
533
|
-
innerType: schema._zod.def.shape[key]
|
|
534
|
-
});
|
|
535
|
-
optional2.add(key);
|
|
536
|
-
}
|
|
537
|
-
} else {
|
|
538
|
-
for (const key in schema._zod.def.shape) {
|
|
539
|
-
shape[key] = new Class({
|
|
540
|
-
type: "optional",
|
|
541
|
-
innerType: schema._zod.def.shape[key]
|
|
542
|
-
});
|
|
543
|
-
optional2.add(key);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return clone(schema, {
|
|
547
|
-
...schema._zod.def,
|
|
548
|
-
shape,
|
|
549
|
-
optional: [...optional2],
|
|
550
|
-
checks: []
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
function requiredObjectLike(Class, schema, mask) {
|
|
554
|
-
const shape = { ...schema._zod.def.shape };
|
|
555
|
-
if (mask) {
|
|
556
|
-
for (const key in mask) {
|
|
557
|
-
if (!(key in shape)) {
|
|
558
|
-
throw new Error(`Unrecognized key: "${key}"`);
|
|
559
|
-
}
|
|
560
|
-
if (!mask[key])
|
|
561
|
-
continue;
|
|
562
|
-
shape[key] = new Class({
|
|
563
|
-
type: "nonoptional",
|
|
564
|
-
innerType: schema._zod.def.shape[key]
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
} else {
|
|
568
|
-
for (const key in schema._zod.def.shape) {
|
|
569
|
-
shape[key] = new Class({
|
|
570
|
-
type: "nonoptional",
|
|
571
|
-
innerType: schema._zod.def.shape[key]
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
return clone(schema, {
|
|
576
|
-
...schema._zod.def,
|
|
577
|
-
shape,
|
|
578
|
-
optional: [],
|
|
579
|
-
checks: []
|
|
580
|
-
});
|
|
581
|
-
}
|
|
582
|
-
function normalizeObjectLikeDef(def) {
|
|
583
|
-
if (def.type === "interface") {
|
|
584
|
-
const keys = Object.keys(def.shape);
|
|
585
|
-
const keySet = new Set(Object.keys(def.shape));
|
|
586
|
-
return {
|
|
587
|
-
shape: { ...def.shape },
|
|
588
|
-
// resolve getters
|
|
589
|
-
keys,
|
|
590
|
-
keySet,
|
|
591
|
-
numKeys: keys.length,
|
|
592
|
-
optionalKeys: new Set(def.optional)
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
if (def.type === "object") {
|
|
596
|
-
const keys = Object.keys(def.shape);
|
|
597
|
-
const keySet = new Set(Object.keys(def.shape));
|
|
598
|
-
return {
|
|
599
|
-
shape: { ...def.shape },
|
|
600
|
-
// resolve getters
|
|
601
|
-
keys,
|
|
602
|
-
keySet,
|
|
603
|
-
numKeys: keys.length,
|
|
604
|
-
optionalKeys: new Set(def.optional)
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
throw new Error("Invalid object-like type");
|
|
608
|
-
}
|
|
609
164
|
function aborted(x, startIndex = 0) {
|
|
610
165
|
for (let i = startIndex; i < x.issues.length; i++) {
|
|
611
166
|
if (x.issues[i].continue !== true)
|
|
@@ -637,36 +192,8 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
637
192
|
}
|
|
638
193
|
return full;
|
|
639
194
|
}
|
|
640
|
-
function getSizableOrigin(input) {
|
|
641
|
-
if (input instanceof Set)
|
|
642
|
-
return "set";
|
|
643
|
-
if (input instanceof Map)
|
|
644
|
-
return "map";
|
|
645
|
-
if (input instanceof File)
|
|
646
|
-
return "file";
|
|
647
|
-
return "unknown";
|
|
648
|
-
}
|
|
649
|
-
function getLengthableOrigin(input) {
|
|
650
|
-
if (Array.isArray(input))
|
|
651
|
-
return "array";
|
|
652
|
-
if (typeof input === "string")
|
|
653
|
-
return "string";
|
|
654
|
-
return "unknown";
|
|
655
|
-
}
|
|
656
|
-
function issue(...args) {
|
|
657
|
-
const [iss, input, inst] = args;
|
|
658
|
-
if (typeof iss === "string") {
|
|
659
|
-
return {
|
|
660
|
-
message: iss,
|
|
661
|
-
code: "custom",
|
|
662
|
-
input,
|
|
663
|
-
inst
|
|
664
|
-
};
|
|
665
|
-
}
|
|
666
|
-
return { ...iss };
|
|
667
|
-
}
|
|
668
195
|
|
|
669
|
-
// ../../node_modules/.pnpm/@zod+core@0.
|
|
196
|
+
// ../../node_modules/.pnpm/@zod+core@0.1.0/node_modules/@zod/core/dist/esm/errors.js
|
|
670
197
|
var ZOD_ERROR = Symbol.for("{{zod.error}}");
|
|
671
198
|
var $ZodError = class {
|
|
672
199
|
get message() {
|
|
@@ -683,7 +210,7 @@ var $ZodError = class {
|
|
|
683
210
|
}
|
|
684
211
|
};
|
|
685
212
|
|
|
686
|
-
// ../../node_modules/.pnpm/@zod+core@0.
|
|
213
|
+
// ../../node_modules/.pnpm/@zod+core@0.1.0/node_modules/@zod/core/dist/esm/parse.js
|
|
687
214
|
function _parse(schema, value, _ctx) {
|
|
688
215
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
689
216
|
const result = schema._zod.run({ value, issues: [] }, ctx);
|
|
@@ -735,7 +262,7 @@ var string = (params) => {
|
|
|
735
262
|
};
|
|
736
263
|
var boolean = /true|false/i;
|
|
737
264
|
|
|
738
|
-
// ../../node_modules/.pnpm/@zod+core@0.
|
|
265
|
+
// ../../node_modules/.pnpm/@zod+core@0.1.0/node_modules/@zod/core/dist/esm/doc.js
|
|
739
266
|
var Doc = class {
|
|
740
267
|
constructor(args) {
|
|
741
268
|
this.content = [];
|
|
@@ -767,21 +294,13 @@ var Doc = class {
|
|
|
767
294
|
}
|
|
768
295
|
};
|
|
769
296
|
|
|
770
|
-
// ../../node_modules/.pnpm/@zod+core@0.
|
|
771
|
-
var version = {
|
|
772
|
-
major: 0,
|
|
773
|
-
minor: 3,
|
|
774
|
-
patch: 3
|
|
775
|
-
};
|
|
776
|
-
|
|
777
|
-
// ../../node_modules/.pnpm/@zod+core@0.3.3/node_modules/@zod/core/dist/esm/schemas.js
|
|
297
|
+
// ../../node_modules/.pnpm/@zod+core@0.1.0/node_modules/@zod/core/dist/esm/schemas.js
|
|
778
298
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
779
299
|
var _a;
|
|
780
300
|
inst ?? (inst = {});
|
|
781
301
|
inst._zod.id = def.type + "_" + randomString(10);
|
|
782
302
|
inst._zod.def = def;
|
|
783
303
|
inst._zod.computed = inst._zod.computed || {};
|
|
784
|
-
inst._zod.version = version;
|
|
785
304
|
const checks = [...inst._zod.def.checks ?? []];
|
|
786
305
|
def.type;
|
|
787
306
|
if (inst._zod.traits.has("$ZodCheck")) {
|
|
@@ -849,7 +368,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
849
368
|
return runChecks(result, checks, ctx);
|
|
850
369
|
};
|
|
851
370
|
}
|
|
852
|
-
inst
|
|
371
|
+
defineLazy(inst, "~standard", () => ({
|
|
853
372
|
validate: (value) => {
|
|
854
373
|
const result = inst._zod.run({ value, issues: [] }, {});
|
|
855
374
|
if (result instanceof Promise) {
|
|
@@ -865,7 +384,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
865
384
|
},
|
|
866
385
|
vendor: "zod",
|
|
867
386
|
version: 1
|
|
868
|
-
};
|
|
387
|
+
}));
|
|
869
388
|
});
|
|
870
389
|
var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
|
|
871
390
|
$ZodType.init(inst, def);
|
|
@@ -1070,9 +589,7 @@ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def)
|
|
|
1070
589
|
const fastEnabled = allowsEval.value;
|
|
1071
590
|
const isObject2 = isObject;
|
|
1072
591
|
const { catchall } = def;
|
|
1073
|
-
let value;
|
|
1074
592
|
inst._zod.parse = (payload, ctx) => {
|
|
1075
|
-
value ?? (value = _normalized.value);
|
|
1076
593
|
const input = payload.value;
|
|
1077
594
|
if (!isObject2(input)) {
|
|
1078
595
|
payload.issues.push({
|
|
@@ -1090,7 +607,7 @@ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def)
|
|
|
1090
607
|
payload = fastpass(payload, ctx);
|
|
1091
608
|
} else {
|
|
1092
609
|
payload.value = {};
|
|
1093
|
-
const { keys, shape, optionalKeys } = value;
|
|
610
|
+
const { keys, shape, optionalKeys } = _normalized.value;
|
|
1094
611
|
for (const key of keys) {
|
|
1095
612
|
const valueSchema = shape[key];
|
|
1096
613
|
const r = valueSchema._zod.run({ value: input[key], issues: [] }, ctx);
|
|
@@ -1110,17 +627,14 @@ var $ZodObjectLike = /* @__PURE__ */ $constructor("$ZodObjectLike", (inst, def)
|
|
|
1110
627
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1111
628
|
}
|
|
1112
629
|
const unrecognized = [];
|
|
1113
|
-
const keySet = value.keySet;
|
|
1114
|
-
const _catchall = catchall._zod;
|
|
1115
|
-
const t = _catchall.def.type;
|
|
1116
630
|
for (const key of Object.keys(input)) {
|
|
1117
|
-
if (keySet.has(key))
|
|
631
|
+
if (_normalized.value.keySet.has(key))
|
|
1118
632
|
continue;
|
|
1119
|
-
if (
|
|
633
|
+
if (catchall._zod.def.type === "never") {
|
|
1120
634
|
unrecognized.push(key);
|
|
1121
635
|
continue;
|
|
1122
636
|
}
|
|
1123
|
-
const r =
|
|
637
|
+
const r = catchall._zod.run({ value: input[key], issues: [] }, ctx);
|
|
1124
638
|
if (r instanceof Promise) {
|
|
1125
639
|
proms.push(r.then((r2) => handleObjectResult(r2, payload, key)));
|
|
1126
640
|
} else {
|
|
@@ -1161,7 +675,7 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
1161
675
|
};
|
|
1162
676
|
});
|
|
1163
677
|
|
|
1164
|
-
// ../../node_modules/.pnpm/@zod+core@0.
|
|
678
|
+
// ../../node_modules/.pnpm/@zod+core@0.1.0/node_modules/@zod/core/dist/esm/api.js
|
|
1165
679
|
function _string(Class, params) {
|
|
1166
680
|
return new Class({
|
|
1167
681
|
type: "string",
|
|
@@ -1175,7 +689,7 @@ function _boolean(Class, params) {
|
|
|
1175
689
|
});
|
|
1176
690
|
}
|
|
1177
691
|
|
|
1178
|
-
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.
|
|
692
|
+
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.0/node_modules/@zod/mini/dist/esm/parse.js
|
|
1179
693
|
var parse2 = /* @__PURE__ */ _parse.bind({ Error: $ZodError });
|
|
1180
694
|
var safeParse = /* @__PURE__ */ _safeParse.bind({ Error: $ZodError });
|
|
1181
695
|
var parseAsync2 = /* @__PURE__ */ _parseAsync.bind({ Error: $ZodError });
|
|
@@ -1183,7 +697,7 @@ var safeParseAsync = /* @__PURE__ */ _safeParseAsync.bind({
|
|
|
1183
697
|
Error: $ZodError
|
|
1184
698
|
});
|
|
1185
699
|
|
|
1186
|
-
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.
|
|
700
|
+
// ../../node_modules/.pnpm/@zod+mini@4.0.0-beta.0/node_modules/@zod/mini/dist/esm/schemas.js
|
|
1187
701
|
var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
|
|
1188
702
|
if (!inst._zod)
|
|
1189
703
|
throw new Error("Uninitialized schema in mixin ZodMiniType.");
|
|
@@ -1234,7 +748,7 @@ function array(element, params) {
|
|
|
1234
748
|
// get element() {
|
|
1235
749
|
// return element;
|
|
1236
750
|
// },
|
|
1237
|
-
...
|
|
751
|
+
...normalizeParams(params)
|
|
1238
752
|
});
|
|
1239
753
|
}
|
|
1240
754
|
var ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
|
|
@@ -1246,9 +760,9 @@ function object(shape, params) {
|
|
|
1246
760
|
type: "object",
|
|
1247
761
|
shape: shape ?? {},
|
|
1248
762
|
get optional() {
|
|
1249
|
-
return
|
|
763
|
+
return optionalObjectKeys(shape ?? {});
|
|
1250
764
|
},
|
|
1251
|
-
...
|
|
765
|
+
...normalizeParams(params)
|
|
1252
766
|
};
|
|
1253
767
|
return new ZodMiniObject(def);
|
|
1254
768
|
}
|
|
@@ -1260,7 +774,7 @@ function optional(innerType, params) {
|
|
|
1260
774
|
return new ZodMiniOptional({
|
|
1261
775
|
type: "optional",
|
|
1262
776
|
innerType,
|
|
1263
|
-
...
|
|
777
|
+
...normalizeParams(params)
|
|
1264
778
|
});
|
|
1265
779
|
}
|
|
1266
780
|
|