flavor-code 1.3.23 → 1.4.0-beta.3

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 (156) hide show
  1. package/README.md +437 -434
  2. package/README.zh-CN.md +434 -431
  3. package/dist/agent/loop.d.ts +3 -0
  4. package/dist/{app-NTEUPJKJ.js → app-H7RYDMD3.js} +45 -157
  5. package/dist/{chunk-7OICVL2M.js → chunk-2BF7CVWZ.js} +0 -42
  6. package/dist/{chunk-VEUSROUQ.js → chunk-3BHKW5A7.js} +1 -1
  7. package/dist/{chunk-SUSLIHXO.js → chunk-IQAZ42TM.js} +1 -1
  8. package/dist/{chunk-RPFWB45Y.js → chunk-KBHWS7M6.js} +5 -5
  9. package/dist/{chunk-Z62P4LL7.js → chunk-NIKCPCJG.js} +9345 -8623
  10. package/dist/{chunk-RQTYHUMK.js → chunk-ZJCAQXA7.js} +17 -1
  11. package/dist/{claude-ink-6CEG2XZZ.js → claude-ink-ECZ6QF3P.js} +2 -3
  12. package/dist/cli-main.js +27 -11
  13. package/dist/config/load.d.ts +2 -0
  14. package/dist/desktop/main.js +1550 -816
  15. package/dist/desktop-renderer/assets/index-Bk6FYhyh.css +1 -0
  16. package/dist/desktop-renderer/assets/{index-D75ozXnZ.js → index-CYd5JkTR.js} +3 -3
  17. package/dist/desktop-renderer/assets/{interactive-terminal-CTFo4fK9.js → interactive-terminal-j52Ty3QO.js} +1 -1
  18. package/dist/desktop-renderer/index.html +2 -2
  19. package/dist/doctor.d.ts +38 -0
  20. package/dist/execution/docker.d.ts +5 -1
  21. package/dist/execution/types.d.ts +11 -0
  22. package/dist/git/service.d.ts +3 -3
  23. package/dist/git/tools.d.ts +1 -1
  24. package/dist/harness/local.d.ts +2 -0
  25. package/dist/init/project.d.ts +0 -6
  26. package/dist/jobs/registry.d.ts +2 -1
  27. package/dist/{load-4FWNXE6F.js → load-SLSL3IWR.js} +1 -1
  28. package/dist/sdk/index.js +4 -4
  29. package/dist/tools/lsp.d.ts +13 -10
  30. package/dist/tools/runtime.d.ts +2 -1
  31. package/dist/tools/search.d.ts +1 -0
  32. package/dist/tools/shell.d.ts +17 -12
  33. package/dist/tools/types.d.ts +2 -1
  34. package/dist/ui/commands.d.ts +1 -1
  35. package/dist/ui/session.d.ts +1 -0
  36. package/dist/update/check.d.ts +20 -0
  37. package/dist/utils/abort.d.ts +4 -0
  38. package/dist/utils/execFileNoThrow.d.ts +1 -0
  39. package/dist/utils/process-tree.d.ts +2 -0
  40. package/dist/utils/semver.d.ts +3 -0
  41. package/dist/utils/spawn-executable.d.ts +2 -0
  42. package/package.json +2 -2
  43. package//346/212/200/346/234/257/346/226/271/346/241/210/346/212/245/345/221/212.md +5848 -5848
  44. package/dist/astgraph/db.mjs +0 -237
  45. package/dist/astgraph/extract.mjs +0 -239
  46. package/dist/astgraph/flavor-plugin.json +0 -25
  47. package/dist/astgraph/grammars.mjs +0 -68
  48. package/dist/astgraph/index.js +0 -301
  49. package/dist/astgraph/indexer.mjs +0 -175
  50. package/dist/astgraph/query.mjs +0 -165
  51. package/dist/astgraph/resolve.mjs +0 -93
  52. package/dist/astgraph/vendor/tree-sitter-javascript.wasm +0 -0
  53. package/dist/astgraph/vendor/tree-sitter-tsx.wasm +0 -0
  54. package/dist/astgraph/vendor/tree-sitter-typescript.wasm +0 -0
  55. package/dist/astgraph/vendor/tree-sitter.js +0 -3980
  56. package/dist/astgraph/vendor/tree-sitter.wasm +0 -0
  57. package/dist/astgraph/vendor/zod/LICENSE +0 -21
  58. package/dist/astgraph/vendor/zod/index.js +0 -4
  59. package/dist/astgraph/vendor/zod/locales/index.js +0 -1
  60. package/dist/astgraph/vendor/zod/locales/package.json +0 -7
  61. package/dist/astgraph/vendor/zod/package.json +0 -135
  62. package/dist/astgraph/vendor/zod/v4/classic/checks.js +0 -1
  63. package/dist/astgraph/vendor/zod/v4/classic/coerce.js +0 -17
  64. package/dist/astgraph/vendor/zod/v4/classic/compat.js +0 -31
  65. package/dist/astgraph/vendor/zod/v4/classic/errors.js +0 -48
  66. package/dist/astgraph/vendor/zod/v4/classic/external.js +0 -20
  67. package/dist/astgraph/vendor/zod/v4/classic/from-json-schema.js +0 -599
  68. package/dist/astgraph/vendor/zod/v4/classic/index.js +0 -4
  69. package/dist/astgraph/vendor/zod/v4/classic/iso.js +0 -30
  70. package/dist/astgraph/vendor/zod/v4/classic/package.json +0 -7
  71. package/dist/astgraph/vendor/zod/v4/classic/parse.js +0 -15
  72. package/dist/astgraph/vendor/zod/v4/classic/schemas.js +0 -1395
  73. package/dist/astgraph/vendor/zod/v4/core/api.js +0 -1087
  74. package/dist/astgraph/vendor/zod/v4/core/checks.js +0 -575
  75. package/dist/astgraph/vendor/zod/v4/core/core.js +0 -78
  76. package/dist/astgraph/vendor/zod/v4/core/doc.js +0 -35
  77. package/dist/astgraph/vendor/zod/v4/core/errors.js +0 -185
  78. package/dist/astgraph/vendor/zod/v4/core/index.js +0 -16
  79. package/dist/astgraph/vendor/zod/v4/core/json-schema-generator.js +0 -95
  80. package/dist/astgraph/vendor/zod/v4/core/json-schema-processors.js +0 -601
  81. package/dist/astgraph/vendor/zod/v4/core/json-schema.js +0 -1
  82. package/dist/astgraph/vendor/zod/v4/core/package.json +0 -7
  83. package/dist/astgraph/vendor/zod/v4/core/parse.js +0 -93
  84. package/dist/astgraph/vendor/zod/v4/core/regexes.js +0 -139
  85. package/dist/astgraph/vendor/zod/v4/core/registries.js +0 -51
  86. package/dist/astgraph/vendor/zod/v4/core/schemas.js +0 -2239
  87. package/dist/astgraph/vendor/zod/v4/core/standard-schema.js +0 -1
  88. package/dist/astgraph/vendor/zod/v4/core/to-json-schema.js +0 -448
  89. package/dist/astgraph/vendor/zod/v4/core/util.js +0 -674
  90. package/dist/astgraph/vendor/zod/v4/core/versions.js +0 -5
  91. package/dist/astgraph/vendor/zod/v4/index.js +0 -3
  92. package/dist/astgraph/vendor/zod/v4/locales/ar.js +0 -106
  93. package/dist/astgraph/vendor/zod/v4/locales/az.js +0 -105
  94. package/dist/astgraph/vendor/zod/v4/locales/be.js +0 -156
  95. package/dist/astgraph/vendor/zod/v4/locales/bg.js +0 -120
  96. package/dist/astgraph/vendor/zod/v4/locales/ca.js +0 -107
  97. package/dist/astgraph/vendor/zod/v4/locales/cs.js +0 -111
  98. package/dist/astgraph/vendor/zod/v4/locales/da.js +0 -115
  99. package/dist/astgraph/vendor/zod/v4/locales/de.js +0 -108
  100. package/dist/astgraph/vendor/zod/v4/locales/el.js +0 -109
  101. package/dist/astgraph/vendor/zod/v4/locales/en.js +0 -113
  102. package/dist/astgraph/vendor/zod/v4/locales/eo.js +0 -109
  103. package/dist/astgraph/vendor/zod/v4/locales/es.js +0 -132
  104. package/dist/astgraph/vendor/zod/v4/locales/fa.js +0 -114
  105. package/dist/astgraph/vendor/zod/v4/locales/fi.js +0 -112
  106. package/dist/astgraph/vendor/zod/v4/locales/fr-CA.js +0 -107
  107. package/dist/astgraph/vendor/zod/v4/locales/fr.js +0 -125
  108. package/dist/astgraph/vendor/zod/v4/locales/he.js +0 -214
  109. package/dist/astgraph/vendor/zod/v4/locales/hr.js +0 -122
  110. package/dist/astgraph/vendor/zod/v4/locales/hu.js +0 -108
  111. package/dist/astgraph/vendor/zod/v4/locales/hy.js +0 -147
  112. package/dist/astgraph/vendor/zod/v4/locales/id.js +0 -106
  113. package/dist/astgraph/vendor/zod/v4/locales/index.js +0 -52
  114. package/dist/astgraph/vendor/zod/v4/locales/is.js +0 -109
  115. package/dist/astgraph/vendor/zod/v4/locales/it.js +0 -108
  116. package/dist/astgraph/vendor/zod/v4/locales/ja.js +0 -107
  117. package/dist/astgraph/vendor/zod/v4/locales/ka.js +0 -112
  118. package/dist/astgraph/vendor/zod/v4/locales/kh.js +0 -5
  119. package/dist/astgraph/vendor/zod/v4/locales/km.js +0 -110
  120. package/dist/astgraph/vendor/zod/v4/locales/ko.js +0 -111
  121. package/dist/astgraph/vendor/zod/v4/locales/lt.js +0 -203
  122. package/dist/astgraph/vendor/zod/v4/locales/mk.js +0 -109
  123. package/dist/astgraph/vendor/zod/v4/locales/ms.js +0 -107
  124. package/dist/astgraph/vendor/zod/v4/locales/nl.js +0 -110
  125. package/dist/astgraph/vendor/zod/v4/locales/no.js +0 -108
  126. package/dist/astgraph/vendor/zod/v4/locales/ota.js +0 -109
  127. package/dist/astgraph/vendor/zod/v4/locales/package.json +0 -7
  128. package/dist/astgraph/vendor/zod/v4/locales/pl.js +0 -109
  129. package/dist/astgraph/vendor/zod/v4/locales/ps.js +0 -114
  130. package/dist/astgraph/vendor/zod/v4/locales/pt.js +0 -108
  131. package/dist/astgraph/vendor/zod/v4/locales/ro.js +0 -119
  132. package/dist/astgraph/vendor/zod/v4/locales/ru.js +0 -156
  133. package/dist/astgraph/vendor/zod/v4/locales/sl.js +0 -109
  134. package/dist/astgraph/vendor/zod/v4/locales/sv.js +0 -110
  135. package/dist/astgraph/vendor/zod/v4/locales/ta.js +0 -110
  136. package/dist/astgraph/vendor/zod/v4/locales/th.js +0 -110
  137. package/dist/astgraph/vendor/zod/v4/locales/tr.js +0 -105
  138. package/dist/astgraph/vendor/zod/v4/locales/ua.js +0 -5
  139. package/dist/astgraph/vendor/zod/v4/locales/uk.js +0 -108
  140. package/dist/astgraph/vendor/zod/v4/locales/ur.js +0 -110
  141. package/dist/astgraph/vendor/zod/v4/locales/uz.js +0 -110
  142. package/dist/astgraph/vendor/zod/v4/locales/vi.js +0 -108
  143. package/dist/astgraph/vendor/zod/v4/locales/yo.js +0 -107
  144. package/dist/astgraph/vendor/zod/v4/locales/zh-CN.js +0 -109
  145. package/dist/astgraph/vendor/zod/v4/locales/zh-TW.js +0 -107
  146. package/dist/astgraph/vendor/zod/v4/mini/checks.js +0 -1
  147. package/dist/astgraph/vendor/zod/v4/mini/coerce.js +0 -22
  148. package/dist/astgraph/vendor/zod/v4/mini/external.js +0 -14
  149. package/dist/astgraph/vendor/zod/v4/mini/index.js +0 -3
  150. package/dist/astgraph/vendor/zod/v4/mini/iso.js +0 -34
  151. package/dist/astgraph/vendor/zod/v4/mini/package.json +0 -7
  152. package/dist/astgraph/vendor/zod/v4/mini/parse.js +0 -1
  153. package/dist/astgraph/vendor/zod/v4/mini/schemas.js +0 -961
  154. package/dist/astgraph/vendor/zod/v4/package.json +0 -7
  155. package/dist/chunk-OTYFL4AG.js +0 -16
  156. package/dist/desktop-renderer/assets/index-ZZsUx916.css +0 -1
@@ -1,110 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "tekens", verb: "heeft" },
5
- file: { unit: "bytes", verb: "heeft" },
6
- array: { unit: "elementen", verb: "heeft" },
7
- set: { unit: "elementen", verb: "heeft" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "invoer",
14
- email: "emailadres",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "ISO datum en tijd",
28
- date: "ISO datum",
29
- time: "ISO tijd",
30
- duration: "ISO duur",
31
- ipv4: "IPv4-adres",
32
- ipv6: "IPv6-adres",
33
- cidrv4: "IPv4-bereik",
34
- cidrv6: "IPv6-bereik",
35
- base64: "base64-gecodeerde tekst",
36
- base64url: "base64 URL-gecodeerde tekst",
37
- json_string: "JSON string",
38
- e164: "E.164-nummer",
39
- jwt: "JWT",
40
- template_literal: "invoer",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "getal",
45
- };
46
- return (issue) => {
47
- switch (issue.code) {
48
- case "invalid_type": {
49
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
50
- const receivedType = util.parsedType(issue.input);
51
- const received = TypeDictionary[receivedType] ?? receivedType;
52
- if (/^[A-Z]/.test(issue.expected)) {
53
- return `Ongeldige invoer: verwacht instanceof ${issue.expected}, ontving ${received}`;
54
- }
55
- return `Ongeldige invoer: verwacht ${expected}, ontving ${received}`;
56
- }
57
- case "invalid_value":
58
- if (issue.values.length === 1)
59
- return `Ongeldige invoer: verwacht ${util.stringifyPrimitive(issue.values[0])}`;
60
- return `Ongeldige optie: verwacht één van ${util.joinValues(issue.values, "|")}`;
61
- case "too_big": {
62
- const adj = issue.inclusive ? "<=" : "<";
63
- const sizing = getSizing(issue.origin);
64
- const longName = issue.origin === "date" ? "laat" : issue.origin === "string" ? "lang" : "groot";
65
- if (sizing)
66
- return `Te ${longName}: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`;
67
- return `Te ${longName}: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
68
- }
69
- case "too_small": {
70
- const adj = issue.inclusive ? ">=" : ">";
71
- const sizing = getSizing(issue.origin);
72
- const shortName = issue.origin === "date" ? "vroeg" : issue.origin === "string" ? "kort" : "klein";
73
- if (sizing) {
74
- return `Te ${shortName}: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
75
- }
76
- return `Te ${shortName}: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
77
- }
78
- case "invalid_format": {
79
- const _issue = issue;
80
- if (_issue.format === "starts_with") {
81
- return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`;
82
- }
83
- if (_issue.format === "ends_with")
84
- return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`;
85
- if (_issue.format === "includes")
86
- return `Ongeldige tekst: moet "${_issue.includes}" bevatten`;
87
- if (_issue.format === "regex")
88
- return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`;
89
- return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue.format}`;
90
- }
91
- case "not_multiple_of":
92
- return `Ongeldig getal: moet een veelvoud van ${issue.divisor} zijn`;
93
- case "unrecognized_keys":
94
- return `Onbekende key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
95
- case "invalid_key":
96
- return `Ongeldige key in ${issue.origin}`;
97
- case "invalid_union":
98
- return "Ongeldige invoer";
99
- case "invalid_element":
100
- return `Ongeldige waarde in ${issue.origin}`;
101
- default:
102
- return `Ongeldige invoer`;
103
- }
104
- };
105
- };
106
- export default function () {
107
- return {
108
- localeError: error(),
109
- };
110
- }
@@ -1,108 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "tegn", verb: "å ha" },
5
- file: { unit: "bytes", verb: "å ha" },
6
- array: { unit: "elementer", verb: "å inneholde" },
7
- set: { unit: "elementer", verb: "å inneholde" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "input",
14
- email: "e-postadresse",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "ISO dato- og klokkeslett",
28
- date: "ISO-dato",
29
- time: "ISO-klokkeslett",
30
- duration: "ISO-varighet",
31
- ipv4: "IPv4-område",
32
- ipv6: "IPv6-område",
33
- cidrv4: "IPv4-spekter",
34
- cidrv6: "IPv6-spekter",
35
- base64: "base64-enkodet streng",
36
- base64url: "base64url-enkodet streng",
37
- json_string: "JSON-streng",
38
- e164: "E.164-nummer",
39
- jwt: "JWT",
40
- template_literal: "input",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "tall",
45
- array: "liste",
46
- };
47
- return (issue) => {
48
- switch (issue.code) {
49
- case "invalid_type": {
50
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
51
- const receivedType = util.parsedType(issue.input);
52
- const received = TypeDictionary[receivedType] ?? receivedType;
53
- if (/^[A-Z]/.test(issue.expected)) {
54
- return `Ugyldig input: forventet instanceof ${issue.expected}, fikk ${received}`;
55
- }
56
- return `Ugyldig input: forventet ${expected}, fikk ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Ugyldig verdi: forventet ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Ugyldig valg: forventet en av ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing)
66
- return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
67
- return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()}`;
68
- }
69
- case "too_small": {
70
- const adj = issue.inclusive ? ">=" : ">";
71
- const sizing = getSizing(issue.origin);
72
- if (sizing) {
73
- return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
74
- }
75
- return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()}`;
76
- }
77
- case "invalid_format": {
78
- const _issue = issue;
79
- if (_issue.format === "starts_with")
80
- return `Ugyldig streng: må starte med "${_issue.prefix}"`;
81
- if (_issue.format === "ends_with")
82
- return `Ugyldig streng: må ende med "${_issue.suffix}"`;
83
- if (_issue.format === "includes")
84
- return `Ugyldig streng: må inneholde "${_issue.includes}"`;
85
- if (_issue.format === "regex")
86
- return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`;
87
- return `Ugyldig ${FormatDictionary[_issue.format] ?? issue.format}`;
88
- }
89
- case "not_multiple_of":
90
- return `Ugyldig tall: må være et multiplum av ${issue.divisor}`;
91
- case "unrecognized_keys":
92
- return `${issue.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${util.joinValues(issue.keys, ", ")}`;
93
- case "invalid_key":
94
- return `Ugyldig nøkkel i ${issue.origin}`;
95
- case "invalid_union":
96
- return "Ugyldig input";
97
- case "invalid_element":
98
- return `Ugyldig verdi i ${issue.origin}`;
99
- default:
100
- return `Ugyldig input`;
101
- }
102
- };
103
- };
104
- export default function () {
105
- return {
106
- localeError: error(),
107
- };
108
- }
@@ -1,109 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "harf", verb: "olmalıdır" },
5
- file: { unit: "bayt", verb: "olmalıdır" },
6
- array: { unit: "unsur", verb: "olmalıdır" },
7
- set: { unit: "unsur", verb: "olmalıdır" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "giren",
14
- email: "epostagâh",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "ISO hengâmı",
28
- date: "ISO tarihi",
29
- time: "ISO zamanı",
30
- duration: "ISO müddeti",
31
- ipv4: "IPv4 nişânı",
32
- ipv6: "IPv6 nişânı",
33
- cidrv4: "IPv4 menzili",
34
- cidrv6: "IPv6 menzili",
35
- base64: "base64-şifreli metin",
36
- base64url: "base64url-şifreli metin",
37
- json_string: "JSON metin",
38
- e164: "E.164 sayısı",
39
- jwt: "JWT",
40
- template_literal: "giren",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "numara",
45
- array: "saf",
46
- null: "gayb",
47
- };
48
- return (issue) => {
49
- switch (issue.code) {
50
- case "invalid_type": {
51
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
52
- const receivedType = util.parsedType(issue.input);
53
- const received = TypeDictionary[receivedType] ?? receivedType;
54
- if (/^[A-Z]/.test(issue.expected)) {
55
- return `Fâsit giren: umulan instanceof ${issue.expected}, alınan ${received}`;
56
- }
57
- return `Fâsit giren: umulan ${expected}, alınan ${received}`;
58
- }
59
- case "invalid_value":
60
- if (issue.values.length === 1)
61
- return `Fâsit giren: umulan ${util.stringifyPrimitive(issue.values[0])}`;
62
- return `Fâsit tercih: mûteberler ${util.joinValues(issue.values, "|")}`;
63
- case "too_big": {
64
- const adj = issue.inclusive ? "<=" : "<";
65
- const sizing = getSizing(issue.origin);
66
- if (sizing)
67
- return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"} sahip olmalıydı.`;
68
- return `Fazla büyük: ${issue.origin ?? "value"}, ${adj}${issue.maximum.toString()} olmalıydı.`;
69
- }
70
- case "too_small": {
71
- const adj = issue.inclusive ? ">=" : ">";
72
- const sizing = getSizing(issue.origin);
73
- if (sizing) {
74
- return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} ${sizing.unit} sahip olmalıydı.`;
75
- }
76
- return `Fazla küçük: ${issue.origin}, ${adj}${issue.minimum.toString()} olmalıydı.`;
77
- }
78
- case "invalid_format": {
79
- const _issue = issue;
80
- if (_issue.format === "starts_with")
81
- return `Fâsit metin: "${_issue.prefix}" ile başlamalı.`;
82
- if (_issue.format === "ends_with")
83
- return `Fâsit metin: "${_issue.suffix}" ile bitmeli.`;
84
- if (_issue.format === "includes")
85
- return `Fâsit metin: "${_issue.includes}" ihtivâ etmeli.`;
86
- if (_issue.format === "regex")
87
- return `Fâsit metin: ${_issue.pattern} nakşına uymalı.`;
88
- return `Fâsit ${FormatDictionary[_issue.format] ?? issue.format}`;
89
- }
90
- case "not_multiple_of":
91
- return `Fâsit sayı: ${issue.divisor} katı olmalıydı.`;
92
- case "unrecognized_keys":
93
- return `Tanınmayan anahtar ${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
94
- case "invalid_key":
95
- return `${issue.origin} için tanınmayan anahtar var.`;
96
- case "invalid_union":
97
- return "Giren tanınamadı.";
98
- case "invalid_element":
99
- return `${issue.origin} için tanınmayan kıymet var.`;
100
- default:
101
- return `Kıymet tanınamadı.`;
102
- }
103
- };
104
- };
105
- export default function () {
106
- return {
107
- localeError: error(),
108
- };
109
- }
@@ -1,7 +0,0 @@
1
- {
2
- "type": "module",
3
- "main": "./index.cjs",
4
- "module": "./index.js",
5
- "types": "./index.d.cts",
6
- "sideEffects": false
7
- }
@@ -1,109 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "znaków", verb: "mieć" },
5
- file: { unit: "bajtów", verb: "mieć" },
6
- array: { unit: "elementów", verb: "mieć" },
7
- set: { unit: "elementów", verb: "mieć" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "wyrażenie",
14
- email: "adres email",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "data i godzina w formacie ISO",
28
- date: "data w formacie ISO",
29
- time: "godzina w formacie ISO",
30
- duration: "czas trwania ISO",
31
- ipv4: "adres IPv4",
32
- ipv6: "adres IPv6",
33
- cidrv4: "zakres IPv4",
34
- cidrv6: "zakres IPv6",
35
- base64: "ciąg znaków zakodowany w formacie base64",
36
- base64url: "ciąg znaków zakodowany w formacie base64url",
37
- json_string: "ciąg znaków w formacie JSON",
38
- e164: "liczba E.164",
39
- jwt: "JWT",
40
- template_literal: "wejście",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "liczba",
45
- array: "tablica",
46
- };
47
- return (issue) => {
48
- switch (issue.code) {
49
- case "invalid_type": {
50
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
51
- const receivedType = util.parsedType(issue.input);
52
- const received = TypeDictionary[receivedType] ?? receivedType;
53
- if (/^[A-Z]/.test(issue.expected)) {
54
- return `Nieprawidłowe dane wejściowe: oczekiwano instanceof ${issue.expected}, otrzymano ${received}`;
55
- }
56
- return `Nieprawidłowe dane wejściowe: oczekiwano ${expected}, otrzymano ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Nieprawidłowe dane wejściowe: oczekiwano ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing) {
66
- return `Za duża wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementów"}`;
67
- }
68
- return `Zbyt duż(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.maximum.toString()}`;
69
- }
70
- case "too_small": {
71
- const adj = issue.inclusive ? ">=" : ">";
72
- const sizing = getSizing(issue.origin);
73
- if (sizing) {
74
- return `Za mała wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.minimum.toString()} ${sizing.unit ?? "elementów"}`;
75
- }
76
- return `Zbyt mał(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.minimum.toString()}`;
77
- }
78
- case "invalid_format": {
79
- const _issue = issue;
80
- if (_issue.format === "starts_with")
81
- return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`;
82
- if (_issue.format === "ends_with")
83
- return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`;
84
- if (_issue.format === "includes")
85
- return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`;
86
- if (_issue.format === "regex")
87
- return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`;
88
- return `Nieprawidłow(y/a/e) ${FormatDictionary[_issue.format] ?? issue.format}`;
89
- }
90
- case "not_multiple_of":
91
- return `Nieprawidłowa liczba: musi być wielokrotnością ${issue.divisor}`;
92
- case "unrecognized_keys":
93
- return `Nierozpoznane klucze${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
94
- case "invalid_key":
95
- return `Nieprawidłowy klucz w ${issue.origin}`;
96
- case "invalid_union":
97
- return "Nieprawidłowe dane wejściowe";
98
- case "invalid_element":
99
- return `Nieprawidłowa wartość w ${issue.origin}`;
100
- default:
101
- return `Nieprawidłowe dane wejściowe`;
102
- }
103
- };
104
- };
105
- export default function () {
106
- return {
107
- localeError: error(),
108
- };
109
- }
@@ -1,114 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "توکي", verb: "ولري" },
5
- file: { unit: "بایټس", verb: "ولري" },
6
- array: { unit: "توکي", verb: "ولري" },
7
- set: { unit: "توکي", verb: "ولري" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "ورودي",
14
- email: "بریښنالیک",
15
- url: "یو آر ال",
16
- emoji: "ایموجي",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "نیټه او وخت",
28
- date: "نېټه",
29
- time: "وخت",
30
- duration: "موده",
31
- ipv4: "د IPv4 پته",
32
- ipv6: "د IPv6 پته",
33
- cidrv4: "د IPv4 ساحه",
34
- cidrv6: "د IPv6 ساحه",
35
- base64: "base64-encoded متن",
36
- base64url: "base64url-encoded متن",
37
- json_string: "JSON متن",
38
- e164: "د E.164 شمېره",
39
- jwt: "JWT",
40
- template_literal: "ورودي",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "عدد",
45
- array: "ارې",
46
- };
47
- return (issue) => {
48
- switch (issue.code) {
49
- case "invalid_type": {
50
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
51
- const receivedType = util.parsedType(issue.input);
52
- const received = TypeDictionary[receivedType] ?? receivedType;
53
- if (/^[A-Z]/.test(issue.expected)) {
54
- return `ناسم ورودي: باید instanceof ${issue.expected} وای, مګر ${received} ترلاسه شو`;
55
- }
56
- return `ناسم ورودي: باید ${expected} وای, مګر ${received} ترلاسه شو`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1) {
60
- return `ناسم ورودي: باید ${util.stringifyPrimitive(issue.values[0])} وای`;
61
- }
62
- return `ناسم انتخاب: باید یو له ${util.joinValues(issue.values, "|")} څخه وای`;
63
- case "too_big": {
64
- const adj = issue.inclusive ? "<=" : "<";
65
- const sizing = getSizing(issue.origin);
66
- if (sizing) {
67
- return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
68
- }
69
- return `ډیر لوی: ${issue.origin ?? "ارزښت"} باید ${adj}${issue.maximum.toString()} وي`;
70
- }
71
- case "too_small": {
72
- const adj = issue.inclusive ? ">=" : ">";
73
- const sizing = getSizing(issue.origin);
74
- if (sizing) {
75
- return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} ${sizing.unit} ولري`;
76
- }
77
- return `ډیر کوچنی: ${issue.origin} باید ${adj}${issue.minimum.toString()} وي`;
78
- }
79
- case "invalid_format": {
80
- const _issue = issue;
81
- if (_issue.format === "starts_with") {
82
- return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
83
- }
84
- if (_issue.format === "ends_with") {
85
- return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
86
- }
87
- if (_issue.format === "includes") {
88
- return `ناسم متن: باید "${_issue.includes}" ولري`;
89
- }
90
- if (_issue.format === "regex") {
91
- return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
92
- }
93
- return `${FormatDictionary[_issue.format] ?? issue.format} ناسم دی`;
94
- }
95
- case "not_multiple_of":
96
- return `ناسم عدد: باید د ${issue.divisor} مضرب وي`;
97
- case "unrecognized_keys":
98
- return `ناسم ${issue.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${util.joinValues(issue.keys, ", ")}`;
99
- case "invalid_key":
100
- return `ناسم کلیډ په ${issue.origin} کې`;
101
- case "invalid_union":
102
- return `ناسمه ورودي`;
103
- case "invalid_element":
104
- return `ناسم عنصر په ${issue.origin} کې`;
105
- default:
106
- return `ناسمه ورودي`;
107
- }
108
- };
109
- };
110
- export default function () {
111
- return {
112
- localeError: error(),
113
- };
114
- }
@@ -1,108 +0,0 @@
1
- import * as util from "../core/util.js";
2
- const error = () => {
3
- const Sizable = {
4
- string: { unit: "caracteres", verb: "ter" },
5
- file: { unit: "bytes", verb: "ter" },
6
- array: { unit: "itens", verb: "ter" },
7
- set: { unit: "itens", verb: "ter" },
8
- };
9
- function getSizing(origin) {
10
- return Sizable[origin] ?? null;
11
- }
12
- const FormatDictionary = {
13
- regex: "padrão",
14
- email: "endereço de e-mail",
15
- url: "URL",
16
- emoji: "emoji",
17
- uuid: "UUID",
18
- uuidv4: "UUIDv4",
19
- uuidv6: "UUIDv6",
20
- nanoid: "nanoid",
21
- guid: "GUID",
22
- cuid: "cuid",
23
- cuid2: "cuid2",
24
- ulid: "ULID",
25
- xid: "XID",
26
- ksuid: "KSUID",
27
- datetime: "data e hora ISO",
28
- date: "data ISO",
29
- time: "hora ISO",
30
- duration: "duração ISO",
31
- ipv4: "endereço IPv4",
32
- ipv6: "endereço IPv6",
33
- cidrv4: "faixa de IPv4",
34
- cidrv6: "faixa de IPv6",
35
- base64: "texto codificado em base64",
36
- base64url: "URL codificada em base64",
37
- json_string: "texto JSON",
38
- e164: "número E.164",
39
- jwt: "JWT",
40
- template_literal: "entrada",
41
- };
42
- const TypeDictionary = {
43
- nan: "NaN",
44
- number: "número",
45
- null: "nulo",
46
- };
47
- return (issue) => {
48
- switch (issue.code) {
49
- case "invalid_type": {
50
- const expected = TypeDictionary[issue.expected] ?? issue.expected;
51
- const receivedType = util.parsedType(issue.input);
52
- const received = TypeDictionary[receivedType] ?? receivedType;
53
- if (/^[A-Z]/.test(issue.expected)) {
54
- return `Tipo inválido: esperado instanceof ${issue.expected}, recebido ${received}`;
55
- }
56
- return `Tipo inválido: esperado ${expected}, recebido ${received}`;
57
- }
58
- case "invalid_value":
59
- if (issue.values.length === 1)
60
- return `Entrada inválida: esperado ${util.stringifyPrimitive(issue.values[0])}`;
61
- return `Opção inválida: esperada uma das ${util.joinValues(issue.values, "|")}`;
62
- case "too_big": {
63
- const adj = issue.inclusive ? "<=" : "<";
64
- const sizing = getSizing(issue.origin);
65
- if (sizing)
66
- return `Muito grande: esperado que ${issue.origin ?? "valor"} tivesse ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementos"}`;
67
- return `Muito grande: esperado que ${issue.origin ?? "valor"} fosse ${adj}${issue.maximum.toString()}`;
68
- }
69
- case "too_small": {
70
- const adj = issue.inclusive ? ">=" : ">";
71
- const sizing = getSizing(issue.origin);
72
- if (sizing) {
73
- return `Muito pequeno: esperado que ${issue.origin} tivesse ${adj}${issue.minimum.toString()} ${sizing.unit}`;
74
- }
75
- return `Muito pequeno: esperado que ${issue.origin} fosse ${adj}${issue.minimum.toString()}`;
76
- }
77
- case "invalid_format": {
78
- const _issue = issue;
79
- if (_issue.format === "starts_with")
80
- return `Texto inválido: deve começar com "${_issue.prefix}"`;
81
- if (_issue.format === "ends_with")
82
- return `Texto inválido: deve terminar com "${_issue.suffix}"`;
83
- if (_issue.format === "includes")
84
- return `Texto inválido: deve incluir "${_issue.includes}"`;
85
- if (_issue.format === "regex")
86
- return `Texto inválido: deve corresponder ao padrão ${_issue.pattern}`;
87
- return `${FormatDictionary[_issue.format] ?? issue.format} inválido`;
88
- }
89
- case "not_multiple_of":
90
- return `Número inválido: deve ser múltiplo de ${issue.divisor}`;
91
- case "unrecognized_keys":
92
- return `Chave${issue.keys.length > 1 ? "s" : ""} desconhecida${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
93
- case "invalid_key":
94
- return `Chave inválida em ${issue.origin}`;
95
- case "invalid_union":
96
- return "Entrada inválida";
97
- case "invalid_element":
98
- return `Valor inválido em ${issue.origin}`;
99
- default:
100
- return `Campo inválido`;
101
- }
102
- };
103
- };
104
- export default function () {
105
- return {
106
- localeError: error(),
107
- };
108
- }