@es-joy/jsoe 0.26.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +10 -0
- package/.npmignore +9 -0
- package/CHANGES.md +43 -0
- package/README.md +3 -3
- package/badges/coverage-badge.svg +1 -1
- 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/eslint.config.js +36 -27
- package/package.json +12 -11
- package/pnpm-workspace.yaml +3 -2
- package/src/formats/schema.js +35 -6
- package/src/fundamentalTypes/arrayType.js +30 -6
- package/src/fundamentalTypes/stringType.js +5 -0
- package/src/typeChoices.js +3 -1
- package/src/types.js +7 -0
- package/vendor/typeson-registry/dist/index.js +83 -10
- package/vendor/zod/classic/checks.d.ts +1 -1
- package/vendor/zod/classic/checks.js +1 -1
- package/vendor/zod/classic/external.d.ts +1 -1
- package/vendor/zod/classic/external.js +1 -1
- package/vendor/zod/classic/from-json-schema.js +245 -24
- package/vendor/zod/classic/schemas.d.ts +17 -1
- package/vendor/zod/classic/schemas.js +77 -29
- package/vendor/zod/core/api.d.ts +6 -4
- package/vendor/zod/core/api.js +17 -2
- package/vendor/zod/core/checks.d.ts +1 -1
- package/vendor/zod/core/checks.js +0 -96
- package/vendor/zod/core/compile.d.ts +18 -4
- package/vendor/zod/core/compile.js +146 -67
- package/vendor/zod/core/doc.js +7 -2
- package/vendor/zod/core/errors.js +2 -5
- package/vendor/zod/core/json-schema-generator.js +2 -2
- package/vendor/zod/core/json-schema-processors.d.ts +17 -0
- package/vendor/zod/core/json-schema-processors.js +195 -64
- package/vendor/zod/core/memoizer.js +72 -23
- package/vendor/zod/core/parse.js +37 -16
- package/vendor/zod/core/regexes.d.ts +2 -0
- package/vendor/zod/core/regexes.js +8 -4
- package/vendor/zod/core/schemas.d.ts +42 -7
- package/vendor/zod/core/schemas.js +301 -94
- package/vendor/zod/core/to-json-schema.d.ts +7 -3
- package/vendor/zod/core/to-json-schema.js +8 -7
- package/vendor/zod/core/util.d.ts +25 -4
- package/vendor/zod/core/util.js +160 -143
- package/vendor/zod/core/versions.d.ts +1 -1
- package/vendor/zod/core/versions.js +2 -2
- package/vendor/zod/core/visit.js +12 -0
- 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/index.d.ts +1 -0
- package/vendor/zod/locales/index.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.d.ts +4 -0
- package/vendor/zod/locales/tg.js +116 -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/external.d.ts +1 -1
- package/vendor/zod/mini/external.js +1 -1
- package/vendor/zod/mini/schemas.d.ts +8 -0
- package/vendor/zod/mini/schemas.js +19 -2
- package/vendor/zodexy/dist/esm/index.js +34 -1
- package/vendor/zodexy/dist/schema.zodexy.json +18 -0
package/vendor/zod/locales/da.js
CHANGED
package/vendor/zod/locales/de.js
CHANGED
package/vendor/zod/locales/el.js
CHANGED
package/vendor/zod/locales/en.js
CHANGED
package/vendor/zod/locales/eo.js
CHANGED
package/vendor/zod/locales/es.js
CHANGED
package/vendor/zod/locales/fa.js
CHANGED
package/vendor/zod/locales/fi.js
CHANGED
package/vendor/zod/locales/fr.js
CHANGED
package/vendor/zod/locales/gu.js
CHANGED
package/vendor/zod/locales/he.js
CHANGED
|
@@ -78,6 +78,7 @@ const error = () => {
|
|
|
78
78
|
json_string: { label: "מחרוזת JSON", gender: "f" },
|
|
79
79
|
e164: { label: "מספר E.164", gender: "m" },
|
|
80
80
|
credit_card: { label: "מספר כרטיס אשראי", gender: "m" },
|
|
81
|
+
iban: { label: "IBAN", gender: "m" },
|
|
81
82
|
jwt: { label: "JWT", gender: "m" },
|
|
82
83
|
template_literal: { label: "קלט", gender: "m" },
|
|
83
84
|
ends_with: { label: "קלט", gender: "m" },
|
package/vendor/zod/locales/hi.js
CHANGED
package/vendor/zod/locales/hr.js
CHANGED
package/vendor/zod/locales/hu.js
CHANGED
package/vendor/zod/locales/hy.js
CHANGED
package/vendor/zod/locales/id.js
CHANGED
|
@@ -49,6 +49,7 @@ export { default as sk } from "./sk.js";
|
|
|
49
49
|
export { default as sl } from "./sl.js";
|
|
50
50
|
export { default as sv } from "./sv.js";
|
|
51
51
|
export { default as ta } from "./ta.js";
|
|
52
|
+
export { default as tg } from "./tg.js";
|
|
52
53
|
export { default as th } from "./th.js";
|
|
53
54
|
export { default as tk } from "./tk.js";
|
|
54
55
|
export { default as tr } from "./tr.js";
|
|
@@ -49,6 +49,7 @@ export { default as sk } from "./sk.js";
|
|
|
49
49
|
export { default as sl } from "./sl.js";
|
|
50
50
|
export { default as sv } from "./sv.js";
|
|
51
51
|
export { default as ta } from "./ta.js";
|
|
52
|
+
export { default as tg } from "./tg.js";
|
|
52
53
|
export { default as th } from "./th.js";
|
|
53
54
|
export { default as tk } from "./tk.js";
|
|
54
55
|
export { default as tr } from "./tr.js";
|
package/vendor/zod/locales/is.js
CHANGED
package/vendor/zod/locales/it.js
CHANGED
package/vendor/zod/locales/ja.js
CHANGED
package/vendor/zod/locales/ka.js
CHANGED
package/vendor/zod/locales/km.js
CHANGED
package/vendor/zod/locales/kn.js
CHANGED
package/vendor/zod/locales/ko.js
CHANGED
package/vendor/zod/locales/lt.js
CHANGED
package/vendor/zod/locales/mk.js
CHANGED
package/vendor/zod/locales/ms.js
CHANGED
package/vendor/zod/locales/ne.js
CHANGED
package/vendor/zod/locales/nl.js
CHANGED
package/vendor/zod/locales/nn.js
CHANGED
package/vendor/zod/locales/no.js
CHANGED
package/vendor/zod/locales/pl.js
CHANGED
package/vendor/zod/locales/ps.js
CHANGED
package/vendor/zod/locales/pt.js
CHANGED
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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as util from "../core/util.js";
|
|
2
|
+
const error = () => {
|
|
3
|
+
// singular units after numerals in Tajik
|
|
4
|
+
const Sizable = {
|
|
5
|
+
string: { unit: "аломат", verb: "дошта бошад" },
|
|
6
|
+
file: { unit: "байт", verb: "дошта бошад" },
|
|
7
|
+
array: { unit: "унсур", verb: "дошта бошад" },
|
|
8
|
+
set: { unit: "унсур", verb: "дошта бошад" },
|
|
9
|
+
map: { unit: "сабт", verb: "дошта бошад" },
|
|
10
|
+
};
|
|
11
|
+
function getSizing(origin) {
|
|
12
|
+
return Sizable[origin] ?? null;
|
|
13
|
+
}
|
|
14
|
+
const FormatDictionary = {
|
|
15
|
+
regex: "вуруд",
|
|
16
|
+
email: "суроғаи email",
|
|
17
|
+
url: "URL",
|
|
18
|
+
emoji: "эмоҷи",
|
|
19
|
+
uuid: "UUID",
|
|
20
|
+
uuidv4: "UUIDv4",
|
|
21
|
+
uuidv6: "UUIDv6",
|
|
22
|
+
nanoid: "nanoid",
|
|
23
|
+
guid: "GUID",
|
|
24
|
+
cuid: "cuid",
|
|
25
|
+
cuid2: "cuid2",
|
|
26
|
+
ulid: "ULID",
|
|
27
|
+
xid: "XID",
|
|
28
|
+
ksuid: "KSUID",
|
|
29
|
+
datetime: "санаву вақти ISO",
|
|
30
|
+
date: "санаи ISO",
|
|
31
|
+
time: "вақти ISO",
|
|
32
|
+
duration: "давомнокии ISO",
|
|
33
|
+
ipv4: "суроғаи IPv4",
|
|
34
|
+
ipv6: "суроғаи IPv6",
|
|
35
|
+
mac: "суроғаи MAC",
|
|
36
|
+
cidrv4: "маҳдудаи IPv4",
|
|
37
|
+
cidrv6: "маҳдудаи IPv6",
|
|
38
|
+
base64: "сатри дар формати base64",
|
|
39
|
+
base64url: "сатри дар формати base64url",
|
|
40
|
+
json_string: "сатри JSON",
|
|
41
|
+
e164: "рақами E.164",
|
|
42
|
+
credit_card: "рақами корти кредитӣ",
|
|
43
|
+
iban: "IBAN",
|
|
44
|
+
jwt: "JWT",
|
|
45
|
+
template_literal: "вуруд",
|
|
46
|
+
};
|
|
47
|
+
const TypeDictionary = {
|
|
48
|
+
nan: "NaN",
|
|
49
|
+
number: "рақам",
|
|
50
|
+
string: "сатр",
|
|
51
|
+
array: "массив",
|
|
52
|
+
object: "объект",
|
|
53
|
+
date: "сана",
|
|
54
|
+
};
|
|
55
|
+
return (issue) => {
|
|
56
|
+
switch (issue.code) {
|
|
57
|
+
case "invalid_type": {
|
|
58
|
+
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
|
59
|
+
const receivedType = util.parsedType(issue.input);
|
|
60
|
+
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
61
|
+
return `Вуруди нодуруст: ${expected} интизор мерафт, ${received} гирифта шуд`;
|
|
62
|
+
}
|
|
63
|
+
case "invalid_value":
|
|
64
|
+
if (issue.values.length === 1)
|
|
65
|
+
return `Вуруди нодуруст: ${util.stringifyPrimitive(issue.values[0])} интизор мерафт`;
|
|
66
|
+
return `Интихоби нодуруст: яке аз ${util.joinValues(issue.values, "|")} интизор мерафт`;
|
|
67
|
+
case "too_big": {
|
|
68
|
+
const adj = issue.inclusive ? "<=" : "<";
|
|
69
|
+
const sizing = getSizing(issue.origin);
|
|
70
|
+
if (sizing)
|
|
71
|
+
return `Хеле калон: ${issue.origin ?? "қимат"} бояд ${adj}${issue.maximum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
72
|
+
return `Хеле калон: ${issue.origin ?? "қимат"} бояд ${adj}${issue.maximum.toString()} бошад`;
|
|
73
|
+
}
|
|
74
|
+
case "too_small": {
|
|
75
|
+
const adj = issue.inclusive ? ">=" : ">";
|
|
76
|
+
const sizing = getSizing(issue.origin);
|
|
77
|
+
if (sizing)
|
|
78
|
+
return `Хеле хурд: ${issue.origin} бояд ${adj}${issue.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
|
79
|
+
return `Хеле хурд: ${issue.origin} бояд ${adj}${issue.minimum.toString()} бошад`;
|
|
80
|
+
}
|
|
81
|
+
case "invalid_format": {
|
|
82
|
+
const _issue = issue;
|
|
83
|
+
if (_issue.format === "starts_with")
|
|
84
|
+
return `Сатри нодуруст: бояд бо "${_issue.prefix}" оғоз шавад`;
|
|
85
|
+
if (_issue.format === "ends_with")
|
|
86
|
+
return `Сатри нодуруст: бояд бо "${_issue.suffix}" анҷом ёбад`;
|
|
87
|
+
if (_issue.format === "includes")
|
|
88
|
+
return `Сатри нодуруст: бояд "${_issue.includes}"-ро дар бар гирад`;
|
|
89
|
+
if (_issue.format === "regex")
|
|
90
|
+
return `Сатри нодуруст: бояд ба намунаи ${_issue.pattern} мувофиқат кунад`;
|
|
91
|
+
return `${FormatDictionary[_issue.format] ?? issue.format}-и нодуруст`;
|
|
92
|
+
}
|
|
93
|
+
case "not_multiple_of":
|
|
94
|
+
return `Рақами нодуруст: бояд ба ${issue.divisor} бе бақия тақсим шавад`;
|
|
95
|
+
case "unrecognized_keys":
|
|
96
|
+
return `Калид${issue.keys.length > 1 ? "ҳои" : "и"} номаълум: ${util.joinValues(issue.keys, ", ")}`;
|
|
97
|
+
case "invalid_key":
|
|
98
|
+
return `Калиди нодуруст дар ${issue.origin}`;
|
|
99
|
+
case "invalid_union":
|
|
100
|
+
if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {
|
|
101
|
+
const opts = issue.options.map((o) => `'${o}'`).join(" | ");
|
|
102
|
+
return `Қимати нодурусти дискриминатор: ${opts} интизор мерафт`;
|
|
103
|
+
}
|
|
104
|
+
return "Вуруди нодуруст";
|
|
105
|
+
case "invalid_element":
|
|
106
|
+
return `Қимати нодуруст дар ${issue.origin}`;
|
|
107
|
+
default:
|
|
108
|
+
return `Вуруди нодуруст`;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export default function () {
|
|
113
|
+
return {
|
|
114
|
+
localeError: error(),
|
|
115
|
+
};
|
|
116
|
+
}
|
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,
|
|
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 +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,
|
|
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";
|