golar 0.1.4 → 0.1.6

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 (43) hide show
  1. package/dist/builtin-rules.d.ts +2 -3
  2. package/dist/builtin-rules.generated.d.ts +3 -3
  3. package/dist/codegen-plugin.js +0 -1
  4. package/dist/config.js +32 -15
  5. package/dist/internal/linter/rule-creator.d.ts +3 -2
  6. package/dist/internal/linter/rule-creator.js +10 -10
  7. package/dist/internal/linter/rules/explicit-anys/config.js +3 -3
  8. package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.d.ts +1430 -0
  9. package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.js +658 -0
  10. package/dist/packages/golar/package.js +3 -2
  11. package/dist/workspace.js +2 -2
  12. package/package.json +10 -9
  13. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.ts +0 -22
  14. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js +0 -29
  15. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js +0 -37
  16. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.ts +0 -16
  17. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js +0 -19
  18. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.ts +0 -208
  19. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js +0 -578
  20. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.ts +0 -32
  21. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js +0 -470
  22. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +0 -64
  23. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js +0 -225
  24. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +0 -47
  25. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js +0 -61
  26. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js +0 -33
  27. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +0 -127
  28. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js +0 -62
  29. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js +0 -214
  30. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +0 -69
  31. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js +0 -109
  32. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js +0 -58
  33. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +0 -31
  34. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js +0 -49
  35. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +0 -805
  36. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js +0 -1096
  37. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +0 -120
  38. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +0 -96
  39. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js +0 -289
  40. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +0 -41
  41. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js +0 -304
  42. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +0 -8
  43. package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js +0 -9
@@ -1,578 +0,0 @@
1
- import { $ZodEncodeError, $constructor } from "../core/core.js";
2
- import { clone, defineLazy, extend, issue, merge, mergeDefs, normalizeParams, omit, partial, pick, required, safeExtend, shallowClone } from "../core/util.js";
3
- import { $ZodArray, $ZodBase64, $ZodBase64URL, $ZodBoolean, $ZodCIDRv4, $ZodCIDRv6, $ZodCUID, $ZodCUID2, $ZodCatch, $ZodCustom, $ZodDefault, $ZodDiscriminatedUnion, $ZodE164, $ZodEmail, $ZodEmoji, $ZodEnum, $ZodExactOptional, $ZodGUID, $ZodIPv4, $ZodIPv6, $ZodIntersection, $ZodJWT, $ZodKSUID, $ZodLiteral, $ZodNanoID, $ZodNever, $ZodNonOptional, $ZodNullable, $ZodObjectJIT, $ZodOptional, $ZodPipe, $ZodPrefault, $ZodReadonly, $ZodString, $ZodStringFormat, $ZodTransform, $ZodType, $ZodULID, $ZodURL, $ZodUUID, $ZodUnion, $ZodUnknown, $ZodXID } from "../core/schemas.js";
4
- import { globalRegistry } from "../core/registries.js";
5
- import { _array, _base64, _base64url, _boolean, _cidrv4, _cidrv6, _cuid, _cuid2, _e164, _email, _emoji, _endsWith, _guid, _includes, _ipv4, _ipv6, _jwt, _ksuid, _length, _lowercase, _maxLength, _minLength, _nanoid, _never, _normalize, _overwrite, _refine, _regex, _slugify, _startsWith, _string, _superRefine, _toLowerCase, _toUpperCase, _trim, _ulid, _unknown, _uppercase, _url, _uuid, _uuidv4, _uuidv6, _uuidv7, _xid, describe as describe$1, meta as meta$1 } from "../core/api.js";
6
- import { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from "../core/to-json-schema.js";
7
- import { arrayProcessor, booleanProcessor, catchProcessor, customProcessor, defaultProcessor, enumProcessor, intersectionProcessor, literalProcessor, neverProcessor, nonoptionalProcessor, nullableProcessor, objectProcessor, optionalProcessor, pipeProcessor, prefaultProcessor, readonlyProcessor, stringProcessor, transformProcessor, unionProcessor, unknownProcessor } from "../core/json-schema-processors.js";
8
- import { date, datetime, duration, time } from "./iso.js";
9
- import { decode, decodeAsync, encode, encodeAsync, parse, parseAsync, safeDecode, safeDecodeAsync, safeEncode, safeEncodeAsync, safeParse, safeParseAsync } from "./parse.js";
10
-
11
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
12
- const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
13
- $ZodType.init(inst, def);
14
- Object.assign(inst["~standard"], { jsonSchema: {
15
- input: createStandardJSONSchemaMethod(inst, "input"),
16
- output: createStandardJSONSchemaMethod(inst, "output")
17
- } });
18
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
19
- inst.def = def;
20
- inst.type = def.type;
21
- Object.defineProperty(inst, "_def", { value: def });
22
- inst.check = (...checks) => {
23
- return inst.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
24
- check: ch,
25
- def: { check: "custom" },
26
- onattach: []
27
- } } : ch)] }), { parent: true });
28
- };
29
- inst.with = inst.check;
30
- inst.clone = (def, params) => clone(inst, def, params);
31
- inst.brand = () => inst;
32
- inst.register = ((reg, meta) => {
33
- reg.add(inst, meta);
34
- return inst;
35
- });
36
- inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
37
- inst.safeParse = (data, params) => safeParse(inst, data, params);
38
- inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
39
- inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
40
- inst.spa = inst.safeParseAsync;
41
- inst.encode = (data, params) => encode(inst, data, params);
42
- inst.decode = (data, params) => decode(inst, data, params);
43
- inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
44
- inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
45
- inst.safeEncode = (data, params) => safeEncode(inst, data, params);
46
- inst.safeDecode = (data, params) => safeDecode(inst, data, params);
47
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
48
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
49
- inst.refine = (check, params) => inst.check(refine(check, params));
50
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
51
- inst.overwrite = (fn) => inst.check(_overwrite(fn));
52
- inst.optional = () => optional(inst);
53
- inst.exactOptional = () => exactOptional(inst);
54
- inst.nullable = () => nullable(inst);
55
- inst.nullish = () => optional(nullable(inst));
56
- inst.nonoptional = (params) => nonoptional(inst, params);
57
- inst.array = () => array(inst);
58
- inst.or = (arg) => union([inst, arg]);
59
- inst.and = (arg) => intersection(inst, arg);
60
- inst.transform = (tx) => pipe(inst, transform(tx));
61
- inst.default = (def) => _default(inst, def);
62
- inst.prefault = (def) => prefault(inst, def);
63
- inst.catch = (params) => _catch(inst, params);
64
- inst.pipe = (target) => pipe(inst, target);
65
- inst.readonly = () => readonly(inst);
66
- inst.describe = (description) => {
67
- const cl = inst.clone();
68
- globalRegistry.add(cl, { description });
69
- return cl;
70
- };
71
- Object.defineProperty(inst, "description", {
72
- get() {
73
- return globalRegistry.get(inst)?.description;
74
- },
75
- configurable: true
76
- });
77
- inst.meta = (...args) => {
78
- if (args.length === 0) return globalRegistry.get(inst);
79
- const cl = inst.clone();
80
- globalRegistry.add(cl, args[0]);
81
- return cl;
82
- };
83
- inst.isOptional = () => inst.safeParse(void 0).success;
84
- inst.isNullable = () => inst.safeParse(null).success;
85
- inst.apply = (fn) => fn(inst);
86
- return inst;
87
- });
88
- /** @internal */
89
- const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
90
- $ZodString.init(inst, def);
91
- ZodType.init(inst, def);
92
- inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
93
- const bag = inst._zod.bag;
94
- inst.format = bag.format ?? null;
95
- inst.minLength = bag.minimum ?? null;
96
- inst.maxLength = bag.maximum ?? null;
97
- inst.regex = (...args) => inst.check(_regex(...args));
98
- inst.includes = (...args) => inst.check(_includes(...args));
99
- inst.startsWith = (...args) => inst.check(_startsWith(...args));
100
- inst.endsWith = (...args) => inst.check(_endsWith(...args));
101
- inst.min = (...args) => inst.check(_minLength(...args));
102
- inst.max = (...args) => inst.check(_maxLength(...args));
103
- inst.length = (...args) => inst.check(_length(...args));
104
- inst.nonempty = (...args) => inst.check(_minLength(1, ...args));
105
- inst.lowercase = (params) => inst.check(_lowercase(params));
106
- inst.uppercase = (params) => inst.check(_uppercase(params));
107
- inst.trim = () => inst.check(_trim());
108
- inst.normalize = (...args) => inst.check(_normalize(...args));
109
- inst.toLowerCase = () => inst.check(_toLowerCase());
110
- inst.toUpperCase = () => inst.check(_toUpperCase());
111
- inst.slugify = () => inst.check(_slugify());
112
- });
113
- const ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
114
- $ZodString.init(inst, def);
115
- _ZodString.init(inst, def);
116
- inst.email = (params) => inst.check(_email(ZodEmail, params));
117
- inst.url = (params) => inst.check(_url(ZodURL, params));
118
- inst.jwt = (params) => inst.check(_jwt(ZodJWT, params));
119
- inst.emoji = (params) => inst.check(_emoji(ZodEmoji, params));
120
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
121
- inst.uuid = (params) => inst.check(_uuid(ZodUUID, params));
122
- inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params));
123
- inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params));
124
- inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params));
125
- inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params));
126
- inst.guid = (params) => inst.check(_guid(ZodGUID, params));
127
- inst.cuid = (params) => inst.check(_cuid(ZodCUID, params));
128
- inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params));
129
- inst.ulid = (params) => inst.check(_ulid(ZodULID, params));
130
- inst.base64 = (params) => inst.check(_base64(ZodBase64, params));
131
- inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params));
132
- inst.xid = (params) => inst.check(_xid(ZodXID, params));
133
- inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params));
134
- inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params));
135
- inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params));
136
- inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params));
137
- inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params));
138
- inst.e164 = (params) => inst.check(_e164(ZodE164, params));
139
- inst.datetime = (params) => inst.check(datetime(params));
140
- inst.date = (params) => inst.check(date(params));
141
- inst.time = (params) => inst.check(time(params));
142
- inst.duration = (params) => inst.check(duration(params));
143
- });
144
- function string(params) {
145
- return _string(ZodString, params);
146
- }
147
- const ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
148
- $ZodStringFormat.init(inst, def);
149
- _ZodString.init(inst, def);
150
- });
151
- const ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
152
- $ZodEmail.init(inst, def);
153
- ZodStringFormat.init(inst, def);
154
- });
155
- const ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
156
- $ZodGUID.init(inst, def);
157
- ZodStringFormat.init(inst, def);
158
- });
159
- const ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
160
- $ZodUUID.init(inst, def);
161
- ZodStringFormat.init(inst, def);
162
- });
163
- const ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
164
- $ZodURL.init(inst, def);
165
- ZodStringFormat.init(inst, def);
166
- });
167
- const ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
168
- $ZodEmoji.init(inst, def);
169
- ZodStringFormat.init(inst, def);
170
- });
171
- const ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
172
- $ZodNanoID.init(inst, def);
173
- ZodStringFormat.init(inst, def);
174
- });
175
- const ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
176
- $ZodCUID.init(inst, def);
177
- ZodStringFormat.init(inst, def);
178
- });
179
- const ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
180
- $ZodCUID2.init(inst, def);
181
- ZodStringFormat.init(inst, def);
182
- });
183
- const ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
184
- $ZodULID.init(inst, def);
185
- ZodStringFormat.init(inst, def);
186
- });
187
- const ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
188
- $ZodXID.init(inst, def);
189
- ZodStringFormat.init(inst, def);
190
- });
191
- const ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
192
- $ZodKSUID.init(inst, def);
193
- ZodStringFormat.init(inst, def);
194
- });
195
- const ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
196
- $ZodIPv4.init(inst, def);
197
- ZodStringFormat.init(inst, def);
198
- });
199
- const ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
200
- $ZodIPv6.init(inst, def);
201
- ZodStringFormat.init(inst, def);
202
- });
203
- const ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
204
- $ZodCIDRv4.init(inst, def);
205
- ZodStringFormat.init(inst, def);
206
- });
207
- const ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
208
- $ZodCIDRv6.init(inst, def);
209
- ZodStringFormat.init(inst, def);
210
- });
211
- const ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
212
- $ZodBase64.init(inst, def);
213
- ZodStringFormat.init(inst, def);
214
- });
215
- const ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
216
- $ZodBase64URL.init(inst, def);
217
- ZodStringFormat.init(inst, def);
218
- });
219
- const ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
220
- $ZodE164.init(inst, def);
221
- ZodStringFormat.init(inst, def);
222
- });
223
- const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
224
- $ZodJWT.init(inst, def);
225
- ZodStringFormat.init(inst, def);
226
- });
227
- const ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
228
- $ZodBoolean.init(inst, def);
229
- ZodType.init(inst, def);
230
- inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
231
- });
232
- function boolean(params) {
233
- return _boolean(ZodBoolean, params);
234
- }
235
- const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
236
- $ZodUnknown.init(inst, def);
237
- ZodType.init(inst, def);
238
- inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
239
- });
240
- function unknown() {
241
- return _unknown(ZodUnknown);
242
- }
243
- const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
244
- $ZodNever.init(inst, def);
245
- ZodType.init(inst, def);
246
- inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
247
- });
248
- function never(params) {
249
- return _never(ZodNever, params);
250
- }
251
- const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
252
- $ZodArray.init(inst, def);
253
- ZodType.init(inst, def);
254
- inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
255
- inst.element = def.element;
256
- inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
257
- inst.nonempty = (params) => inst.check(_minLength(1, params));
258
- inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params));
259
- inst.length = (len, params) => inst.check(_length(len, params));
260
- inst.unwrap = () => inst.element;
261
- });
262
- function array(element, params) {
263
- return _array(ZodArray, element, params);
264
- }
265
- const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
266
- $ZodObjectJIT.init(inst, def);
267
- ZodType.init(inst, def);
268
- inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
269
- defineLazy(inst, "shape", () => {
270
- return def.shape;
271
- });
272
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
273
- inst.catchall = (catchall) => inst.clone({
274
- ...inst._zod.def,
275
- catchall
276
- });
277
- inst.passthrough = () => inst.clone({
278
- ...inst._zod.def,
279
- catchall: unknown()
280
- });
281
- inst.loose = () => inst.clone({
282
- ...inst._zod.def,
283
- catchall: unknown()
284
- });
285
- inst.strict = () => inst.clone({
286
- ...inst._zod.def,
287
- catchall: never()
288
- });
289
- inst.strip = () => inst.clone({
290
- ...inst._zod.def,
291
- catchall: void 0
292
- });
293
- inst.extend = (incoming) => {
294
- return extend(inst, incoming);
295
- };
296
- inst.safeExtend = (incoming) => {
297
- return safeExtend(inst, incoming);
298
- };
299
- inst.merge = (other) => merge(inst, other);
300
- inst.pick = (mask) => pick(inst, mask);
301
- inst.omit = (mask) => omit(inst, mask);
302
- inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
303
- inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
304
- });
305
- function object(shape, params) {
306
- return new ZodObject({
307
- type: "object",
308
- shape: shape ?? {},
309
- ...normalizeParams(params)
310
- });
311
- }
312
- function strictObject(shape, params) {
313
- return new ZodObject({
314
- type: "object",
315
- shape,
316
- catchall: never(),
317
- ...normalizeParams(params)
318
- });
319
- }
320
- const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
321
- $ZodUnion.init(inst, def);
322
- ZodType.init(inst, def);
323
- inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
324
- inst.options = def.options;
325
- });
326
- function union(options, params) {
327
- return new ZodUnion({
328
- type: "union",
329
- options,
330
- ...normalizeParams(params)
331
- });
332
- }
333
- const ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("ZodDiscriminatedUnion", (inst, def) => {
334
- ZodUnion.init(inst, def);
335
- $ZodDiscriminatedUnion.init(inst, def);
336
- });
337
- function discriminatedUnion(discriminator, options, params) {
338
- return new ZodDiscriminatedUnion({
339
- type: "union",
340
- options,
341
- discriminator,
342
- ...normalizeParams(params)
343
- });
344
- }
345
- const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
346
- $ZodIntersection.init(inst, def);
347
- ZodType.init(inst, def);
348
- inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
349
- });
350
- function intersection(left, right) {
351
- return new ZodIntersection({
352
- type: "intersection",
353
- left,
354
- right
355
- });
356
- }
357
- const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
358
- $ZodEnum.init(inst, def);
359
- ZodType.init(inst, def);
360
- inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
361
- inst.enum = def.entries;
362
- inst.options = Object.values(def.entries);
363
- const keys = new Set(Object.keys(def.entries));
364
- inst.extract = (values, params) => {
365
- const newEntries = {};
366
- for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
367
- else throw new Error(`Key ${value} not found in enum`);
368
- return new ZodEnum({
369
- ...def,
370
- checks: [],
371
- ...normalizeParams(params),
372
- entries: newEntries
373
- });
374
- };
375
- inst.exclude = (values, params) => {
376
- const newEntries = { ...def.entries };
377
- for (const value of values) if (keys.has(value)) delete newEntries[value];
378
- else throw new Error(`Key ${value} not found in enum`);
379
- return new ZodEnum({
380
- ...def,
381
- checks: [],
382
- ...normalizeParams(params),
383
- entries: newEntries
384
- });
385
- };
386
- });
387
- function _enum(values, params) {
388
- return new ZodEnum({
389
- type: "enum",
390
- entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
391
- ...normalizeParams(params)
392
- });
393
- }
394
- const ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
395
- $ZodLiteral.init(inst, def);
396
- ZodType.init(inst, def);
397
- inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
398
- inst.values = new Set(def.values);
399
- Object.defineProperty(inst, "value", { get() {
400
- if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
401
- return def.values[0];
402
- } });
403
- });
404
- function literal(value, params) {
405
- return new ZodLiteral({
406
- type: "literal",
407
- values: Array.isArray(value) ? value : [value],
408
- ...normalizeParams(params)
409
- });
410
- }
411
- const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
412
- $ZodTransform.init(inst, def);
413
- ZodType.init(inst, def);
414
- inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
415
- inst._zod.parse = (payload, _ctx) => {
416
- if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
417
- payload.addIssue = (issue$1) => {
418
- if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
419
- else {
420
- const _issue = issue$1;
421
- if (_issue.fatal) _issue.continue = false;
422
- _issue.code ?? (_issue.code = "custom");
423
- _issue.input ?? (_issue.input = payload.value);
424
- _issue.inst ?? (_issue.inst = inst);
425
- payload.issues.push(issue(_issue));
426
- }
427
- };
428
- const output = def.transform(payload.value, payload);
429
- if (output instanceof Promise) return output.then((output) => {
430
- payload.value = output;
431
- return payload;
432
- });
433
- payload.value = output;
434
- return payload;
435
- };
436
- });
437
- function transform(fn) {
438
- return new ZodTransform({
439
- type: "transform",
440
- transform: fn
441
- });
442
- }
443
- const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
444
- $ZodOptional.init(inst, def);
445
- ZodType.init(inst, def);
446
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
447
- inst.unwrap = () => inst._zod.def.innerType;
448
- });
449
- function optional(innerType) {
450
- return new ZodOptional({
451
- type: "optional",
452
- innerType
453
- });
454
- }
455
- const ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
456
- $ZodExactOptional.init(inst, def);
457
- ZodType.init(inst, def);
458
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
459
- inst.unwrap = () => inst._zod.def.innerType;
460
- });
461
- function exactOptional(innerType) {
462
- return new ZodExactOptional({
463
- type: "optional",
464
- innerType
465
- });
466
- }
467
- const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
468
- $ZodNullable.init(inst, def);
469
- ZodType.init(inst, def);
470
- inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
471
- inst.unwrap = () => inst._zod.def.innerType;
472
- });
473
- function nullable(innerType) {
474
- return new ZodNullable({
475
- type: "nullable",
476
- innerType
477
- });
478
- }
479
- const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
480
- $ZodDefault.init(inst, def);
481
- ZodType.init(inst, def);
482
- inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
483
- inst.unwrap = () => inst._zod.def.innerType;
484
- inst.removeDefault = inst.unwrap;
485
- });
486
- function _default(innerType, defaultValue) {
487
- return new ZodDefault({
488
- type: "default",
489
- innerType,
490
- get defaultValue() {
491
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
492
- }
493
- });
494
- }
495
- const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
496
- $ZodPrefault.init(inst, def);
497
- ZodType.init(inst, def);
498
- inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
499
- inst.unwrap = () => inst._zod.def.innerType;
500
- });
501
- function prefault(innerType, defaultValue) {
502
- return new ZodPrefault({
503
- type: "prefault",
504
- innerType,
505
- get defaultValue() {
506
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
507
- }
508
- });
509
- }
510
- const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
511
- $ZodNonOptional.init(inst, def);
512
- ZodType.init(inst, def);
513
- inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
514
- inst.unwrap = () => inst._zod.def.innerType;
515
- });
516
- function nonoptional(innerType, params) {
517
- return new ZodNonOptional({
518
- type: "nonoptional",
519
- innerType,
520
- ...normalizeParams(params)
521
- });
522
- }
523
- const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
524
- $ZodCatch.init(inst, def);
525
- ZodType.init(inst, def);
526
- inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
527
- inst.unwrap = () => inst._zod.def.innerType;
528
- inst.removeCatch = inst.unwrap;
529
- });
530
- function _catch(innerType, catchValue) {
531
- return new ZodCatch({
532
- type: "catch",
533
- innerType,
534
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
535
- });
536
- }
537
- const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
538
- $ZodPipe.init(inst, def);
539
- ZodType.init(inst, def);
540
- inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
541
- inst.in = def.in;
542
- inst.out = def.out;
543
- });
544
- function pipe(in_, out) {
545
- return new ZodPipe({
546
- type: "pipe",
547
- in: in_,
548
- out
549
- });
550
- }
551
- const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
552
- $ZodReadonly.init(inst, def);
553
- ZodType.init(inst, def);
554
- inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
555
- inst.unwrap = () => inst._zod.def.innerType;
556
- });
557
- function readonly(innerType) {
558
- return new ZodReadonly({
559
- type: "readonly",
560
- innerType
561
- });
562
- }
563
- const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
564
- $ZodCustom.init(inst, def);
565
- ZodType.init(inst, def);
566
- inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
567
- });
568
- function refine(fn, _params = {}) {
569
- return _refine(ZodCustom, fn, _params);
570
- }
571
- function superRefine(fn) {
572
- return _superRefine(fn);
573
- }
574
- const describe = describe$1;
575
- const meta = meta$1;
576
-
577
- //#endregion
578
- export { ZodStringFormat, array, boolean, discriminatedUnion, literal, object, strictObject, string, union };
@@ -1,32 +0,0 @@
1
- import { EmptyToNever, Flatten, MakePartial } from "./util.js";
2
- import { $ZodCustom, $ZodEnum, $ZodNonOptional, $ZodType, ParsePayload } from "./schemas.js";
3
- import { $ZodCheck, $ZodCheckLengthEquals, $ZodCheckMaxLength, $ZodCheckMinLength } from "./checks.js";
4
- import { $ZodErrorMap, $ZodIssue, $ZodIssueBase } from "./errors.js";
5
-
6
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.cts
7
- type Params<T extends $ZodType | $ZodCheck, IssueTypes extends $ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never> = Flatten<Partial<EmptyToNever<Omit<T["_zod"]["def"], OmitKeys> & ([IssueTypes] extends [never] ? {} : {
8
- error?: string | $ZodErrorMap<IssueTypes> | undefined; /** @deprecated This parameter is deprecated. Use `error` instead. */
9
- message?: string | undefined;
10
- })>>>;
11
- type TypeParams<T extends $ZodType = $ZodType & {
12
- _isst: never;
13
- }, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error"> = never> = Params<T, NonNullable<T["_zod"]["isst"]>, "type" | "checks" | "error" | AlsoOmit>;
14
- type CheckParams<T extends $ZodCheck = $ZodCheck, // & { _issc: never },
15
- AlsoOmit extends Exclude<keyof T["_zod"]["def"], "check" | "error"> = never> = Params<T, NonNullable<T["_zod"]["issc"]>, "check" | "error" | AlsoOmit>;
16
- type CheckTypeParams<T extends $ZodType & $ZodCheck = $ZodType & $ZodCheck, AlsoOmit extends Exclude<keyof T["_zod"]["def"], "type" | "checks" | "error" | "check"> = never> = Params<T, NonNullable<T["_zod"]["isst"] | T["_zod"]["issc"]>, "type" | "checks" | "error" | "check" | AlsoOmit>;
17
- type $ZodCheckMaxLengthParams = CheckParams<$ZodCheckMaxLength, "maximum" | "when">;
18
- type $ZodCheckMinLengthParams = CheckParams<$ZodCheckMinLength, "minimum" | "when">;
19
- type $ZodCheckLengthEqualsParams = CheckParams<$ZodCheckLengthEquals, "length" | "when">;
20
- type $ZodEnumParams = TypeParams<$ZodEnum, "entries">;
21
- type $ZodNonOptionalParams = TypeParams<$ZodNonOptional, "innerType">;
22
- type $ZodCustomParams = CheckTypeParams<$ZodCustom, "fn">;
23
- type $ZodSuperRefineIssue<T extends $ZodIssueBase = $ZodIssue> = T extends any ? RawIssue<T> : never;
24
- type RawIssue<T extends $ZodIssueBase> = T extends any ? Flatten<MakePartial<T, "message" | "path"> & {
25
- /** The schema or check that originated this issue. */readonly inst?: $ZodType | $ZodCheck; /** If `true`, Zod will execute subsequent checks/refinements instead of immediately aborting */
26
- readonly continue?: boolean | undefined;
27
- } & Record<string, unknown>> : never;
28
- interface $RefinementCtx<T = unknown> extends ParsePayload<T> {
29
- addIssue(arg: string | $ZodSuperRefineIssue): void;
30
- }
31
- //#endregion
32
- export { $RefinementCtx, $ZodCheckLengthEqualsParams, $ZodCheckMaxLengthParams, $ZodCheckMinLengthParams, $ZodCustomParams, $ZodEnumParams, $ZodNonOptionalParams };