golar 0.1.4 → 0.1.5
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/builtin-rules.d.ts +2 -3
- package/dist/builtin-rules.generated.d.ts +3 -3
- package/dist/internal/linter/rule-creator.d.ts +3 -2
- package/dist/internal/linter/rule-creator.js +10 -10
- package/dist/internal/linter/rules/explicit-anys/config.js +3 -3
- package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.d.ts +1430 -0
- package/dist/node_modules/.pnpm/valibot@1.3.1_typescript@5.9.3/node_modules/valibot/dist/index.js +658 -0
- package/dist/packages/golar/package.js +1 -1
- package/dist/workspace.js +2 -2
- package/package.json +9 -9
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.d.ts +0 -22
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js +0 -29
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js +0 -37
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.d.ts +0 -16
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js +0 -19
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.d.ts +0 -208
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js +0 -578
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.d.ts +0 -32
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js +0 -470
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.ts +0 -64
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js +0 -225
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.d.ts +0 -47
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js +0 -61
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js +0 -33
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.d.ts +0 -127
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js +0 -62
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js +0 -214
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema.d.ts +0 -69
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js +0 -109
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js +0 -58
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.d.ts +0 -31
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js +0 -49
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.d.ts +0 -805
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js +0 -1096
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/standard-schema.d.ts +0 -120
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.d.ts +0 -96
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js +0 -289
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.d.ts +0 -41
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js +0 -304
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.d.ts +0 -8
- package/dist/node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js +0 -9
|
@@ -1,470 +0,0 @@
|
|
|
1
|
-
import { issue, normalizeParams, slugify } from "./util.js";
|
|
2
|
-
import { $ZodCheck, $ZodCheckEndsWith, $ZodCheckIncludes, $ZodCheckLengthEquals, $ZodCheckLowerCase, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodCheckOverwrite, $ZodCheckRegex, $ZodCheckStartsWith, $ZodCheckUpperCase } from "./checks.js";
|
|
3
|
-
import { globalRegistry } from "./registries.js";
|
|
4
|
-
|
|
5
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
|
|
6
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
7
|
-
function _string(Class, params) {
|
|
8
|
-
return new Class({
|
|
9
|
-
type: "string",
|
|
10
|
-
...normalizeParams(params)
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
14
|
-
function _email(Class, params) {
|
|
15
|
-
return new Class({
|
|
16
|
-
type: "string",
|
|
17
|
-
format: "email",
|
|
18
|
-
check: "string_format",
|
|
19
|
-
abort: false,
|
|
20
|
-
...normalizeParams(params)
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
24
|
-
function _guid(Class, params) {
|
|
25
|
-
return new Class({
|
|
26
|
-
type: "string",
|
|
27
|
-
format: "guid",
|
|
28
|
-
check: "string_format",
|
|
29
|
-
abort: false,
|
|
30
|
-
...normalizeParams(params)
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
34
|
-
function _uuid(Class, params) {
|
|
35
|
-
return new Class({
|
|
36
|
-
type: "string",
|
|
37
|
-
format: "uuid",
|
|
38
|
-
check: "string_format",
|
|
39
|
-
abort: false,
|
|
40
|
-
...normalizeParams(params)
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
44
|
-
function _uuidv4(Class, params) {
|
|
45
|
-
return new Class({
|
|
46
|
-
type: "string",
|
|
47
|
-
format: "uuid",
|
|
48
|
-
check: "string_format",
|
|
49
|
-
abort: false,
|
|
50
|
-
version: "v4",
|
|
51
|
-
...normalizeParams(params)
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
55
|
-
function _uuidv6(Class, params) {
|
|
56
|
-
return new Class({
|
|
57
|
-
type: "string",
|
|
58
|
-
format: "uuid",
|
|
59
|
-
check: "string_format",
|
|
60
|
-
abort: false,
|
|
61
|
-
version: "v6",
|
|
62
|
-
...normalizeParams(params)
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
66
|
-
function _uuidv7(Class, params) {
|
|
67
|
-
return new Class({
|
|
68
|
-
type: "string",
|
|
69
|
-
format: "uuid",
|
|
70
|
-
check: "string_format",
|
|
71
|
-
abort: false,
|
|
72
|
-
version: "v7",
|
|
73
|
-
...normalizeParams(params)
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
77
|
-
function _url(Class, params) {
|
|
78
|
-
return new Class({
|
|
79
|
-
type: "string",
|
|
80
|
-
format: "url",
|
|
81
|
-
check: "string_format",
|
|
82
|
-
abort: false,
|
|
83
|
-
...normalizeParams(params)
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
87
|
-
function _emoji(Class, params) {
|
|
88
|
-
return new Class({
|
|
89
|
-
type: "string",
|
|
90
|
-
format: "emoji",
|
|
91
|
-
check: "string_format",
|
|
92
|
-
abort: false,
|
|
93
|
-
...normalizeParams(params)
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
97
|
-
function _nanoid(Class, params) {
|
|
98
|
-
return new Class({
|
|
99
|
-
type: "string",
|
|
100
|
-
format: "nanoid",
|
|
101
|
-
check: "string_format",
|
|
102
|
-
abort: false,
|
|
103
|
-
...normalizeParams(params)
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
107
|
-
function _cuid(Class, params) {
|
|
108
|
-
return new Class({
|
|
109
|
-
type: "string",
|
|
110
|
-
format: "cuid",
|
|
111
|
-
check: "string_format",
|
|
112
|
-
abort: false,
|
|
113
|
-
...normalizeParams(params)
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
117
|
-
function _cuid2(Class, params) {
|
|
118
|
-
return new Class({
|
|
119
|
-
type: "string",
|
|
120
|
-
format: "cuid2",
|
|
121
|
-
check: "string_format",
|
|
122
|
-
abort: false,
|
|
123
|
-
...normalizeParams(params)
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
127
|
-
function _ulid(Class, params) {
|
|
128
|
-
return new Class({
|
|
129
|
-
type: "string",
|
|
130
|
-
format: "ulid",
|
|
131
|
-
check: "string_format",
|
|
132
|
-
abort: false,
|
|
133
|
-
...normalizeParams(params)
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
137
|
-
function _xid(Class, params) {
|
|
138
|
-
return new Class({
|
|
139
|
-
type: "string",
|
|
140
|
-
format: "xid",
|
|
141
|
-
check: "string_format",
|
|
142
|
-
abort: false,
|
|
143
|
-
...normalizeParams(params)
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
147
|
-
function _ksuid(Class, params) {
|
|
148
|
-
return new Class({
|
|
149
|
-
type: "string",
|
|
150
|
-
format: "ksuid",
|
|
151
|
-
check: "string_format",
|
|
152
|
-
abort: false,
|
|
153
|
-
...normalizeParams(params)
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
157
|
-
function _ipv4(Class, params) {
|
|
158
|
-
return new Class({
|
|
159
|
-
type: "string",
|
|
160
|
-
format: "ipv4",
|
|
161
|
-
check: "string_format",
|
|
162
|
-
abort: false,
|
|
163
|
-
...normalizeParams(params)
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
167
|
-
function _ipv6(Class, params) {
|
|
168
|
-
return new Class({
|
|
169
|
-
type: "string",
|
|
170
|
-
format: "ipv6",
|
|
171
|
-
check: "string_format",
|
|
172
|
-
abort: false,
|
|
173
|
-
...normalizeParams(params)
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
177
|
-
function _cidrv4(Class, params) {
|
|
178
|
-
return new Class({
|
|
179
|
-
type: "string",
|
|
180
|
-
format: "cidrv4",
|
|
181
|
-
check: "string_format",
|
|
182
|
-
abort: false,
|
|
183
|
-
...normalizeParams(params)
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
187
|
-
function _cidrv6(Class, params) {
|
|
188
|
-
return new Class({
|
|
189
|
-
type: "string",
|
|
190
|
-
format: "cidrv6",
|
|
191
|
-
check: "string_format",
|
|
192
|
-
abort: false,
|
|
193
|
-
...normalizeParams(params)
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
197
|
-
function _base64(Class, params) {
|
|
198
|
-
return new Class({
|
|
199
|
-
type: "string",
|
|
200
|
-
format: "base64",
|
|
201
|
-
check: "string_format",
|
|
202
|
-
abort: false,
|
|
203
|
-
...normalizeParams(params)
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
207
|
-
function _base64url(Class, params) {
|
|
208
|
-
return new Class({
|
|
209
|
-
type: "string",
|
|
210
|
-
format: "base64url",
|
|
211
|
-
check: "string_format",
|
|
212
|
-
abort: false,
|
|
213
|
-
...normalizeParams(params)
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
217
|
-
function _e164(Class, params) {
|
|
218
|
-
return new Class({
|
|
219
|
-
type: "string",
|
|
220
|
-
format: "e164",
|
|
221
|
-
check: "string_format",
|
|
222
|
-
abort: false,
|
|
223
|
-
...normalizeParams(params)
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
227
|
-
function _jwt(Class, params) {
|
|
228
|
-
return new Class({
|
|
229
|
-
type: "string",
|
|
230
|
-
format: "jwt",
|
|
231
|
-
check: "string_format",
|
|
232
|
-
abort: false,
|
|
233
|
-
...normalizeParams(params)
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
237
|
-
function _isoDateTime(Class, params) {
|
|
238
|
-
return new Class({
|
|
239
|
-
type: "string",
|
|
240
|
-
format: "datetime",
|
|
241
|
-
check: "string_format",
|
|
242
|
-
offset: false,
|
|
243
|
-
local: false,
|
|
244
|
-
precision: null,
|
|
245
|
-
...normalizeParams(params)
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
249
|
-
function _isoDate(Class, params) {
|
|
250
|
-
return new Class({
|
|
251
|
-
type: "string",
|
|
252
|
-
format: "date",
|
|
253
|
-
check: "string_format",
|
|
254
|
-
...normalizeParams(params)
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
258
|
-
function _isoTime(Class, params) {
|
|
259
|
-
return new Class({
|
|
260
|
-
type: "string",
|
|
261
|
-
format: "time",
|
|
262
|
-
check: "string_format",
|
|
263
|
-
precision: null,
|
|
264
|
-
...normalizeParams(params)
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
268
|
-
function _isoDuration(Class, params) {
|
|
269
|
-
return new Class({
|
|
270
|
-
type: "string",
|
|
271
|
-
format: "duration",
|
|
272
|
-
check: "string_format",
|
|
273
|
-
...normalizeParams(params)
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
277
|
-
function _boolean(Class, params) {
|
|
278
|
-
return new Class({
|
|
279
|
-
type: "boolean",
|
|
280
|
-
...normalizeParams(params)
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
284
|
-
function _unknown(Class) {
|
|
285
|
-
return new Class({ type: "unknown" });
|
|
286
|
-
}
|
|
287
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
288
|
-
function _never(Class, params) {
|
|
289
|
-
return new Class({
|
|
290
|
-
type: "never",
|
|
291
|
-
...normalizeParams(params)
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
295
|
-
function _maxLength(maximum, params) {
|
|
296
|
-
return new $ZodCheckMaxLength({
|
|
297
|
-
check: "max_length",
|
|
298
|
-
...normalizeParams(params),
|
|
299
|
-
maximum
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
303
|
-
function _minLength(minimum, params) {
|
|
304
|
-
return new $ZodCheckMinLength({
|
|
305
|
-
check: "min_length",
|
|
306
|
-
...normalizeParams(params),
|
|
307
|
-
minimum
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
311
|
-
function _length(length, params) {
|
|
312
|
-
return new $ZodCheckLengthEquals({
|
|
313
|
-
check: "length_equals",
|
|
314
|
-
...normalizeParams(params),
|
|
315
|
-
length
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
319
|
-
function _regex(pattern, params) {
|
|
320
|
-
return new $ZodCheckRegex({
|
|
321
|
-
check: "string_format",
|
|
322
|
-
format: "regex",
|
|
323
|
-
...normalizeParams(params),
|
|
324
|
-
pattern
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
328
|
-
function _lowercase(params) {
|
|
329
|
-
return new $ZodCheckLowerCase({
|
|
330
|
-
check: "string_format",
|
|
331
|
-
format: "lowercase",
|
|
332
|
-
...normalizeParams(params)
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
336
|
-
function _uppercase(params) {
|
|
337
|
-
return new $ZodCheckUpperCase({
|
|
338
|
-
check: "string_format",
|
|
339
|
-
format: "uppercase",
|
|
340
|
-
...normalizeParams(params)
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
344
|
-
function _includes(includes, params) {
|
|
345
|
-
return new $ZodCheckIncludes({
|
|
346
|
-
check: "string_format",
|
|
347
|
-
format: "includes",
|
|
348
|
-
...normalizeParams(params),
|
|
349
|
-
includes
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
353
|
-
function _startsWith(prefix, params) {
|
|
354
|
-
return new $ZodCheckStartsWith({
|
|
355
|
-
check: "string_format",
|
|
356
|
-
format: "starts_with",
|
|
357
|
-
...normalizeParams(params),
|
|
358
|
-
prefix
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
362
|
-
function _endsWith(suffix, params) {
|
|
363
|
-
return new $ZodCheckEndsWith({
|
|
364
|
-
check: "string_format",
|
|
365
|
-
format: "ends_with",
|
|
366
|
-
...normalizeParams(params),
|
|
367
|
-
suffix
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
371
|
-
function _overwrite(tx) {
|
|
372
|
-
return new $ZodCheckOverwrite({
|
|
373
|
-
check: "overwrite",
|
|
374
|
-
tx
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
378
|
-
function _normalize(form) {
|
|
379
|
-
return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
|
|
380
|
-
}
|
|
381
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
382
|
-
function _trim() {
|
|
383
|
-
return /* @__PURE__ */ _overwrite((input) => input.trim());
|
|
384
|
-
}
|
|
385
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
386
|
-
function _toLowerCase() {
|
|
387
|
-
return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
|
|
388
|
-
}
|
|
389
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
390
|
-
function _toUpperCase() {
|
|
391
|
-
return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
|
|
392
|
-
}
|
|
393
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
394
|
-
function _slugify() {
|
|
395
|
-
return /* @__PURE__ */ _overwrite((input) => slugify(input));
|
|
396
|
-
}
|
|
397
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
398
|
-
function _array(Class, element, params) {
|
|
399
|
-
return new Class({
|
|
400
|
-
type: "array",
|
|
401
|
-
element,
|
|
402
|
-
...normalizeParams(params)
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
406
|
-
function _refine(Class, fn, _params) {
|
|
407
|
-
return new Class({
|
|
408
|
-
type: "custom",
|
|
409
|
-
check: "custom",
|
|
410
|
-
fn,
|
|
411
|
-
...normalizeParams(_params)
|
|
412
|
-
});
|
|
413
|
-
}
|
|
414
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
415
|
-
function _superRefine(fn) {
|
|
416
|
-
const ch = /* @__PURE__ */ _check((payload) => {
|
|
417
|
-
payload.addIssue = (issue$1) => {
|
|
418
|
-
if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, ch._zod.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 = ch);
|
|
425
|
-
_issue.continue ?? (_issue.continue = !ch._zod.def.abort);
|
|
426
|
-
payload.issues.push(issue(_issue));
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
return fn(payload.value, payload);
|
|
430
|
-
});
|
|
431
|
-
return ch;
|
|
432
|
-
}
|
|
433
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
434
|
-
function _check(fn, params) {
|
|
435
|
-
const ch = new $ZodCheck({
|
|
436
|
-
check: "custom",
|
|
437
|
-
...normalizeParams(params)
|
|
438
|
-
});
|
|
439
|
-
ch._zod.check = fn;
|
|
440
|
-
return ch;
|
|
441
|
-
}
|
|
442
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
443
|
-
function describe(description) {
|
|
444
|
-
const ch = new $ZodCheck({ check: "describe" });
|
|
445
|
-
ch._zod.onattach = [(inst) => {
|
|
446
|
-
const existing = globalRegistry.get(inst) ?? {};
|
|
447
|
-
globalRegistry.add(inst, {
|
|
448
|
-
...existing,
|
|
449
|
-
description
|
|
450
|
-
});
|
|
451
|
-
}];
|
|
452
|
-
ch._zod.check = () => {};
|
|
453
|
-
return ch;
|
|
454
|
-
}
|
|
455
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
456
|
-
function meta(metadata) {
|
|
457
|
-
const ch = new $ZodCheck({ check: "meta" });
|
|
458
|
-
ch._zod.onattach = [(inst) => {
|
|
459
|
-
const existing = globalRegistry.get(inst) ?? {};
|
|
460
|
-
globalRegistry.add(inst, {
|
|
461
|
-
...existing,
|
|
462
|
-
...metadata
|
|
463
|
-
});
|
|
464
|
-
}];
|
|
465
|
-
ch._zod.check = () => {};
|
|
466
|
-
return ch;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
//#endregion
|
|
470
|
-
export { _array, _base64, _base64url, _boolean, _cidrv4, _cidrv6, _cuid, _cuid2, _e164, _email, _emoji, _endsWith, _guid, _includes, _ipv4, _ipv6, _isoDate, _isoDateTime, _isoDuration, _isoTime, _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, meta };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { HasLength, MaybeAsync } from "./util.js";
|
|
2
|
-
import { $ZodType, ParsePayload } from "./schemas.js";
|
|
3
|
-
import { $ZodErrorMap, $ZodIssueBase, $ZodIssueTooBig, $ZodIssueTooSmall } from "./errors.js";
|
|
4
|
-
import { $constructor } from "./core.js";
|
|
5
|
-
|
|
6
|
-
//#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.d.cts
|
|
7
|
-
interface $ZodCheckDef {
|
|
8
|
-
check: string;
|
|
9
|
-
error?: $ZodErrorMap<never> | undefined;
|
|
10
|
-
/** If true, no later checks will be executed if this check fails. Default `false`. */
|
|
11
|
-
abort?: boolean | undefined;
|
|
12
|
-
/** If provided, this check will only be executed if the function returns `true`. Defaults to `payload => z.util.isAborted(payload)`. */
|
|
13
|
-
when?: ((payload: ParsePayload) => boolean) | undefined;
|
|
14
|
-
}
|
|
15
|
-
interface $ZodCheckInternals<T> {
|
|
16
|
-
def: $ZodCheckDef;
|
|
17
|
-
/** The set of issues this check might throw. */
|
|
18
|
-
issc?: $ZodIssueBase;
|
|
19
|
-
check(payload: ParsePayload<T>): MaybeAsync<void>;
|
|
20
|
-
onattach: ((schema: $ZodType) => void)[];
|
|
21
|
-
}
|
|
22
|
-
interface $ZodCheck<in T = never> {
|
|
23
|
-
_zod: $ZodCheckInternals<T>;
|
|
24
|
-
}
|
|
25
|
-
declare const $ZodCheck: $constructor<$ZodCheck<any>>;
|
|
26
|
-
interface $ZodCheckMaxLengthDef extends $ZodCheckDef {
|
|
27
|
-
check: "max_length";
|
|
28
|
-
maximum: number;
|
|
29
|
-
}
|
|
30
|
-
interface $ZodCheckMaxLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
31
|
-
def: $ZodCheckMaxLengthDef;
|
|
32
|
-
issc: $ZodIssueTooBig<T>;
|
|
33
|
-
}
|
|
34
|
-
interface $ZodCheckMaxLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
35
|
-
_zod: $ZodCheckMaxLengthInternals<T>;
|
|
36
|
-
}
|
|
37
|
-
declare const $ZodCheckMaxLength: $constructor<$ZodCheckMaxLength>;
|
|
38
|
-
interface $ZodCheckMinLengthDef extends $ZodCheckDef {
|
|
39
|
-
check: "min_length";
|
|
40
|
-
minimum: number;
|
|
41
|
-
}
|
|
42
|
-
interface $ZodCheckMinLengthInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
43
|
-
def: $ZodCheckMinLengthDef;
|
|
44
|
-
issc: $ZodIssueTooSmall<T>;
|
|
45
|
-
}
|
|
46
|
-
interface $ZodCheckMinLength<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
47
|
-
_zod: $ZodCheckMinLengthInternals<T>;
|
|
48
|
-
}
|
|
49
|
-
declare const $ZodCheckMinLength: $constructor<$ZodCheckMinLength>;
|
|
50
|
-
interface $ZodCheckLengthEqualsDef extends $ZodCheckDef {
|
|
51
|
-
check: "length_equals";
|
|
52
|
-
length: number;
|
|
53
|
-
}
|
|
54
|
-
interface $ZodCheckLengthEqualsInternals<T extends HasLength = HasLength> extends $ZodCheckInternals<T> {
|
|
55
|
-
def: $ZodCheckLengthEqualsDef;
|
|
56
|
-
issc: $ZodIssueTooBig<T> | $ZodIssueTooSmall<T>;
|
|
57
|
-
}
|
|
58
|
-
interface $ZodCheckLengthEquals<T extends HasLength = HasLength> extends $ZodCheck<T> {
|
|
59
|
-
_zod: $ZodCheckLengthEqualsInternals<T>;
|
|
60
|
-
}
|
|
61
|
-
declare const $ZodCheckLengthEquals: $constructor<$ZodCheckLengthEquals>;
|
|
62
|
-
type $ZodStringFormats = "email" | "url" | "emoji" | "uuid" | "guid" | "nanoid" | "cuid" | "cuid2" | "ulid" | "xid" | "ksuid" | "datetime" | "date" | "time" | "duration" | "ipv4" | "ipv6" | "cidrv4" | "cidrv6" | "base64" | "base64url" | "json_string" | "e164" | "lowercase" | "uppercase" | "regex" | "jwt" | "starts_with" | "ends_with" | "includes";
|
|
63
|
-
//#endregion
|
|
64
|
-
export { $ZodCheck, $ZodCheckDef, $ZodCheckInternals, $ZodCheckLengthEquals, $ZodCheckMaxLength, $ZodCheckMinLength, $ZodStringFormats };
|