lkd-web-kit 0.4.8 → 0.4.9

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.
Files changed (132) hide show
  1. package/dist/hooks/useZodConfig.cjs +2 -2
  2. package/dist/hooks/useZodConfig.js +2 -2
  3. package/dist/index.d.ts +2 -2
  4. package/package.json +7 -7
  5. package/dist/node_modules/zod/v4/classic/coerce.cjs +0 -28
  6. package/dist/node_modules/zod/v4/classic/coerce.js +0 -20
  7. package/dist/node_modules/zod/v4/classic/compat.cjs +0 -37
  8. package/dist/node_modules/zod/v4/classic/compat.js +0 -30
  9. package/dist/node_modules/zod/v4/classic/errors.cjs +0 -49
  10. package/dist/node_modules/zod/v4/classic/errors.js +0 -44
  11. package/dist/node_modules/zod/v4/classic/external.cjs +0 -231
  12. package/dist/node_modules/zod/v4/classic/external.js +0 -28
  13. package/dist/node_modules/zod/v4/classic/index.cjs +0 -10
  14. package/dist/node_modules/zod/v4/classic/index.js +0 -5
  15. package/dist/node_modules/zod/v4/classic/iso.cjs +0 -46
  16. package/dist/node_modules/zod/v4/classic/iso.js +0 -35
  17. package/dist/node_modules/zod/v4/classic/parse.cjs +0 -16
  18. package/dist/node_modules/zod/v4/classic/parse.js +0 -9
  19. package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -1155
  20. package/dist/node_modules/zod/v4/classic/schemas.js +0 -1006
  21. package/dist/node_modules/zod/v4/core/api.cjs +0 -1016
  22. package/dist/node_modules/zod/v4/core/api.js +0 -903
  23. package/dist/node_modules/zod/v4/core/checks.cjs +0 -587
  24. package/dist/node_modules/zod/v4/core/checks.js +0 -562
  25. package/dist/node_modules/zod/v4/core/core.cjs +0 -72
  26. package/dist/node_modules/zod/v4/core/core.js +0 -63
  27. package/dist/node_modules/zod/v4/core/doc.cjs +0 -41
  28. package/dist/node_modules/zod/v4/core/doc.js +0 -37
  29. package/dist/node_modules/zod/v4/core/errors.cjs +0 -204
  30. package/dist/node_modules/zod/v4/core/errors.js +0 -194
  31. package/dist/node_modules/zod/v4/core/function.cjs +0 -81
  32. package/dist/node_modules/zod/v4/core/function.js +0 -76
  33. package/dist/node_modules/zod/v4/core/index.cjs +0 -261
  34. package/dist/node_modules/zod/v4/core/index.js +0 -20
  35. package/dist/node_modules/zod/v4/core/json-schema.cjs +0 -2
  36. package/dist/node_modules/zod/v4/core/json-schema.js +0 -1
  37. package/dist/node_modules/zod/v4/core/parse.cjs +0 -71
  38. package/dist/node_modules/zod/v4/core/parse.js +0 -60
  39. package/dist/node_modules/zod/v4/core/regexes.cjs +0 -139
  40. package/dist/node_modules/zod/v4/core/regexes.js +0 -95
  41. package/dist/node_modules/zod/v4/core/registries.cjs +0 -52
  42. package/dist/node_modules/zod/v4/core/registries.js +0 -44
  43. package/dist/node_modules/zod/v4/core/schemas.cjs +0 -1793
  44. package/dist/node_modules/zod/v4/core/schemas.js +0 -1720
  45. package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -823
  46. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -818
  47. package/dist/node_modules/zod/v4/core/util.cjs +0 -543
  48. package/dist/node_modules/zod/v4/core/util.js +0 -491
  49. package/dist/node_modules/zod/v4/core/versions.cjs +0 -11
  50. package/dist/node_modules/zod/v4/core/versions.js +0 -7
  51. package/dist/node_modules/zod/v4/index.cjs +0 -10
  52. package/dist/node_modules/zod/v4/index.js +0 -5
  53. package/dist/node_modules/zod/v4/locales/ar.cjs +0 -121
  54. package/dist/node_modules/zod/v4/locales/ar.js +0 -119
  55. package/dist/node_modules/zod/v4/locales/az.cjs +0 -120
  56. package/dist/node_modules/zod/v4/locales/az.js +0 -118
  57. package/dist/node_modules/zod/v4/locales/be.cjs +0 -169
  58. package/dist/node_modules/zod/v4/locales/be.js +0 -167
  59. package/dist/node_modules/zod/v4/locales/ca.cjs +0 -123
  60. package/dist/node_modules/zod/v4/locales/ca.js +0 -121
  61. package/dist/node_modules/zod/v4/locales/cs.cjs +0 -140
  62. package/dist/node_modules/zod/v4/locales/cs.js +0 -138
  63. package/dist/node_modules/zod/v4/locales/de.cjs +0 -121
  64. package/dist/node_modules/zod/v4/locales/de.js +0 -119
  65. package/dist/node_modules/zod/v4/locales/en.cjs +0 -125
  66. package/dist/node_modules/zod/v4/locales/en.js +0 -120
  67. package/dist/node_modules/zod/v4/locales/eo.cjs +0 -124
  68. package/dist/node_modules/zod/v4/locales/eo.js +0 -119
  69. package/dist/node_modules/zod/v4/locales/es.cjs +0 -122
  70. package/dist/node_modules/zod/v4/locales/es.js +0 -120
  71. package/dist/node_modules/zod/v4/locales/fa.cjs +0 -127
  72. package/dist/node_modules/zod/v4/locales/fa.js +0 -125
  73. package/dist/node_modules/zod/v4/locales/fi.cjs +0 -127
  74. package/dist/node_modules/zod/v4/locales/fi.js +0 -125
  75. package/dist/node_modules/zod/v4/locales/fr-CA.cjs +0 -122
  76. package/dist/node_modules/zod/v4/locales/fr-CA.js +0 -120
  77. package/dist/node_modules/zod/v4/locales/fr.cjs +0 -121
  78. package/dist/node_modules/zod/v4/locales/fr.js +0 -119
  79. package/dist/node_modules/zod/v4/locales/he.cjs +0 -122
  80. package/dist/node_modules/zod/v4/locales/he.js +0 -120
  81. package/dist/node_modules/zod/v4/locales/hu.cjs +0 -122
  82. package/dist/node_modules/zod/v4/locales/hu.js +0 -120
  83. package/dist/node_modules/zod/v4/locales/id.cjs +0 -121
  84. package/dist/node_modules/zod/v4/locales/id.js +0 -119
  85. package/dist/node_modules/zod/v4/locales/index.cjs +0 -85
  86. package/dist/node_modules/zod/v4/locales/index.js +0 -39
  87. package/dist/node_modules/zod/v4/locales/it.cjs +0 -122
  88. package/dist/node_modules/zod/v4/locales/it.js +0 -120
  89. package/dist/node_modules/zod/v4/locales/ja.cjs +0 -120
  90. package/dist/node_modules/zod/v4/locales/ja.js +0 -118
  91. package/dist/node_modules/zod/v4/locales/kh.cjs +0 -122
  92. package/dist/node_modules/zod/v4/locales/kh.js +0 -120
  93. package/dist/node_modules/zod/v4/locales/ko.cjs +0 -126
  94. package/dist/node_modules/zod/v4/locales/ko.js +0 -124
  95. package/dist/node_modules/zod/v4/locales/mk.cjs +0 -123
  96. package/dist/node_modules/zod/v4/locales/mk.js +0 -121
  97. package/dist/node_modules/zod/v4/locales/ms.cjs +0 -121
  98. package/dist/node_modules/zod/v4/locales/ms.js +0 -119
  99. package/dist/node_modules/zod/v4/locales/nl.cjs +0 -122
  100. package/dist/node_modules/zod/v4/locales/nl.js +0 -120
  101. package/dist/node_modules/zod/v4/locales/no.cjs +0 -121
  102. package/dist/node_modules/zod/v4/locales/no.js +0 -119
  103. package/dist/node_modules/zod/v4/locales/ota.cjs +0 -122
  104. package/dist/node_modules/zod/v4/locales/ota.js +0 -120
  105. package/dist/node_modules/zod/v4/locales/pl.cjs +0 -122
  106. package/dist/node_modules/zod/v4/locales/pl.js +0 -120
  107. package/dist/node_modules/zod/v4/locales/ps.cjs +0 -127
  108. package/dist/node_modules/zod/v4/locales/ps.js +0 -125
  109. package/dist/node_modules/zod/v4/locales/pt.cjs +0 -121
  110. package/dist/node_modules/zod/v4/locales/pt.js +0 -119
  111. package/dist/node_modules/zod/v4/locales/ru.cjs +0 -169
  112. package/dist/node_modules/zod/v4/locales/ru.js +0 -167
  113. package/dist/node_modules/zod/v4/locales/sl.cjs +0 -122
  114. package/dist/node_modules/zod/v4/locales/sl.js +0 -120
  115. package/dist/node_modules/zod/v4/locales/sv.cjs +0 -123
  116. package/dist/node_modules/zod/v4/locales/sv.js +0 -121
  117. package/dist/node_modules/zod/v4/locales/ta.cjs +0 -122
  118. package/dist/node_modules/zod/v4/locales/ta.js +0 -120
  119. package/dist/node_modules/zod/v4/locales/th.cjs +0 -122
  120. package/dist/node_modules/zod/v4/locales/th.js +0 -120
  121. package/dist/node_modules/zod/v4/locales/tr.cjs +0 -123
  122. package/dist/node_modules/zod/v4/locales/tr.js +0 -118
  123. package/dist/node_modules/zod/v4/locales/ua.cjs +0 -122
  124. package/dist/node_modules/zod/v4/locales/ua.js +0 -120
  125. package/dist/node_modules/zod/v4/locales/ur.cjs +0 -122
  126. package/dist/node_modules/zod/v4/locales/ur.js +0 -120
  127. package/dist/node_modules/zod/v4/locales/vi.cjs +0 -121
  128. package/dist/node_modules/zod/v4/locales/vi.js +0 -119
  129. package/dist/node_modules/zod/v4/locales/zh-CN.cjs +0 -121
  130. package/dist/node_modules/zod/v4/locales/zh-CN.js +0 -119
  131. package/dist/node_modules/zod/v4/locales/zh-TW.cjs +0 -122
  132. package/dist/node_modules/zod/v4/locales/zh-TW.js +0 -120
@@ -1,543 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
-
5
- // functions
6
- function assertEqual(val) {
7
- return val;
8
- }
9
- function assertNotEqual(val) {
10
- return val;
11
- }
12
- function assertIs(_arg) { }
13
- function assertNever(_x) {
14
- throw new Error();
15
- }
16
- function assert(_) { }
17
- function getEnumValues(entries) {
18
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
19
- const values = Object.entries(entries)
20
- .filter(([k, _]) => numericValues.indexOf(+k) === -1)
21
- .map(([_, v]) => v);
22
- return values;
23
- }
24
- function joinValues(array, separator = "|") {
25
- return array.map((val) => stringifyPrimitive(val)).join(separator);
26
- }
27
- function jsonStringifyReplacer(_, value) {
28
- if (typeof value === "bigint")
29
- return value.toString();
30
- return value;
31
- }
32
- function cached(getter) {
33
- return {
34
- get value() {
35
- {
36
- const value = getter();
37
- Object.defineProperty(this, "value", { value });
38
- return value;
39
- }
40
- },
41
- };
42
- }
43
- function nullish(input) {
44
- return input === null || input === undefined;
45
- }
46
- function cleanRegex(source) {
47
- const start = source.startsWith("^") ? 1 : 0;
48
- const end = source.endsWith("$") ? source.length - 1 : source.length;
49
- return source.slice(start, end);
50
- }
51
- function floatSafeRemainder(val, step) {
52
- const valDecCount = (val.toString().split(".")[1] || "").length;
53
- const stepDecCount = (step.toString().split(".")[1] || "").length;
54
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
55
- const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
56
- const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
57
- return (valInt % stepInt) / 10 ** decCount;
58
- }
59
- function defineLazy(object, key, getter) {
60
- Object.defineProperty(object, key, {
61
- get() {
62
- {
63
- const value = getter();
64
- object[key] = value;
65
- return value;
66
- }
67
- },
68
- set(v) {
69
- Object.defineProperty(object, key, {
70
- value: v,
71
- // configurable: true,
72
- });
73
- // object[key] = v;
74
- },
75
- configurable: true,
76
- });
77
- }
78
- function assignProp(target, prop, value) {
79
- Object.defineProperty(target, prop, {
80
- value,
81
- writable: true,
82
- enumerable: true,
83
- configurable: true,
84
- });
85
- }
86
- function getElementAtPath(obj, path) {
87
- if (!path)
88
- return obj;
89
- return path.reduce((acc, key) => acc?.[key], obj);
90
- }
91
- function promiseAllObject(promisesObj) {
92
- const keys = Object.keys(promisesObj);
93
- const promises = keys.map((key) => promisesObj[key]);
94
- return Promise.all(promises).then((results) => {
95
- const resolvedObj = {};
96
- for (let i = 0; i < keys.length; i++) {
97
- resolvedObj[keys[i]] = results[i];
98
- }
99
- return resolvedObj;
100
- });
101
- }
102
- function randomString(length = 10) {
103
- const chars = "abcdefghijklmnopqrstuvwxyz";
104
- let str = "";
105
- for (let i = 0; i < length; i++) {
106
- str += chars[Math.floor(Math.random() * chars.length)];
107
- }
108
- return str;
109
- }
110
- function esc(str) {
111
- return JSON.stringify(str);
112
- }
113
- const captureStackTrace = Error.captureStackTrace
114
- ? Error.captureStackTrace
115
- : (..._args) => { };
116
- function isObject(data) {
117
- return typeof data === "object" && data !== null && !Array.isArray(data);
118
- }
119
- const allowsEval = cached(() => {
120
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
121
- return false;
122
- }
123
- try {
124
- const F = Function;
125
- new F("");
126
- return true;
127
- }
128
- catch (_) {
129
- return false;
130
- }
131
- });
132
- function isPlainObject(o) {
133
- if (isObject(o) === false)
134
- return false;
135
- // modified constructor
136
- const ctor = o.constructor;
137
- if (ctor === undefined)
138
- return true;
139
- // modified prototype
140
- const prot = ctor.prototype;
141
- if (isObject(prot) === false)
142
- return false;
143
- // ctor doesn't have static `isPrototypeOf`
144
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
145
- return false;
146
- }
147
- return true;
148
- }
149
- function numKeys(data) {
150
- let keyCount = 0;
151
- for (const key in data) {
152
- if (Object.prototype.hasOwnProperty.call(data, key)) {
153
- keyCount++;
154
- }
155
- }
156
- return keyCount;
157
- }
158
- const getParsedType = (data) => {
159
- const t = typeof data;
160
- switch (t) {
161
- case "undefined":
162
- return "undefined";
163
- case "string":
164
- return "string";
165
- case "number":
166
- return Number.isNaN(data) ? "nan" : "number";
167
- case "boolean":
168
- return "boolean";
169
- case "function":
170
- return "function";
171
- case "bigint":
172
- return "bigint";
173
- case "symbol":
174
- return "symbol";
175
- case "object":
176
- if (Array.isArray(data)) {
177
- return "array";
178
- }
179
- if (data === null) {
180
- return "null";
181
- }
182
- if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
183
- return "promise";
184
- }
185
- if (typeof Map !== "undefined" && data instanceof Map) {
186
- return "map";
187
- }
188
- if (typeof Set !== "undefined" && data instanceof Set) {
189
- return "set";
190
- }
191
- if (typeof Date !== "undefined" && data instanceof Date) {
192
- return "date";
193
- }
194
- if (typeof File !== "undefined" && data instanceof File) {
195
- return "file";
196
- }
197
- return "object";
198
- default:
199
- throw new Error(`Unknown data type: ${t}`);
200
- }
201
- };
202
- const propertyKeyTypes = new Set(["string", "number", "symbol"]);
203
- const primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
204
- function escapeRegex(str) {
205
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
206
- }
207
- // zod-specific utils
208
- function clone(inst, def, params) {
209
- const cl = new inst._zod.constr(def ?? inst._zod.def);
210
- if (!def || params?.parent)
211
- cl._zod.parent = inst;
212
- return cl;
213
- }
214
- function normalizeParams(_params) {
215
- const params = _params;
216
- if (!params)
217
- return {};
218
- if (typeof params === "string")
219
- return { error: () => params };
220
- if (params?.message !== undefined) {
221
- if (params?.error !== undefined)
222
- throw new Error("Cannot specify both `message` and `error` params");
223
- params.error = params.message;
224
- }
225
- delete params.message;
226
- if (typeof params.error === "string")
227
- return { ...params, error: () => params.error };
228
- return params;
229
- }
230
- function createTransparentProxy(getter) {
231
- let target;
232
- return new Proxy({}, {
233
- get(_, prop, receiver) {
234
- target ?? (target = getter());
235
- return Reflect.get(target, prop, receiver);
236
- },
237
- set(_, prop, value, receiver) {
238
- target ?? (target = getter());
239
- return Reflect.set(target, prop, value, receiver);
240
- },
241
- has(_, prop) {
242
- target ?? (target = getter());
243
- return Reflect.has(target, prop);
244
- },
245
- deleteProperty(_, prop) {
246
- target ?? (target = getter());
247
- return Reflect.deleteProperty(target, prop);
248
- },
249
- ownKeys(_) {
250
- target ?? (target = getter());
251
- return Reflect.ownKeys(target);
252
- },
253
- getOwnPropertyDescriptor(_, prop) {
254
- target ?? (target = getter());
255
- return Reflect.getOwnPropertyDescriptor(target, prop);
256
- },
257
- defineProperty(_, prop, descriptor) {
258
- target ?? (target = getter());
259
- return Reflect.defineProperty(target, prop, descriptor);
260
- },
261
- });
262
- }
263
- function stringifyPrimitive(value) {
264
- if (typeof value === "bigint")
265
- return value.toString() + "n";
266
- if (typeof value === "string")
267
- return `"${value}"`;
268
- return `${value}`;
269
- }
270
- function optionalKeys(shape) {
271
- return Object.keys(shape).filter((k) => {
272
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
273
- });
274
- }
275
- const NUMBER_FORMAT_RANGES = {
276
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
277
- int32: [-2147483648, 2147483647],
278
- uint32: [0, 4294967295],
279
- float32: [-34028234663852886e22, 3.4028234663852886e38],
280
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
281
- };
282
- const BIGINT_FORMAT_RANGES = {
283
- int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
284
- uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")],
285
- };
286
- function pick(schema, mask) {
287
- const newShape = {};
288
- const currDef = schema._zod.def; //.shape;
289
- for (const key in mask) {
290
- if (!(key in currDef.shape)) {
291
- throw new Error(`Unrecognized key: "${key}"`);
292
- }
293
- if (!mask[key])
294
- continue;
295
- // pick key
296
- newShape[key] = currDef.shape[key];
297
- }
298
- return clone(schema, {
299
- ...schema._zod.def,
300
- shape: newShape,
301
- checks: [],
302
- });
303
- }
304
- function omit(schema, mask) {
305
- const newShape = { ...schema._zod.def.shape };
306
- const currDef = schema._zod.def; //.shape;
307
- for (const key in mask) {
308
- if (!(key in currDef.shape)) {
309
- throw new Error(`Unrecognized key: "${key}"`);
310
- }
311
- if (!mask[key])
312
- continue;
313
- delete newShape[key];
314
- }
315
- return clone(schema, {
316
- ...schema._zod.def,
317
- shape: newShape,
318
- checks: [],
319
- });
320
- }
321
- function extend(schema, shape) {
322
- if (!isPlainObject(shape)) {
323
- throw new Error("Invalid input to extend: expected a plain object");
324
- }
325
- const def = {
326
- ...schema._zod.def,
327
- get shape() {
328
- const _shape = { ...schema._zod.def.shape, ...shape };
329
- assignProp(this, "shape", _shape); // self-caching
330
- return _shape;
331
- },
332
- checks: [], // delete existing checks
333
- };
334
- return clone(schema, def);
335
- }
336
- function merge(a, b) {
337
- return clone(a, {
338
- ...a._zod.def,
339
- get shape() {
340
- const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
341
- assignProp(this, "shape", _shape); // self-caching
342
- return _shape;
343
- },
344
- catchall: b._zod.def.catchall,
345
- checks: [], // delete existing checks
346
- });
347
- }
348
- function partial(Class, schema, mask) {
349
- const oldShape = schema._zod.def.shape;
350
- const shape = { ...oldShape };
351
- if (mask) {
352
- for (const key in mask) {
353
- if (!(key in oldShape)) {
354
- throw new Error(`Unrecognized key: "${key}"`);
355
- }
356
- if (!mask[key])
357
- continue;
358
- // if (oldShape[key]!._zod.optin === "optional") continue;
359
- shape[key] = Class
360
- ? new Class({
361
- type: "optional",
362
- innerType: oldShape[key],
363
- })
364
- : oldShape[key];
365
- }
366
- }
367
- else {
368
- for (const key in oldShape) {
369
- // if (oldShape[key]!._zod.optin === "optional") continue;
370
- shape[key] = Class
371
- ? new Class({
372
- type: "optional",
373
- innerType: oldShape[key],
374
- })
375
- : oldShape[key];
376
- }
377
- }
378
- return clone(schema, {
379
- ...schema._zod.def,
380
- shape,
381
- checks: [],
382
- });
383
- }
384
- function required(Class, schema, mask) {
385
- const oldShape = schema._zod.def.shape;
386
- const shape = { ...oldShape };
387
- if (mask) {
388
- for (const key in mask) {
389
- if (!(key in shape)) {
390
- throw new Error(`Unrecognized key: "${key}"`);
391
- }
392
- if (!mask[key])
393
- continue;
394
- // overwrite with non-optional
395
- shape[key] = new Class({
396
- type: "nonoptional",
397
- innerType: oldShape[key],
398
- });
399
- }
400
- }
401
- else {
402
- for (const key in oldShape) {
403
- // overwrite with non-optional
404
- shape[key] = new Class({
405
- type: "nonoptional",
406
- innerType: oldShape[key],
407
- });
408
- }
409
- }
410
- return clone(schema, {
411
- ...schema._zod.def,
412
- shape,
413
- // optional: [],
414
- checks: [],
415
- });
416
- }
417
- function aborted(x, startIndex = 0) {
418
- for (let i = startIndex; i < x.issues.length; i++) {
419
- if (x.issues[i]?.continue !== true)
420
- return true;
421
- }
422
- return false;
423
- }
424
- function prefixIssues(path, issues) {
425
- return issues.map((iss) => {
426
- var _a;
427
- (_a = iss).path ?? (_a.path = []);
428
- iss.path.unshift(path);
429
- return iss;
430
- });
431
- }
432
- function unwrapMessage(message) {
433
- return typeof message === "string" ? message : message?.message;
434
- }
435
- function finalizeIssue(iss, ctx, config) {
436
- const full = { ...iss, path: iss.path ?? [] };
437
- // for backwards compatibility
438
- if (!iss.message) {
439
- const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??
440
- unwrapMessage(ctx?.error?.(iss)) ??
441
- unwrapMessage(config.customError?.(iss)) ??
442
- unwrapMessage(config.localeError?.(iss)) ??
443
- "Invalid input";
444
- full.message = message;
445
- }
446
- // delete (full as any).def;
447
- delete full.inst;
448
- delete full.continue;
449
- if (!ctx?.reportInput) {
450
- delete full.input;
451
- }
452
- return full;
453
- }
454
- function getSizableOrigin(input) {
455
- if (input instanceof Set)
456
- return "set";
457
- if (input instanceof Map)
458
- return "map";
459
- if (input instanceof File)
460
- return "file";
461
- return "unknown";
462
- }
463
- function getLengthableOrigin(input) {
464
- if (Array.isArray(input))
465
- return "array";
466
- if (typeof input === "string")
467
- return "string";
468
- return "unknown";
469
- }
470
- function issue(...args) {
471
- const [iss, input, inst] = args;
472
- if (typeof iss === "string") {
473
- return {
474
- message: iss,
475
- code: "custom",
476
- input,
477
- inst,
478
- };
479
- }
480
- return { ...iss };
481
- }
482
- function cleanEnum(obj) {
483
- return Object.entries(obj)
484
- .filter(([k, _]) => {
485
- // return true if NaN, meaning it's not a number, thus a string key
486
- return Number.isNaN(Number.parseInt(k, 10));
487
- })
488
- .map((el) => el[1]);
489
- }
490
- // instanceof
491
- class Class {
492
- constructor(..._args) { }
493
- }
494
-
495
- exports.BIGINT_FORMAT_RANGES = BIGINT_FORMAT_RANGES;
496
- exports.Class = Class;
497
- exports.NUMBER_FORMAT_RANGES = NUMBER_FORMAT_RANGES;
498
- exports.aborted = aborted;
499
- exports.allowsEval = allowsEval;
500
- exports.assert = assert;
501
- exports.assertEqual = assertEqual;
502
- exports.assertIs = assertIs;
503
- exports.assertNever = assertNever;
504
- exports.assertNotEqual = assertNotEqual;
505
- exports.assignProp = assignProp;
506
- exports.cached = cached;
507
- exports.captureStackTrace = captureStackTrace;
508
- exports.cleanEnum = cleanEnum;
509
- exports.cleanRegex = cleanRegex;
510
- exports.clone = clone;
511
- exports.createTransparentProxy = createTransparentProxy;
512
- exports.defineLazy = defineLazy;
513
- exports.esc = esc;
514
- exports.escapeRegex = escapeRegex;
515
- exports.extend = extend;
516
- exports.finalizeIssue = finalizeIssue;
517
- exports.floatSafeRemainder = floatSafeRemainder;
518
- exports.getElementAtPath = getElementAtPath;
519
- exports.getEnumValues = getEnumValues;
520
- exports.getLengthableOrigin = getLengthableOrigin;
521
- exports.getParsedType = getParsedType;
522
- exports.getSizableOrigin = getSizableOrigin;
523
- exports.isObject = isObject;
524
- exports.isPlainObject = isPlainObject;
525
- exports.issue = issue;
526
- exports.joinValues = joinValues;
527
- exports.jsonStringifyReplacer = jsonStringifyReplacer;
528
- exports.merge = merge;
529
- exports.normalizeParams = normalizeParams;
530
- exports.nullish = nullish;
531
- exports.numKeys = numKeys;
532
- exports.omit = omit;
533
- exports.optionalKeys = optionalKeys;
534
- exports.partial = partial;
535
- exports.pick = pick;
536
- exports.prefixIssues = prefixIssues;
537
- exports.primitiveTypes = primitiveTypes;
538
- exports.promiseAllObject = promiseAllObject;
539
- exports.propertyKeyTypes = propertyKeyTypes;
540
- exports.randomString = randomString;
541
- exports.required = required;
542
- exports.stringifyPrimitive = stringifyPrimitive;
543
- exports.unwrapMessage = unwrapMessage;