@es-joy/jsoe 0.28.0 → 0.28.1
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/CHANGES.md +4 -0
- package/dist/formats/schema.d.ts.map +1 -1
- package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
- package/dist/fundamentalTypes/stringType.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/typeChoices.d.ts.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +22 -9
- package/pnpm-workspace.yaml +31 -30
- package/src/formats/schema.js +7 -14
- package/src/fundamentalTypes/arrayType.js +14 -22
- package/src/fundamentalTypes/blobType.js +16 -16
- package/src/fundamentalTypes/fileType.js +13 -13
- package/src/fundamentalTypes/regexpType.js +1 -1
- package/src/fundamentalTypes/stringType.js +5 -0
- package/src/subTypes/blobHTMLType.js +1 -1
- package/src/superTypes/dommatrixType.js +1 -1
- package/src/superTypes/errorsSpecialType.js +1 -1
- package/src/typeChoices.js +1 -3
- package/src/types.js +0 -6
- package/src/utils/media.js +3 -3
- package/vendor/jamilih/dist/jml.mjs +898 -25
- package/vendor/zod/classic/checks.d.ts +1 -1
- package/vendor/zod/classic/checks.js +1 -1
- package/vendor/zod/classic/schemas.d.ts +2 -6
- package/vendor/zod/classic/schemas.js +9 -13
- package/vendor/zod/core/api.d.ts +8 -4
- package/vendor/zod/core/api.js +11 -23
- package/vendor/zod/core/checks.d.ts +16 -0
- package/vendor/zod/core/checks.js +31 -0
- package/vendor/zod/core/compile.js +20 -24
- package/vendor/zod/core/core.js +1 -1
- package/vendor/zod/core/json-schema-processors.d.ts +0 -1
- package/vendor/zod/core/json-schema-processors.js +8 -43
- package/vendor/zod/core/memoizer.js +2 -5
- package/vendor/zod/core/regexes.d.ts +1 -0
- package/vendor/zod/core/regexes.js +2 -0
- package/vendor/zod/core/schemas.d.ts +8 -23
- package/vendor/zod/core/schemas.js +39 -80
- package/vendor/zod/core/to-json-schema.d.ts +0 -3
- package/vendor/zod/core/to-json-schema.js +1 -1
- package/vendor/zod/core/util.js +0 -4
- package/vendor/zod/core/versions.js +1 -1
- package/vendor/zod/core/visit.js +0 -12
- package/vendor/zod/locales/ar.js +1 -0
- package/vendor/zod/locales/az.js +1 -0
- package/vendor/zod/locales/be.js +1 -0
- package/vendor/zod/locales/bg.js +1 -0
- package/vendor/zod/locales/bn.js +1 -0
- package/vendor/zod/locales/ca.js +1 -0
- package/vendor/zod/locales/ckb.js +1 -0
- package/vendor/zod/locales/cs.js +1 -0
- package/vendor/zod/locales/da.js +1 -0
- package/vendor/zod/locales/de.js +1 -0
- package/vendor/zod/locales/el.js +1 -0
- package/vendor/zod/locales/en.js +1 -0
- package/vendor/zod/locales/eo.js +1 -0
- package/vendor/zod/locales/es.js +1 -0
- package/vendor/zod/locales/fa.js +1 -0
- package/vendor/zod/locales/fi.js +1 -0
- package/vendor/zod/locales/fr-CA.js +1 -0
- package/vendor/zod/locales/fr.js +1 -0
- package/vendor/zod/locales/gu.js +1 -0
- package/vendor/zod/locales/he.js +1 -0
- package/vendor/zod/locales/hi.js +1 -0
- package/vendor/zod/locales/hr.js +1 -0
- package/vendor/zod/locales/hu.js +1 -0
- package/vendor/zod/locales/hy.js +1 -0
- package/vendor/zod/locales/id.js +1 -0
- package/vendor/zod/locales/is.js +1 -0
- package/vendor/zod/locales/it.js +1 -0
- package/vendor/zod/locales/ja.js +1 -0
- package/vendor/zod/locales/ka.js +1 -0
- package/vendor/zod/locales/km.js +1 -0
- package/vendor/zod/locales/kn.js +1 -0
- package/vendor/zod/locales/ko.js +1 -0
- package/vendor/zod/locales/lt.js +1 -0
- package/vendor/zod/locales/mk.js +1 -0
- package/vendor/zod/locales/ms.js +1 -0
- package/vendor/zod/locales/ne.js +1 -0
- package/vendor/zod/locales/nl.js +1 -0
- package/vendor/zod/locales/nn.js +1 -0
- package/vendor/zod/locales/no.js +1 -0
- package/vendor/zod/locales/ota.js +1 -0
- package/vendor/zod/locales/pl.js +1 -0
- package/vendor/zod/locales/ps.js +1 -0
- package/vendor/zod/locales/pt-BR.js +1 -0
- package/vendor/zod/locales/pt.js +1 -0
- package/vendor/zod/locales/ro.js +1 -0
- package/vendor/zod/locales/ru.js +1 -0
- package/vendor/zod/locales/sk.js +1 -0
- package/vendor/zod/locales/sl.js +1 -0
- package/vendor/zod/locales/sv.js +1 -0
- package/vendor/zod/locales/ta.js +1 -0
- package/vendor/zod/locales/tg.js +1 -0
- package/vendor/zod/locales/th.js +1 -0
- package/vendor/zod/locales/tk.js +1 -0
- package/vendor/zod/locales/tr.js +1 -0
- package/vendor/zod/locales/uk.js +1 -0
- package/vendor/zod/locales/ur.js +1 -0
- package/vendor/zod/locales/uz.js +1 -0
- package/vendor/zod/locales/vi.js +1 -0
- package/vendor/zod/locales/yo.js +1 -0
- package/vendor/zod/locales/zh-CN.js +1 -0
- package/vendor/zod/locales/zh-TW.js +1 -0
- package/vendor/zod/mini/checks.d.ts +1 -1
- package/vendor/zod/mini/checks.js +1 -1
- package/vendor/zod/mini/schemas.d.ts +2 -5
- package/vendor/zod/mini/schemas.js +9 -11
- package/vendor/zodexy/dist/esm/index.js +4 -33
- package/vendor/zodexy/dist/schema.zodexy.json +1 -17
package/vendor/zod/locales/ro.js
CHANGED
package/vendor/zod/locales/ru.js
CHANGED
package/vendor/zod/locales/sk.js
CHANGED
package/vendor/zod/locales/sl.js
CHANGED
package/vendor/zod/locales/sv.js
CHANGED
package/vendor/zod/locales/ta.js
CHANGED
package/vendor/zod/locales/tg.js
CHANGED
package/vendor/zod/locales/th.js
CHANGED
package/vendor/zod/locales/tk.js
CHANGED
package/vendor/zod/locales/tr.js
CHANGED
package/vendor/zod/locales/uk.js
CHANGED
package/vendor/zod/locales/ur.js
CHANGED
package/vendor/zod/locales/uz.js
CHANGED
package/vendor/zod/locales/vi.js
CHANGED
package/vendor/zod/locales/yo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
|
1
|
+
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
|
1
|
+
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.js";
|
|
@@ -147,6 +147,7 @@ export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomS
|
|
|
147
147
|
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
|
|
148
148
|
export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
|
|
149
149
|
export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hex">;
|
|
150
|
+
export declare function currencyCode(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"currency_code">;
|
|
150
151
|
export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
|
|
151
152
|
enc?: Enc;
|
|
152
153
|
} & core.$ZodStringFormatParams): ZodMiniCustomStringFormat<`${Alg}_${Enc}`>;
|
|
@@ -367,7 +368,7 @@ export declare function _default<T extends SomeType>(innerType: T, defaultValue:
|
|
|
367
368
|
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPrefaultInternals<T>> {
|
|
368
369
|
}
|
|
369
370
|
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
|
|
370
|
-
export declare function prefault<T extends SomeType>(innerType: T, defaultValue:
|
|
371
|
+
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodMiniPrefault<T>;
|
|
371
372
|
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNonOptionalInternals<T>> {
|
|
372
373
|
}
|
|
373
374
|
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
|
|
@@ -419,10 +420,6 @@ export declare function promise<T extends SomeType>(innerType: T): ZodMiniPromis
|
|
|
419
420
|
export interface ZodMiniCustom<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodCustomInternals<O, I>> {
|
|
420
421
|
}
|
|
421
422
|
export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
|
|
422
|
-
export interface ZodMiniProperties<Shape extends core.$ZodShape = core.$ZodShape> extends _ZodMiniType<core.$ZodPropertiesInternals<Shape>>, core.$ZodProperties<Shape> {
|
|
423
|
-
}
|
|
424
|
-
export declare const ZodMiniProperties: core.$constructor<ZodMiniProperties>;
|
|
425
|
-
export declare function properties<Shape extends core.$ZodShape>(shape: Shape, params?: string | core.$ZodPropertiesParams): ZodMiniProperties<Shape>;
|
|
426
423
|
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
|
|
427
424
|
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
|
|
428
425
|
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as core from "../core/index.js";
|
|
2
|
+
import * as regexes from "../core/regexes.js";
|
|
2
3
|
import * as util from "../core/util.js";
|
|
3
4
|
import * as parse from "./parse.js";
|
|
4
5
|
export const ZodMiniType = /*@__PURE__*/ core.$constructor("ZodMiniType", (inst, def) => {
|
|
@@ -112,8 +113,8 @@ export function url(params) {
|
|
|
112
113
|
// @__NO_SIDE_EFFECTS__
|
|
113
114
|
export function httpUrl(params) {
|
|
114
115
|
return core._url(ZodMiniURL, {
|
|
115
|
-
protocol:
|
|
116
|
-
hostname:
|
|
116
|
+
protocol: regexes.httpProtocol,
|
|
117
|
+
hostname: regexes.domain,
|
|
117
118
|
...util.normalizeParams(params),
|
|
118
119
|
});
|
|
119
120
|
}
|
|
@@ -283,11 +284,15 @@ export function stringFormat(format, fnOrRegex, _params = {}) {
|
|
|
283
284
|
}
|
|
284
285
|
// @__NO_SIDE_EFFECTS__
|
|
285
286
|
export function hostname(_params) {
|
|
286
|
-
return core._stringFormat(ZodMiniCustomStringFormat, "hostname",
|
|
287
|
+
return core._stringFormat(ZodMiniCustomStringFormat, "hostname", regexes.hostname, _params);
|
|
287
288
|
}
|
|
288
289
|
// @__NO_SIDE_EFFECTS__
|
|
289
290
|
export function hex(_params) {
|
|
290
|
-
return core._stringFormat(ZodMiniCustomStringFormat, "hex",
|
|
291
|
+
return core._stringFormat(ZodMiniCustomStringFormat, "hex", regexes.hex, _params);
|
|
292
|
+
}
|
|
293
|
+
// @__NO_SIDE_EFFECTS__
|
|
294
|
+
export function currencyCode(_params) {
|
|
295
|
+
return core._stringFormat(ZodMiniCustomStringFormat, "currency_code", regexes.currencyCode, _params);
|
|
291
296
|
}
|
|
292
297
|
// @__NO_SIDE_EFFECTS__
|
|
293
298
|
export function hash(alg, params) {
|
|
@@ -918,13 +923,6 @@ export const ZodMiniCustom = /*@__PURE__*/ core.$constructor("ZodMiniCustom", (i
|
|
|
918
923
|
core.$ZodCustom.init(inst, def);
|
|
919
924
|
ZodMiniType.init(inst, def);
|
|
920
925
|
});
|
|
921
|
-
export const ZodMiniProperties = /*@__PURE__*/ core.$constructor("ZodMiniProperties", (inst, def) => {
|
|
922
|
-
core.$ZodProperties.init(inst, def);
|
|
923
|
-
ZodMiniType.init(inst, def);
|
|
924
|
-
});
|
|
925
|
-
export function properties(shape, params) {
|
|
926
|
-
return core._properties(ZodMiniProperties, shape, params);
|
|
927
|
-
}
|
|
928
926
|
// custom checks
|
|
929
927
|
// @__NO_SIDE_EFFECTS__
|
|
930
928
|
export function check(fn, params) {
|
|
@@ -27,6 +27,7 @@ var STRING_KINDS = /* @__PURE__ */ new Set([
|
|
|
27
27
|
"e164",
|
|
28
28
|
"jwt",
|
|
29
29
|
"credit_card",
|
|
30
|
+
"currency_code",
|
|
30
31
|
"iban",
|
|
31
32
|
"ipv4",
|
|
32
33
|
"ipv6",
|
|
@@ -153,6 +154,8 @@ var dezerializers = {
|
|
|
153
154
|
s2 = "length" in shape ? z.nanoid({ length: shape.length }) : z.nanoid();
|
|
154
155
|
} else if (shape.kind === "credit_card") {
|
|
155
156
|
s2 = z.creditCard();
|
|
157
|
+
} else if (shape.kind === "currency_code") {
|
|
158
|
+
s2 = z.currencyCode();
|
|
156
159
|
} else if (shape.kind !== "json_string") {
|
|
157
160
|
s2 = z[shape.kind]();
|
|
158
161
|
}
|
|
@@ -295,26 +298,6 @@ var dezerializers = {
|
|
|
295
298
|
opts.pathToSchema.set(opts.path, i);
|
|
296
299
|
return getCustomChecks(i, shape, opts);
|
|
297
300
|
}),
|
|
298
|
-
properties: ((shape, opts) => {
|
|
299
|
-
const i = z.properties(
|
|
300
|
-
{
|
|
301
|
-
...Object.fromEntries(
|
|
302
|
-
Object.entries(shape.properties).map(([key, value]) => {
|
|
303
|
-
return [
|
|
304
|
-
key,
|
|
305
|
-
checkRef(value, opts) || d(value, {
|
|
306
|
-
...opts,
|
|
307
|
-
path: opts.path + "/properties/" + key
|
|
308
|
-
})
|
|
309
|
-
];
|
|
310
|
-
})
|
|
311
|
-
)
|
|
312
|
-
},
|
|
313
|
-
getError(shape, opts)
|
|
314
|
-
);
|
|
315
|
-
opts.pathToSchema.set(opts.path, i);
|
|
316
|
-
return getCustomChecks(i, shape, opts);
|
|
317
|
-
}),
|
|
318
301
|
object: ((shape, opts) => {
|
|
319
302
|
let i = z.object(
|
|
320
303
|
{
|
|
@@ -645,7 +628,7 @@ function dezerialize(shape, opts = {}) {
|
|
|
645
628
|
import { z as z2 } from "zod";
|
|
646
629
|
|
|
647
630
|
// zodexySchema.ts
|
|
648
|
-
var zodexySchema_default = "https://github.com/brettz9/zodexy/releases/tag/v0.
|
|
631
|
+
var zodexySchema_default = "https://github.com/brettz9/zodexy/releases/tag/v0.32.0";
|
|
649
632
|
|
|
650
633
|
// zerialize.ts
|
|
651
634
|
var PRIMITIVES = {
|
|
@@ -1218,18 +1201,6 @@ var zerializers = {
|
|
|
1218
1201
|
...s(def.innerType, opts, true),
|
|
1219
1202
|
readonly: true
|
|
1220
1203
|
}),
|
|
1221
|
-
properties: (def, opts) => ({
|
|
1222
|
-
type: "properties",
|
|
1223
|
-
properties: Object.fromEntries(
|
|
1224
|
-
Object.entries(def.shape).map(([key, schema]) => [
|
|
1225
|
-
key,
|
|
1226
|
-
s(schema, {
|
|
1227
|
-
...opts,
|
|
1228
|
-
currentPath: [...opts.currentPath, "properties", key]
|
|
1229
|
-
})
|
|
1230
|
-
])
|
|
1231
|
-
)
|
|
1232
|
-
}),
|
|
1233
1204
|
custom: (_def, opts, schema) => {
|
|
1234
1205
|
const Constructor = schema._zod.bag.Class;
|
|
1235
1206
|
if (!Constructor) {
|
|
@@ -208,6 +208,7 @@
|
|
|
208
208
|
"emoji": "emoji",
|
|
209
209
|
"e164": "e164",
|
|
210
210
|
"credit_card": "credit_card",
|
|
211
|
+
"currency_code": "currency_code",
|
|
211
212
|
"iban": "iban",
|
|
212
213
|
"cuid": "cuid",
|
|
213
214
|
"cuid2": "cuid2",
|
|
@@ -710,23 +711,6 @@
|
|
|
710
711
|
}
|
|
711
712
|
}
|
|
712
713
|
},
|
|
713
|
-
{
|
|
714
|
-
"meta": { "title": "Properties" },
|
|
715
|
-
"type": "object",
|
|
716
|
-
"properties": {
|
|
717
|
-
"type": {
|
|
718
|
-
"type": "literal",
|
|
719
|
-
"values": ["properties"]
|
|
720
|
-
},
|
|
721
|
-
"properties": {
|
|
722
|
-
"type": "record",
|
|
723
|
-
"key": { "type": "string" },
|
|
724
|
-
"value": {
|
|
725
|
-
"$ref": "#/$defs/reference-or-type"
|
|
726
|
-
}
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
714
|
{
|
|
731
715
|
"meta": { "title": "Union" },
|
|
732
716
|
"type": "object",
|