@es-joy/jsoe 0.24.2 → 0.25.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.
Files changed (525) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/.ncurc.cjs +2 -2
  3. package/CHANGES.md +51 -0
  4. package/README.md +23 -13
  5. package/badges/coverage-badge.svg +1 -1
  6. package/dist/eslint.config.d.ts +3 -0
  7. package/dist/eslint.config.d.ts.map +1 -0
  8. package/dist/formatAndTypeChoices.d.ts +28 -30
  9. package/dist/formatAndTypeChoices.d.ts.map +1 -1
  10. package/dist/formats/indexedDBKey.d.ts.map +1 -1
  11. package/dist/formats/schema.d.ts +46 -3
  12. package/dist/formats/schema.d.ts.map +1 -1
  13. package/dist/formats/structuredCloning.d.ts +3 -0
  14. package/dist/formats/structuredCloning.d.ts.map +1 -1
  15. package/dist/formats.d.ts +24 -6
  16. package/dist/formats.d.ts.map +1 -1
  17. package/dist/fundamentalTypes/BooleanObjectType.d.ts.map +1 -1
  18. package/dist/fundamentalTypes/NumberObjectType.d.ts.map +1 -1
  19. package/dist/fundamentalTypes/StringObjectType.d.ts.map +1 -1
  20. package/dist/fundamentalTypes/arrayReferenceType.d.ts.map +1 -1
  21. package/dist/fundamentalTypes/arrayType.d.ts +7 -0
  22. package/dist/fundamentalTypes/arrayType.d.ts.map +1 -1
  23. package/dist/fundamentalTypes/bigintObjectType.d.ts.map +1 -1
  24. package/dist/fundamentalTypes/bigintType.d.ts +10 -0
  25. package/dist/fundamentalTypes/bigintType.d.ts.map +1 -1
  26. package/dist/fundamentalTypes/blobType.d.ts.map +1 -1
  27. package/dist/fundamentalTypes/booleanType.d.ts.map +1 -1
  28. package/dist/fundamentalTypes/catchType.d.ts +2 -2
  29. package/dist/fundamentalTypes/catchType.d.ts.map +1 -1
  30. package/dist/fundamentalTypes/dateType.d.ts.map +1 -1
  31. package/dist/fundamentalTypes/domexceptionType.d.ts.map +1 -1
  32. package/dist/fundamentalTypes/enumType.d.ts +2 -2
  33. package/dist/fundamentalTypes/enumType.d.ts.map +1 -1
  34. package/dist/fundamentalTypes/errorType.d.ts.map +1 -1
  35. package/dist/fundamentalTypes/fileType.d.ts +6 -0
  36. package/dist/fundamentalTypes/fileType.d.ts.map +1 -1
  37. package/dist/fundamentalTypes/functionType.d.ts.map +1 -1
  38. package/dist/fundamentalTypes/literalType.d.ts +3 -2
  39. package/dist/fundamentalTypes/literalType.d.ts.map +1 -1
  40. package/dist/fundamentalTypes/looseRecordType.d.ts +6 -0
  41. package/dist/fundamentalTypes/looseRecordType.d.ts.map +1 -0
  42. package/dist/fundamentalTypes/nanType.d.ts.map +1 -1
  43. package/dist/fundamentalTypes/neverType.d.ts +2 -2
  44. package/dist/fundamentalTypes/neverType.d.ts.map +1 -1
  45. package/dist/fundamentalTypes/noneditableType.d.ts.map +1 -1
  46. package/dist/fundamentalTypes/nullType.d.ts.map +1 -1
  47. package/dist/fundamentalTypes/numberType.d.ts.map +1 -1
  48. package/dist/fundamentalTypes/promiseType.d.ts.map +1 -1
  49. package/dist/fundamentalTypes/regexpType.d.ts.map +1 -1
  50. package/dist/fundamentalTypes/stringType.d.ts.map +1 -1
  51. package/dist/fundamentalTypes/symbolType.d.ts.map +1 -1
  52. package/dist/fundamentalTypes/undefinedType.d.ts.map +1 -1
  53. package/dist/fundamentalTypes/voidType.d.ts +2 -2
  54. package/dist/fundamentalTypes/voidType.d.ts.map +1 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +6 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/rollup.config.d.ts +30 -0
  59. package/dist/rollup.config.d.ts.map +1 -0
  60. package/dist/server.d.ts +2 -0
  61. package/dist/server.d.ts.map +1 -0
  62. package/dist/src/formatAndTypeChoices.d.ts +108 -0
  63. package/dist/src/formatAndTypeChoices.d.ts.map +1 -0
  64. package/dist/src/formats/arbitraryJS.d.ts +4 -0
  65. package/dist/src/formats/arbitraryJS.d.ts.map +1 -0
  66. package/dist/src/formats/indexedDBKey.d.ts +4 -0
  67. package/dist/src/formats/indexedDBKey.d.ts.map +1 -0
  68. package/dist/src/formats/json.d.ts +4 -0
  69. package/dist/src/formats/json.d.ts.map +1 -0
  70. package/dist/src/formats/schema.d.ts +17 -0
  71. package/dist/src/formats/schema.d.ts.map +1 -0
  72. package/dist/src/formats/structuredCloning.d.ts +19 -0
  73. package/dist/src/formats/structuredCloning.d.ts.map +1 -0
  74. package/dist/src/formats.d.ts +135 -0
  75. package/dist/src/formats.d.ts.map +1 -0
  76. package/dist/src/fundamentalTypes/BooleanObjectType.d.ts +8 -0
  77. package/dist/src/fundamentalTypes/BooleanObjectType.d.ts.map +1 -0
  78. package/dist/src/fundamentalTypes/NumberObjectType.d.ts +6 -0
  79. package/dist/src/fundamentalTypes/NumberObjectType.d.ts.map +1 -0
  80. package/dist/src/fundamentalTypes/StringObjectType.d.ts +6 -0
  81. package/dist/src/fundamentalTypes/StringObjectType.d.ts.map +1 -0
  82. package/dist/src/fundamentalTypes/arrayReferenceType.d.ts +8 -0
  83. package/dist/src/fundamentalTypes/arrayReferenceType.d.ts.map +1 -0
  84. package/dist/src/fundamentalTypes/arrayType.d.ts +29 -0
  85. package/dist/src/fundamentalTypes/arrayType.d.ts.map +1 -0
  86. package/dist/src/fundamentalTypes/bigintObjectType.d.ts +6 -0
  87. package/dist/src/fundamentalTypes/bigintObjectType.d.ts.map +1 -0
  88. package/dist/src/fundamentalTypes/bigintType.d.ts +6 -0
  89. package/dist/src/fundamentalTypes/bigintType.d.ts.map +1 -0
  90. package/dist/src/fundamentalTypes/blobType.d.ts +11 -0
  91. package/dist/src/fundamentalTypes/blobType.d.ts.map +1 -0
  92. package/dist/src/fundamentalTypes/booleanType.d.ts +8 -0
  93. package/dist/src/fundamentalTypes/booleanType.d.ts.map +1 -0
  94. package/dist/src/fundamentalTypes/catchType.d.ts +6 -0
  95. package/dist/src/fundamentalTypes/catchType.d.ts.map +1 -0
  96. package/dist/src/fundamentalTypes/dateType.d.ts +26 -0
  97. package/dist/src/fundamentalTypes/dateType.d.ts.map +1 -0
  98. package/dist/src/fundamentalTypes/domexceptionType.d.ts +6 -0
  99. package/dist/src/fundamentalTypes/domexceptionType.d.ts.map +1 -0
  100. package/dist/src/fundamentalTypes/enumType.d.ts +6 -0
  101. package/dist/src/fundamentalTypes/enumType.d.ts.map +1 -0
  102. package/dist/src/fundamentalTypes/errorType.d.ts +6 -0
  103. package/dist/src/fundamentalTypes/errorType.d.ts.map +1 -0
  104. package/dist/src/fundamentalTypes/fileType.d.ts +13 -0
  105. package/dist/src/fundamentalTypes/fileType.d.ts.map +1 -0
  106. package/dist/src/fundamentalTypes/filelistType.d.ts +6 -0
  107. package/dist/src/fundamentalTypes/filelistType.d.ts.map +1 -0
  108. package/dist/src/fundamentalTypes/functionType.d.ts +7 -0
  109. package/dist/src/fundamentalTypes/functionType.d.ts.map +1 -0
  110. package/dist/src/fundamentalTypes/literalType.d.ts +6 -0
  111. package/dist/src/fundamentalTypes/literalType.d.ts.map +1 -0
  112. package/dist/src/fundamentalTypes/mapType.d.ts +6 -0
  113. package/dist/src/fundamentalTypes/mapType.d.ts.map +1 -0
  114. package/dist/src/fundamentalTypes/nanType.d.ts +6 -0
  115. package/dist/src/fundamentalTypes/nanType.d.ts.map +1 -0
  116. package/dist/src/fundamentalTypes/neverType.d.ts +6 -0
  117. package/dist/src/fundamentalTypes/neverType.d.ts.map +1 -0
  118. package/dist/src/fundamentalTypes/noneditableType.d.ts +6 -0
  119. package/dist/src/fundamentalTypes/noneditableType.d.ts.map +1 -0
  120. package/dist/src/fundamentalTypes/nullType.d.ts +6 -0
  121. package/dist/src/fundamentalTypes/nullType.d.ts.map +1 -0
  122. package/dist/src/fundamentalTypes/numberType.d.ts +6 -0
  123. package/dist/src/fundamentalTypes/numberType.d.ts.map +1 -0
  124. package/dist/src/fundamentalTypes/objectReferenceType.d.ts +8 -0
  125. package/dist/src/fundamentalTypes/objectReferenceType.d.ts.map +1 -0
  126. package/dist/src/fundamentalTypes/objectType.d.ts +6 -0
  127. package/dist/src/fundamentalTypes/objectType.d.ts.map +1 -0
  128. package/dist/src/fundamentalTypes/promiseType.d.ts +6 -0
  129. package/dist/src/fundamentalTypes/promiseType.d.ts.map +1 -0
  130. package/dist/src/fundamentalTypes/recordType.d.ts +6 -0
  131. package/dist/src/fundamentalTypes/recordType.d.ts.map +1 -0
  132. package/dist/src/fundamentalTypes/regexpType.d.ts +8 -0
  133. package/dist/src/fundamentalTypes/regexpType.d.ts.map +1 -0
  134. package/dist/src/fundamentalTypes/setType.d.ts +6 -0
  135. package/dist/src/fundamentalTypes/setType.d.ts.map +1 -0
  136. package/dist/src/fundamentalTypes/sparseUndefinedType.d.ts +6 -0
  137. package/dist/src/fundamentalTypes/sparseUndefinedType.d.ts.map +1 -0
  138. package/dist/src/fundamentalTypes/stringType.d.ts +6 -0
  139. package/dist/src/fundamentalTypes/stringType.d.ts.map +1 -0
  140. package/dist/src/fundamentalTypes/symbolType.d.ts +8 -0
  141. package/dist/src/fundamentalTypes/symbolType.d.ts.map +1 -0
  142. package/dist/src/fundamentalTypes/tupleType.d.ts +6 -0
  143. package/dist/src/fundamentalTypes/tupleType.d.ts.map +1 -0
  144. package/dist/src/fundamentalTypes/undefinedType.d.ts +6 -0
  145. package/dist/src/fundamentalTypes/undefinedType.d.ts.map +1 -0
  146. package/dist/src/fundamentalTypes/voidType.d.ts +6 -0
  147. package/dist/src/fundamentalTypes/voidType.d.ts.map +1 -0
  148. package/dist/src/index.d.ts +12 -0
  149. package/dist/src/index.d.ts.map +1 -0
  150. package/dist/src/subTypes/blobHTMLType.d.ts +20 -0
  151. package/dist/src/subTypes/blobHTMLType.d.ts.map +1 -0
  152. package/dist/src/subTypes/falseType.d.ts +8 -0
  153. package/dist/src/subTypes/falseType.d.ts.map +1 -0
  154. package/dist/src/subTypes/trueType.d.ts +8 -0
  155. package/dist/src/subTypes/trueType.d.ts.map +1 -0
  156. package/dist/src/superTypes/SpecialNumberType.d.ts +6 -0
  157. package/dist/src/superTypes/SpecialNumberType.d.ts.map +1 -0
  158. package/dist/src/superTypes/SpecialRealNumberType.d.ts +6 -0
  159. package/dist/src/superTypes/SpecialRealNumberType.d.ts.map +1 -0
  160. package/dist/src/superTypes/buffersourceType.d.ts +8 -0
  161. package/dist/src/superTypes/buffersourceType.d.ts.map +1 -0
  162. package/dist/src/superTypes/dommatrixType.d.ts +6 -0
  163. package/dist/src/superTypes/dommatrixType.d.ts.map +1 -0
  164. package/dist/src/superTypes/dompointType.d.ts +6 -0
  165. package/dist/src/superTypes/dompointType.d.ts.map +1 -0
  166. package/dist/src/superTypes/domrectType.d.ts +6 -0
  167. package/dist/src/superTypes/domrectType.d.ts.map +1 -0
  168. package/dist/src/superTypes/errorsSpecialType.d.ts +8 -0
  169. package/dist/src/superTypes/errorsSpecialType.d.ts.map +1 -0
  170. package/dist/src/typeChoices.d.ts +140 -0
  171. package/dist/src/typeChoices.d.ts.map +1 -0
  172. package/dist/src/types.d.ts +758 -0
  173. package/dist/src/types.d.ts.map +1 -0
  174. package/dist/src/utils/FileList.d.ts +26 -0
  175. package/dist/src/utils/FileList.d.ts.map +1 -0
  176. package/dist/src/utils/dialogs.d.ts +111 -0
  177. package/dist/src/utils/dialogs.d.ts.map +1 -0
  178. package/dist/src/utils/jsonPointer.d.ts +46 -0
  179. package/dist/src/utils/jsonPointer.d.ts.map +1 -0
  180. package/dist/src/utils/media.d.ts +18 -0
  181. package/dist/src/utils/media.d.ts.map +1 -0
  182. package/dist/src/utils/objects.d.ts +16 -0
  183. package/dist/src/utils/objects.d.ts.map +1 -0
  184. package/dist/src/utils/templateUtils.d.ts +59 -0
  185. package/dist/src/utils/templateUtils.d.ts.map +1 -0
  186. package/dist/src/utils/types.d.ts +2 -0
  187. package/dist/src/utils/types.d.ts.map +1 -0
  188. package/dist/src/vendor-imports.d.ts +4 -0
  189. package/dist/src/vendor-imports.d.ts.map +1 -0
  190. package/dist/subTypes/blobHTMLType.d.ts.map +1 -1
  191. package/dist/superTypes/SpecialRealNumberType.d.ts.map +1 -1
  192. package/dist/superTypes/buffersourceType.d.ts.map +1 -1
  193. package/dist/superTypes/dommatrixType.d.ts.map +1 -1
  194. package/dist/superTypes/dompointType.d.ts.map +1 -1
  195. package/dist/superTypes/domrectType.d.ts.map +1 -1
  196. package/dist/superTypes/errorsSpecialType.d.ts.map +1 -1
  197. package/dist/typeChoices.d.ts +21 -87
  198. package/dist/typeChoices.d.ts.map +1 -1
  199. package/dist/types.d.ts +90 -64
  200. package/dist/types.d.ts.map +1 -1
  201. package/dist/utils/FileList.d.ts +4 -3
  202. package/dist/utils/FileList.d.ts.map +1 -1
  203. package/dist/utils/dialogs.d.ts +4 -4
  204. package/dist/utils/dialogs.d.ts.map +1 -1
  205. package/dist/utils/media.d.ts.map +1 -1
  206. package/dist/utils/schemaMeta.d.ts +92 -0
  207. package/dist/utils/schemaMeta.d.ts.map +1 -0
  208. package/dist/utils/templateUtils.d.ts +3 -3
  209. package/dist/utils/templateUtils.d.ts.map +1 -1
  210. package/dist/utils/timing.d.ts +2 -0
  211. package/dist/utils/timing.d.ts.map +1 -0
  212. package/dist/utils/types.d.ts +1 -0
  213. package/dist/utils/types.d.ts.map +1 -1
  214. package/dist/vendor-imports.d.ts +3 -1
  215. package/docs/proposals/schema-meta.md +233 -0
  216. package/eslint.config.js +51 -4
  217. package/licenseInfo.json +1 -1
  218. package/package.json +52 -42
  219. package/pnpm-workspace.yaml +57 -0
  220. package/rollup.config.js +20 -18
  221. package/server.js +3 -3
  222. package/src/deepEqual.js +77 -66
  223. package/src/deepEqual.js.map +1 -1
  224. package/src/formatAndTypeChoices.js +62 -58
  225. package/src/formats/indexedDBKey.js +3 -4
  226. package/src/formats/schema.js +824 -475
  227. package/src/formats/structuredCloning.js +189 -80
  228. package/src/formats.js +17 -5
  229. package/src/fundamentalTypes/BooleanObjectType.js +4 -5
  230. package/src/fundamentalTypes/NumberObjectType.js +4 -4
  231. package/src/fundamentalTypes/StringObjectType.js +3 -4
  232. package/src/fundamentalTypes/arrayReferenceType.js +0 -2
  233. package/src/fundamentalTypes/arrayType.js +624 -389
  234. package/src/fundamentalTypes/bigintObjectType.js +3 -2
  235. package/src/fundamentalTypes/bigintType.js +79 -17
  236. package/src/fundamentalTypes/blobType.js +35 -35
  237. package/src/fundamentalTypes/booleanType.js +16 -8
  238. package/src/fundamentalTypes/dateType.js +6 -8
  239. package/src/fundamentalTypes/domexceptionType.js +5 -4
  240. package/src/fundamentalTypes/errorType.js +39 -32
  241. package/src/fundamentalTypes/fileType.js +238 -52
  242. package/src/fundamentalTypes/functionType.js +61 -41
  243. package/src/fundamentalTypes/nanType.js +5 -4
  244. package/src/fundamentalTypes/noneditableType.js +4 -3
  245. package/src/fundamentalTypes/nullType.js +3 -2
  246. package/src/fundamentalTypes/numberType.js +72 -20
  247. package/src/fundamentalTypes/promiseType.js +16 -40
  248. package/src/fundamentalTypes/regexpType.js +7 -13
  249. package/src/fundamentalTypes/stringType.js +176 -110
  250. package/src/fundamentalTypes/symbolType.js +3 -2
  251. package/src/fundamentalTypes/undefinedType.js +3 -2
  252. package/src/index.js +6 -5
  253. package/src/jsoe.css +107 -8
  254. package/src/subTypes/blobHTMLType.js +23 -10
  255. package/src/superTypes/SpecialNumberType.js +6 -6
  256. package/src/superTypes/SpecialRealNumberType.js +10 -9
  257. package/src/superTypes/buffersourceType.js +86 -75
  258. package/src/superTypes/dommatrixType.js +6 -5
  259. package/src/superTypes/dompointType.js +6 -5
  260. package/src/superTypes/domrectType.js +6 -5
  261. package/src/superTypes/errorsSpecialType.js +54 -35
  262. package/src/typeChoices.js +373 -53
  263. package/src/types.js +157 -97
  264. package/src/utils/FileList.js +3 -3
  265. package/src/utils/dialogs.js +5 -7
  266. package/src/utils/jsonPointer.js +1 -1
  267. package/src/utils/media.js +1 -0
  268. package/src/utils/schemaMeta.js +257 -0
  269. package/src/utils/templateUtils.js +3 -3
  270. package/src/utils/timing.js +12 -0
  271. package/src/utils/types.js +19 -0
  272. package/src/vendor-imports.js +10 -2
  273. package/tsconfig.json +2 -0
  274. package/vendor/acorn/dist/acorn.d.mts +46 -5
  275. package/vendor/acorn/dist/acorn.d.ts +46 -5
  276. package/vendor/acorn/dist/acorn.js +394 -117
  277. package/vendor/acorn/dist/acorn.mjs +394 -117
  278. package/vendor/acorn/dist/bin.js +1 -1
  279. package/vendor/jamilih/dist/{jml-es.js → jml.mjs} +590 -312
  280. package/vendor/jamilih/package.json +1 -1
  281. package/vendor/mime/dist/types/other.js +719 -0
  282. package/vendor/mime/dist/types/standard.js +366 -0
  283. package/vendor/typeson-registry/dist/index.js +519 -99
  284. package/vendor/zod/classic/checks.d.ts +1 -0
  285. package/vendor/zod/classic/checks.js +1 -0
  286. package/vendor/zod/classic/coerce.d.ts +17 -0
  287. package/vendor/zod/classic/coerce.js +17 -0
  288. package/vendor/zod/classic/compat.d.ts +48 -0
  289. package/vendor/zod/classic/compat.js +31 -0
  290. package/vendor/zod/classic/deep-partial.d.ts +14 -0
  291. package/vendor/zod/classic/deep-partial.js +13 -0
  292. package/vendor/zod/classic/errors.d.ts +29 -0
  293. package/vendor/zod/classic/errors.js +57 -0
  294. package/vendor/zod/classic/external.d.ts +19 -0
  295. package/vendor/zod/classic/external.js +17 -0
  296. package/vendor/zod/classic/from-json-schema.d.ts +12 -0
  297. package/vendor/zod/classic/from-json-schema.js +660 -0
  298. package/vendor/zod/classic/in-out.d.ts +8 -0
  299. package/vendor/zod/classic/in-out.js +36 -0
  300. package/vendor/zod/classic/index.d.ts +3 -0
  301. package/vendor/zod/classic/index.js +4 -0
  302. package/vendor/zod/classic/iso.d.ts +7 -0
  303. package/vendor/zod/classic/iso.js +15 -0
  304. package/vendor/zod/classic/package.json +7 -0
  305. package/vendor/zod/classic/parse.d.ts +44 -0
  306. package/vendor/zod/classic/parse.js +16 -0
  307. package/vendor/zod/classic/schemas.d.ts +802 -0
  308. package/vendor/zod/classic/schemas.js +1491 -0
  309. package/vendor/zod/core/api.d.ts +329 -0
  310. package/vendor/zod/core/api.js +1104 -0
  311. package/vendor/zod/core/checks.d.ts +278 -0
  312. package/vendor/zod/core/checks.js +581 -0
  313. package/vendor/zod/core/compile.d.ts +51 -0
  314. package/vendor/zod/core/compile.js +1783 -0
  315. package/vendor/zod/core/core.d.ts +82 -0
  316. package/vendor/zod/core/core.js +141 -0
  317. package/vendor/zod/core/doc.d.ts +16 -0
  318. package/vendor/zod/core/doc.js +33 -0
  319. package/vendor/zod/core/errors.d.ts +225 -0
  320. package/vendor/zod/core/errors.js +270 -0
  321. package/vendor/zod/core/index.d.ts +19 -0
  322. package/vendor/zod/core/index.js +19 -0
  323. package/vendor/zod/core/json-schema-generator.d.ts +65 -0
  324. package/vendor/zod/core/json-schema-generator.js +99 -0
  325. package/vendor/zod/core/json-schema-processors.d.ts +49 -0
  326. package/vendor/zod/core/json-schema-processors.js +747 -0
  327. package/vendor/zod/core/json-schema.d.ts +89 -0
  328. package/vendor/zod/core/memoizer.d.ts +15 -0
  329. package/vendor/zod/core/memoizer.js +265 -0
  330. package/vendor/zod/core/package.json +7 -0
  331. package/vendor/zod/core/parse.d.ts +52 -0
  332. package/vendor/zod/core/parse.js +154 -0
  333. package/vendor/zod/core/regexes.d.ts +87 -0
  334. package/vendor/zod/core/regexes.js +150 -0
  335. package/vendor/zod/core/registries.d.ts +35 -0
  336. package/vendor/zod/core/registries.js +51 -0
  337. package/vendor/zod/core/schemas.d.ts +1253 -0
  338. package/vendor/zod/core/schemas.js +2440 -0
  339. package/vendor/zod/core/standard-schema.d.ts +126 -0
  340. package/vendor/zod/core/to-json-schema.d.ts +153 -0
  341. package/vendor/zod/core/to-json-schema.js +650 -0
  342. package/vendor/zod/core/util.d.ts +257 -0
  343. package/vendor/zod/core/util.js +846 -0
  344. package/vendor/zod/core/versions.d.ts +5 -0
  345. package/vendor/zod/core/versions.js +5 -0
  346. package/vendor/zod/core/visit.d.ts +30 -0
  347. package/vendor/zod/core/visit.js +169 -0
  348. package/vendor/zod/index.d.ts +3 -0
  349. package/vendor/zod/index.js +4 -0
  350. package/vendor/zod/locales/ar.d.ts +4 -0
  351. package/vendor/zod/locales/ar.js +109 -0
  352. package/vendor/zod/locales/az.d.ts +4 -0
  353. package/vendor/zod/locales/az.js +108 -0
  354. package/vendor/zod/locales/be.d.ts +4 -0
  355. package/vendor/zod/locales/be.js +166 -0
  356. package/vendor/zod/locales/bg.d.ts +4 -0
  357. package/vendor/zod/locales/bg.js +123 -0
  358. package/vendor/zod/locales/bn.d.ts +4 -0
  359. package/vendor/zod/locales/bn.js +111 -0
  360. package/vendor/zod/locales/ca.d.ts +4 -0
  361. package/vendor/zod/locales/ca.js +110 -0
  362. package/vendor/zod/locales/ckb.d.ts +4 -0
  363. package/vendor/zod/locales/ckb.js +131 -0
  364. package/vendor/zod/locales/cs.d.ts +4 -0
  365. package/vendor/zod/locales/cs.js +114 -0
  366. package/vendor/zod/locales/da.d.ts +4 -0
  367. package/vendor/zod/locales/da.js +118 -0
  368. package/vendor/zod/locales/de.d.ts +4 -0
  369. package/vendor/zod/locales/de.js +111 -0
  370. package/vendor/zod/locales/el.d.ts +4 -0
  371. package/vendor/zod/locales/el.js +110 -0
  372. package/vendor/zod/locales/en.d.ts +4 -0
  373. package/vendor/zod/locales/en.js +123 -0
  374. package/vendor/zod/locales/eo.d.ts +4 -0
  375. package/vendor/zod/locales/eo.js +112 -0
  376. package/vendor/zod/locales/es.d.ts +4 -0
  377. package/vendor/zod/locales/es.js +134 -0
  378. package/vendor/zod/locales/fa.d.ts +4 -0
  379. package/vendor/zod/locales/fa.js +117 -0
  380. package/vendor/zod/locales/fi.d.ts +4 -0
  381. package/vendor/zod/locales/fi.js +115 -0
  382. package/vendor/zod/locales/fr-CA.d.ts +4 -0
  383. package/vendor/zod/locales/fr-CA.js +110 -0
  384. package/vendor/zod/locales/fr.d.ts +4 -0
  385. package/vendor/zod/locales/fr.js +127 -0
  386. package/vendor/zod/locales/gu.d.ts +4 -0
  387. package/vendor/zod/locales/gu.js +111 -0
  388. package/vendor/zod/locales/he.d.ts +4 -0
  389. package/vendor/zod/locales/he.js +219 -0
  390. package/vendor/zod/locales/hi.d.ts +4 -0
  391. package/vendor/zod/locales/hi.js +109 -0
  392. package/vendor/zod/locales/hr.d.ts +4 -0
  393. package/vendor/zod/locales/hr.js +124 -0
  394. package/vendor/zod/locales/hu.d.ts +4 -0
  395. package/vendor/zod/locales/hu.js +111 -0
  396. package/vendor/zod/locales/hy.d.ts +4 -0
  397. package/vendor/zod/locales/hy.js +156 -0
  398. package/vendor/zod/locales/id.d.ts +4 -0
  399. package/vendor/zod/locales/id.js +109 -0
  400. package/vendor/zod/locales/index.d.ts +62 -0
  401. package/vendor/zod/locales/index.js +62 -0
  402. package/vendor/zod/locales/is.d.ts +4 -0
  403. package/vendor/zod/locales/is.js +112 -0
  404. package/vendor/zod/locales/it.d.ts +4 -0
  405. package/vendor/zod/locales/it.js +111 -0
  406. package/vendor/zod/locales/ja.d.ts +4 -0
  407. package/vendor/zod/locales/ja.js +110 -0
  408. package/vendor/zod/locales/ka.d.ts +4 -0
  409. package/vendor/zod/locales/ka.js +115 -0
  410. package/vendor/zod/locales/kh.d.ts +5 -0
  411. package/vendor/zod/locales/kh.js +5 -0
  412. package/vendor/zod/locales/km.d.ts +4 -0
  413. package/vendor/zod/locales/km.js +113 -0
  414. package/vendor/zod/locales/kn.d.ts +4 -0
  415. package/vendor/zod/locales/kn.js +114 -0
  416. package/vendor/zod/locales/ko.d.ts +4 -0
  417. package/vendor/zod/locales/ko.js +114 -0
  418. package/vendor/zod/locales/lt.d.ts +4 -0
  419. package/vendor/zod/locales/lt.js +205 -0
  420. package/vendor/zod/locales/mk.d.ts +4 -0
  421. package/vendor/zod/locales/mk.js +112 -0
  422. package/vendor/zod/locales/ms.d.ts +4 -0
  423. package/vendor/zod/locales/ms.js +110 -0
  424. package/vendor/zod/locales/ne.d.ts +4 -0
  425. package/vendor/zod/locales/ne.js +109 -0
  426. package/vendor/zod/locales/nl.d.ts +4 -0
  427. package/vendor/zod/locales/nl.js +113 -0
  428. package/vendor/zod/locales/nn.d.ts +4 -0
  429. package/vendor/zod/locales/nn.js +111 -0
  430. package/vendor/zod/locales/no.d.ts +4 -0
  431. package/vendor/zod/locales/no.js +111 -0
  432. package/vendor/zod/locales/ota.d.ts +4 -0
  433. package/vendor/zod/locales/ota.js +112 -0
  434. package/vendor/zod/locales/package.json +7 -0
  435. package/vendor/zod/locales/pl.d.ts +4 -0
  436. package/vendor/zod/locales/pl.js +112 -0
  437. package/vendor/zod/locales/ps.d.ts +4 -0
  438. package/vendor/zod/locales/ps.js +117 -0
  439. package/vendor/zod/locales/pt-BR.d.ts +4 -0
  440. package/vendor/zod/locales/pt-BR.js +141 -0
  441. package/vendor/zod/locales/pt.d.ts +4 -0
  442. package/vendor/zod/locales/pt.js +140 -0
  443. package/vendor/zod/locales/ro.d.ts +4 -0
  444. package/vendor/zod/locales/ro.js +120 -0
  445. package/vendor/zod/locales/ru.d.ts +4 -0
  446. package/vendor/zod/locales/ru.js +166 -0
  447. package/vendor/zod/locales/sk.d.ts +4 -0
  448. package/vendor/zod/locales/sk.js +114 -0
  449. package/vendor/zod/locales/sl.d.ts +4 -0
  450. package/vendor/zod/locales/sl.js +112 -0
  451. package/vendor/zod/locales/sv.d.ts +4 -0
  452. package/vendor/zod/locales/sv.js +113 -0
  453. package/vendor/zod/locales/ta.d.ts +4 -0
  454. package/vendor/zod/locales/ta.js +113 -0
  455. package/vendor/zod/locales/th.d.ts +4 -0
  456. package/vendor/zod/locales/th.js +113 -0
  457. package/vendor/zod/locales/tk.d.ts +4 -0
  458. package/vendor/zod/locales/tk.js +105 -0
  459. package/vendor/zod/locales/tr.d.ts +4 -0
  460. package/vendor/zod/locales/tr.js +108 -0
  461. package/vendor/zod/locales/ua.d.ts +5 -0
  462. package/vendor/zod/locales/ua.js +5 -0
  463. package/vendor/zod/locales/uk.d.ts +4 -0
  464. package/vendor/zod/locales/uk.js +111 -0
  465. package/vendor/zod/locales/ur.d.ts +4 -0
  466. package/vendor/zod/locales/ur.js +113 -0
  467. package/vendor/zod/locales/uz.d.ts +4 -0
  468. package/vendor/zod/locales/uz.js +111 -0
  469. package/vendor/zod/locales/vi.d.ts +4 -0
  470. package/vendor/zod/locales/vi.js +111 -0
  471. package/vendor/zod/locales/yo.d.ts +4 -0
  472. package/vendor/zod/locales/yo.js +110 -0
  473. package/vendor/zod/locales/zh-CN.d.ts +4 -0
  474. package/vendor/zod/locales/zh-CN.js +112 -0
  475. package/vendor/zod/locales/zh-TW.d.ts +4 -0
  476. package/vendor/zod/locales/zh-TW.js +110 -0
  477. package/vendor/zod/mini/checks.d.ts +1 -0
  478. package/vendor/zod/mini/checks.js +1 -0
  479. package/vendor/zod/mini/coerce.d.ts +7 -0
  480. package/vendor/zod/mini/coerce.js +22 -0
  481. package/vendor/zod/mini/deep-partial.d.ts +14 -0
  482. package/vendor/zod/mini/deep-partial.js +13 -0
  483. package/vendor/zod/mini/external.d.ts +16 -0
  484. package/vendor/zod/mini/external.js +16 -0
  485. package/vendor/zod/mini/in-out.d.ts +8 -0
  486. package/vendor/zod/mini/in-out.js +36 -0
  487. package/vendor/zod/mini/index.d.ts +3 -0
  488. package/vendor/zod/mini/index.js +3 -0
  489. package/vendor/zod/mini/iso.d.ts +22 -0
  490. package/vendor/zod/mini/iso.js +34 -0
  491. package/vendor/zod/mini/package.json +7 -0
  492. package/vendor/zod/mini/parse.d.ts +1 -0
  493. package/vendor/zod/mini/parse.js +1 -0
  494. package/vendor/zod/mini/schemas.d.ts +475 -0
  495. package/vendor/zod/mini/schemas.js +987 -0
  496. package/vendor/zod/package.json +7 -0
  497. package/vendor/zodexy/dist/esm/index.js +1274 -0
  498. package/vendor/zodexy/dist/index.js +1088 -0
  499. package/vendor/zodexy/dist/schema.zodexy.json +1036 -0
  500. package/dist/fundamentalTypes/nativeEnumType.d.ts +0 -6
  501. package/dist/fundamentalTypes/nativeEnumType.d.ts.map +0 -1
  502. package/src/fundamentalTypes/catchType.js +0 -140
  503. package/src/fundamentalTypes/enumType.js +0 -52
  504. package/src/fundamentalTypes/literalType.js +0 -81
  505. package/src/fundamentalTypes/nativeEnumType.js +0 -157
  506. package/src/fundamentalTypes/neverType.js +0 -49
  507. package/src/fundamentalTypes/recordType.js +0 -42
  508. package/src/fundamentalTypes/tupleType.js +0 -39
  509. package/src/fundamentalTypes/voidType.js +0 -48
  510. package/vendor/zod/lib/index.mjs +0 -4236
  511. package/vendor/zodex/dist/esm/dezerialize.d.ts +0 -26
  512. package/vendor/zodex/dist/esm/dezerialize.js +0 -393
  513. package/vendor/zodex/dist/esm/index.d.ts +0 -9
  514. package/vendor/zodex/dist/esm/index.js +0 -4
  515. package/vendor/zodex/dist/esm/infer.d.ts +0 -29
  516. package/vendor/zodex/dist/esm/package.json +0 -1
  517. package/vendor/zodex/dist/esm/types.d.ts +0 -201
  518. package/vendor/zodex/dist/esm/types.js +0 -13
  519. package/vendor/zodex/dist/esm/ui.d.ts +0 -23
  520. package/vendor/zodex/dist/esm/ui.js +0 -10
  521. package/vendor/zodex/dist/esm/zerialize.d.ts +0 -50
  522. package/vendor/zodex/dist/esm/zerialize.js +0 -417
  523. package/vendor/zodex/dist/esm/zod-types.d.ts +0 -11
  524. /package/vendor/{zodex/dist/esm/infer.js → zod/core/json-schema.js} +0 -0
  525. /package/vendor/{zodex/dist/esm/zod-types.js → zod/core/standard-schema.js} +0 -0
@@ -0,0 +1,5 @@
1
+ export declare const version: {
2
+ readonly major: 4;
3
+ readonly minor: 5;
4
+ readonly patch: number;
5
+ };
@@ -0,0 +1,5 @@
1
+ export const version = {
2
+ major: 4,
3
+ minor: 5,
4
+ patch: 4,
5
+ };
@@ -0,0 +1,30 @@
1
+ import * as schemas from "./schemas.js";
2
+ type AnyZod = schemas.$ZodType;
3
+ type Kind = schemas.$ZodTypeDef["type"];
4
+ /** The concrete schema class for a `def.type`, or `$ZodType` for kinds with no dedicated class. */
5
+ type SchemaOfKind<K extends Kind> = [Extract<schemas.$ZodTypes, {
6
+ _zod: {
7
+ def: {
8
+ type: K;
9
+ };
10
+ };
11
+ }>] extends [never] ? AnyZod : Extract<schemas.$ZodTypes, {
12
+ _zod: {
13
+ def: {
14
+ type: K;
15
+ };
16
+ };
17
+ }>;
18
+ export type VisitFn = (node: AnyZod, rewritten: boolean) => AnyZod;
19
+ export type VisitHandlers = {
20
+ [K in Kind]?: (node: SchemaOfKind<K>, rewritten: boolean) => AnyZod;
21
+ };
22
+ /**
23
+ * @internal Bottom-up rewrite of a schema tree. Unhandled kinds and unchanged branches keep their
24
+ * identity. Returns `$ZodType`: a visitor can swap in a schema of any type, so callers declare
25
+ * their own return type. `rewritten` tells a handler whether the traversal replaced anything
26
+ * below the node it is looking at.
27
+ */
28
+ export declare function visit(schema: schemas.SomeType, fn: VisitFn): AnyZod;
29
+ export declare function visit(schema: schemas.SomeType, handlers: VisitHandlers): AnyZod;
30
+ export {};
@@ -0,0 +1,169 @@
1
+ // Traversal pattern adapted from Jaen's v3 `mapOnSchema` (Apache-2.0): https://gist.github.com/jaens/7e15ae1984bb338c86eb5e452dee3010
2
+ import * as schemas from "./schemas.js";
3
+ import { clone } from "./util.js";
4
+ const RESOLVING = Symbol("z.visit/resolving");
5
+ export function visit(schema, fnOrHandlers) {
6
+ const fn = typeof fnOrHandlers === "function"
7
+ ? fnOrHandlers
8
+ : (node, rewritten) => {
9
+ // A union of handlers isn't callable with one argument; handler `K` only ever sees kind `K`.
10
+ const h = fnOrHandlers[node._zod.def.type];
11
+ return h ? h(node, rewritten) : node;
12
+ };
13
+ const cache = new Map();
14
+ function run(s) {
15
+ const cached = cache.get(s);
16
+ if (cached === RESOLVING) {
17
+ // Non-lazy cycle. Defer to parse time, when the cache holds the finished node.
18
+ return new schemas.$ZodLazy({
19
+ type: "lazy",
20
+ getter: () => cache.get(s),
21
+ });
22
+ }
23
+ if (cached !== undefined)
24
+ return cached;
25
+ cache.set(s, RESOLVING);
26
+ const inner = mapInner(s);
27
+ const mapped = fn(inner, inner !== s);
28
+ cache.set(s, mapped);
29
+ return mapped;
30
+ }
31
+ function mapInner(s) {
32
+ const def = s._zod.def;
33
+ const kind = def.type;
34
+ switch (kind) {
35
+ case "object": {
36
+ const oldShape = def.shape;
37
+ const keys = Object.keys(oldShape);
38
+ let changed = false;
39
+ const newShape = {};
40
+ for (const k of keys) {
41
+ const mapped = run(oldShape[k]);
42
+ if (mapped !== oldShape[k])
43
+ changed = true;
44
+ newShape[k] = mapped;
45
+ }
46
+ let newCatchall = def.catchall;
47
+ if (def.catchall) {
48
+ newCatchall = run(def.catchall);
49
+ if (newCatchall !== def.catchall)
50
+ changed = true;
51
+ }
52
+ return changed ? clone(s, { ...def, shape: newShape, catchall: newCatchall }) : s;
53
+ }
54
+ case "array": {
55
+ const mapped = run(def.element);
56
+ return mapped === def.element ? s : clone(s, { ...def, element: mapped });
57
+ }
58
+ case "tuple": {
59
+ const oldItems = def.items;
60
+ let changed = false;
61
+ const newItems = [];
62
+ for (const item of oldItems) {
63
+ const mapped = run(item);
64
+ if (mapped !== item)
65
+ changed = true;
66
+ newItems.push(mapped);
67
+ }
68
+ let newRest = def.rest;
69
+ if (def.rest) {
70
+ newRest = run(def.rest);
71
+ if (newRest !== def.rest)
72
+ changed = true;
73
+ }
74
+ return changed ? clone(s, { ...def, items: newItems, rest: newRest }) : s;
75
+ }
76
+ case "record":
77
+ case "map": {
78
+ const newKey = run(def.keyType);
79
+ const newVal = run(def.valueType);
80
+ return newKey === def.keyType && newVal === def.valueType
81
+ ? s
82
+ : clone(s, { ...def, keyType: newKey, valueType: newVal });
83
+ }
84
+ case "set": {
85
+ const newVal = run(def.valueType);
86
+ return newVal === def.valueType ? s : clone(s, { ...def, valueType: newVal });
87
+ }
88
+ case "union": {
89
+ const oldOptions = def.options;
90
+ let changed = false;
91
+ const newOptions = [];
92
+ for (const opt of oldOptions) {
93
+ const mapped = run(opt);
94
+ if (mapped !== opt)
95
+ changed = true;
96
+ newOptions.push(mapped);
97
+ }
98
+ return changed ? clone(s, { ...def, options: newOptions }) : s;
99
+ }
100
+ case "intersection": {
101
+ const newLeft = run(def.left);
102
+ const newRight = run(def.right);
103
+ return newLeft === def.left && newRight === def.right
104
+ ? s
105
+ : clone(s, { ...def, left: newLeft, right: newRight });
106
+ }
107
+ case "optional":
108
+ case "nullable":
109
+ case "default":
110
+ case "prefault":
111
+ case "catch":
112
+ case "readonly":
113
+ case "nonoptional":
114
+ case "promise":
115
+ case "success": {
116
+ const newInner = run(def.innerType);
117
+ return newInner === def.innerType ? s : clone(s, { ...def, innerType: newInner });
118
+ }
119
+ case "pipe": {
120
+ const newIn = run(def.in);
121
+ const newOut = run(def.out);
122
+ return newIn === def.in && newOut === def.out ? s : clone(s, { ...def, in: newIn, out: newOut });
123
+ }
124
+ case "function": {
125
+ const newInput = run(def.input);
126
+ const newOutput = run(def.output);
127
+ return newInput === def.input && newOutput === def.output
128
+ ? s
129
+ : clone(s, { ...def, input: newInput, output: newOutput });
130
+ }
131
+ case "lazy": {
132
+ // Invoking the getter here would trip the cycle check, so lazy nodes always re-clone.
133
+ const original = def.getter;
134
+ // Drop the memo, or it shadows the new getter forever.
135
+ const { _cachedInner, ...rest } = def;
136
+ return clone(s, { ...rest, getter: () => run(original()) });
137
+ }
138
+ // A leaf by choice: `parts` are regex fragments, not data positions.
139
+ case "template_literal":
140
+ // Leaves.
141
+ case "string":
142
+ case "number":
143
+ case "int":
144
+ case "boolean":
145
+ case "bigint":
146
+ case "symbol":
147
+ case "undefined":
148
+ case "null":
149
+ case "void":
150
+ case "never":
151
+ case "any":
152
+ case "unknown":
153
+ case "date":
154
+ case "nan":
155
+ case "enum":
156
+ case "literal":
157
+ case "file":
158
+ case "transform":
159
+ case "custom":
160
+ return s;
161
+ default: {
162
+ // A new built-in kind becomes a compile error here; unknown user kinds fall through.
163
+ kind;
164
+ return s;
165
+ }
166
+ }
167
+ }
168
+ return run(schema);
169
+ }
@@ -0,0 +1,3 @@
1
+ import * as z4 from "./classic/external.js";
2
+ export * from "./classic/index.js";
3
+ export { z4 as default };
@@ -0,0 +1,4 @@
1
+ import * as z4 from "./classic/external.js";
2
+ export * from "./classic/index.js";
3
+ // See the note in `src/index.ts` — aliasing keeps the default export shakable. Aliased from the namespace, not from `./classic/index.js`'s default, so both the tsc and Babel CJS outputs stay a plain `exports.default =` rather than a getter.
4
+ export { z4 as default };
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,109 @@
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
+ map: { unit: "عنصر", verb: "أن يحوي" },
9
+ };
10
+ function getSizing(origin) {
11
+ return Sizable[origin] ?? null;
12
+ }
13
+ const FormatDictionary = {
14
+ regex: "مدخل",
15
+ email: "بريد إلكتروني",
16
+ url: "رابط",
17
+ emoji: "إيموجي",
18
+ uuid: "UUID",
19
+ uuidv4: "UUIDv4",
20
+ uuidv6: "UUIDv6",
21
+ nanoid: "nanoid",
22
+ guid: "GUID",
23
+ cuid: "cuid",
24
+ cuid2: "cuid2",
25
+ ulid: "ULID",
26
+ xid: "XID",
27
+ ksuid: "KSUID",
28
+ datetime: "تاريخ ووقت بمعيار ISO",
29
+ date: "تاريخ بمعيار ISO",
30
+ time: "وقت بمعيار ISO",
31
+ duration: "مدة بمعيار ISO",
32
+ ipv4: "عنوان IPv4",
33
+ ipv6: "عنوان IPv6",
34
+ mac: "عنوان MAC",
35
+ cidrv4: "مدى عناوين بصيغة IPv4",
36
+ cidrv6: "مدى عناوين بصيغة IPv6",
37
+ base64: "نَص بترميز base64-encoded",
38
+ base64url: "نَص بترميز base64url-encoded",
39
+ json_string: "نَص على هيئة JSON",
40
+ e164: "رقم هاتف بمعيار E.164",
41
+ credit_card: "رقم بطاقة الائتمان",
42
+ jwt: "JWT",
43
+ template_literal: "مدخل",
44
+ };
45
+ const TypeDictionary = {
46
+ nan: "NaN",
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 `مدخلات غير مقبولة: يفترض إدخال instanceof ${issue.expected}، ولكن تم إدخال ${received}`;
56
+ }
57
+ return `مدخلات غير مقبولة: يفترض إدخال ${expected}، ولكن تم إدخال ${received}`;
58
+ }
59
+ case "invalid_value":
60
+ if (issue.values.length === 1)
61
+ return `مدخلات غير مقبولة: يفترض إدخال ${util.stringifyPrimitive(issue.values[0])}`;
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
+ return `أكبر من اللازم: يفترض أن تكون ${issue.origin ?? "القيمة"} ${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 `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
75
+ }
76
+ return `أصغر من اللازم: يفترض لـ ${issue.origin} أن يكون ${adj} ${issue.minimum.toString()}`;
77
+ }
78
+ case "invalid_format": {
79
+ const _issue = issue;
80
+ if (_issue.format === "starts_with")
81
+ return `نَص غير مقبول: يجب أن يبدأ بـ "${issue.prefix}"`;
82
+ if (_issue.format === "ends_with")
83
+ return `نَص غير مقبول: يجب أن ينتهي بـ "${_issue.suffix}"`;
84
+ if (_issue.format === "includes")
85
+ return `نَص غير مقبول: يجب أن يتضمَّن "${_issue.includes}"`;
86
+ if (_issue.format === "regex")
87
+ return `نَص غير مقبول: يجب أن يطابق النمط ${_issue.pattern}`;
88
+ return `${FormatDictionary[_issue.format] ?? issue.format} غير مقبول`;
89
+ }
90
+ case "not_multiple_of":
91
+ return `رقم غير مقبول: يجب أن يكون من مضاعفات ${issue.divisor}`;
92
+ case "unrecognized_keys":
93
+ return `معرف${issue.keys.length > 1 ? "ات" : ""} غريب${issue.keys.length > 1 ? "ة" : ""}: ${util.joinValues(issue.keys, "، ")}`;
94
+ case "invalid_key":
95
+ return `معرف غير مقبول في ${issue.origin}`;
96
+ case "invalid_union":
97
+ return "مدخل غير مقبول";
98
+ case "invalid_element":
99
+ return `مدخل غير مقبول في ${issue.origin}`;
100
+ default:
101
+ return "مدخل غير مقبول";
102
+ }
103
+ };
104
+ };
105
+ export default function () {
106
+ return {
107
+ localeError: error(),
108
+ };
109
+ }
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,108 @@
1
+ import * as util from "../core/util.js";
2
+ const error = () => {
3
+ const Sizable = {
4
+ string: { unit: "simvol", verb: "olmalıdır" },
5
+ file: { unit: "bayt", verb: "olmalıdır" },
6
+ array: { unit: "element", verb: "olmalıdır" },
7
+ set: { unit: "element", verb: "olmalıdır" },
8
+ map: { unit: "element", verb: "olmalıdır" },
9
+ };
10
+ function getSizing(origin) {
11
+ return Sizable[origin] ?? null;
12
+ }
13
+ const FormatDictionary = {
14
+ regex: "input",
15
+ email: "email address",
16
+ url: "URL",
17
+ emoji: "emoji",
18
+ uuid: "UUID",
19
+ uuidv4: "UUIDv4",
20
+ uuidv6: "UUIDv6",
21
+ nanoid: "nanoid",
22
+ guid: "GUID",
23
+ cuid: "cuid",
24
+ cuid2: "cuid2",
25
+ ulid: "ULID",
26
+ xid: "XID",
27
+ ksuid: "KSUID",
28
+ datetime: "ISO datetime",
29
+ date: "ISO date",
30
+ time: "ISO time",
31
+ duration: "ISO duration",
32
+ ipv4: "IPv4 address",
33
+ ipv6: "IPv6 address",
34
+ mac: "MAC address",
35
+ cidrv4: "IPv4 range",
36
+ cidrv6: "IPv6 range",
37
+ base64: "base64-encoded string",
38
+ base64url: "base64url-encoded string",
39
+ json_string: "JSON string",
40
+ e164: "E.164 number",
41
+ credit_card: "kredit kartı nömrəsi",
42
+ jwt: "JWT",
43
+ template_literal: "input",
44
+ };
45
+ const TypeDictionary = {
46
+ nan: "NaN",
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 `Yanlış dəyər: gözlənilən instanceof ${issue.expected}, daxil olan ${received}`;
56
+ }
57
+ return `Yanlış dəyər: gözlənilən ${expected}, daxil olan ${received}`;
58
+ }
59
+ case "invalid_value":
60
+ if (issue.values.length === 1)
61
+ return `Yanlış dəyər: gözlənilən ${util.stringifyPrimitive(issue.values[0])}`;
62
+ return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${util.joinValues(issue.values, "|")}`;
63
+ case "too_big": {
64
+ const adj = issue.inclusive ? "<=" : "<";
65
+ const sizing = getSizing(issue.origin);
66
+ if (sizing)
67
+ return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
68
+ return `Çox böyük: gözlənilən ${issue.origin ?? "dəyər"} ${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 `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
75
+ return `Çox kiçik: gözlənilən ${issue.origin} ${adj}${issue.minimum.toString()}`;
76
+ }
77
+ case "invalid_format": {
78
+ const _issue = issue;
79
+ if (_issue.format === "starts_with")
80
+ return `Yanlış mətn: "${_issue.prefix}" ilə başlamalıdır`;
81
+ if (_issue.format === "ends_with")
82
+ return `Yanlış mətn: "${_issue.suffix}" ilə bitməlidir`;
83
+ if (_issue.format === "includes")
84
+ return `Yanlış mətn: "${_issue.includes}" daxil olmalıdır`;
85
+ if (_issue.format === "regex")
86
+ return `Yanlış mətn: ${_issue.pattern} şablonuna uyğun olmalıdır`;
87
+ return `Yanlış ${FormatDictionary[_issue.format] ?? issue.format}`;
88
+ }
89
+ case "not_multiple_of":
90
+ return `Yanlış ədəd: ${issue.divisor} ilə bölünə bilən olmalıdır`;
91
+ case "unrecognized_keys":
92
+ return `Tanınmayan açar${issue.keys.length > 1 ? "lar" : ""}: ${util.joinValues(issue.keys, ", ")}`;
93
+ case "invalid_key":
94
+ return `${issue.origin} daxilində yanlış açar`;
95
+ case "invalid_union":
96
+ return "Yanlış dəyər";
97
+ case "invalid_element":
98
+ return `${issue.origin} daxilində yanlış dəyər`;
99
+ default:
100
+ return `Yanlış dəyər`;
101
+ }
102
+ };
103
+ };
104
+ export default function () {
105
+ return {
106
+ localeError: error(),
107
+ };
108
+ }
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };
@@ -0,0 +1,166 @@
1
+ import * as util from "../core/util.js";
2
+ function getBelarusianPlural(count, one, few, many) {
3
+ const absCount = Math.abs(count);
4
+ const lastDigit = absCount % 10;
5
+ const lastTwoDigits = absCount % 100;
6
+ if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
7
+ return many;
8
+ }
9
+ if (lastDigit === 1) {
10
+ return one;
11
+ }
12
+ if (lastDigit >= 2 && lastDigit <= 4) {
13
+ return few;
14
+ }
15
+ return many;
16
+ }
17
+ const error = () => {
18
+ const Sizable = {
19
+ string: {
20
+ unit: {
21
+ one: "сімвал",
22
+ few: "сімвалы",
23
+ many: "сімвалаў",
24
+ },
25
+ verb: "мець",
26
+ },
27
+ array: {
28
+ unit: {
29
+ one: "элемент",
30
+ few: "элементы",
31
+ many: "элементаў",
32
+ },
33
+ verb: "мець",
34
+ },
35
+ set: {
36
+ unit: {
37
+ one: "элемент",
38
+ few: "элементы",
39
+ many: "элементаў",
40
+ },
41
+ verb: "мець",
42
+ },
43
+ map: {
44
+ unit: {
45
+ one: "элемент",
46
+ few: "элементы",
47
+ many: "элементаў",
48
+ },
49
+ verb: "мець",
50
+ },
51
+ file: {
52
+ unit: {
53
+ one: "байт",
54
+ few: "байты",
55
+ many: "байтаў",
56
+ },
57
+ verb: "мець",
58
+ },
59
+ };
60
+ function getSizing(origin) {
61
+ return Sizable[origin] ?? null;
62
+ }
63
+ const FormatDictionary = {
64
+ regex: "увод",
65
+ email: "email адрас",
66
+ url: "URL",
67
+ emoji: "эмодзі",
68
+ uuid: "UUID",
69
+ uuidv4: "UUIDv4",
70
+ uuidv6: "UUIDv6",
71
+ nanoid: "nanoid",
72
+ guid: "GUID",
73
+ cuid: "cuid",
74
+ cuid2: "cuid2",
75
+ ulid: "ULID",
76
+ xid: "XID",
77
+ ksuid: "KSUID",
78
+ datetime: "ISO дата і час",
79
+ date: "ISO дата",
80
+ time: "ISO час",
81
+ duration: "ISO працягласць",
82
+ ipv4: "IPv4 адрас",
83
+ ipv6: "IPv6 адрас",
84
+ mac: "MAC адрас",
85
+ cidrv4: "IPv4 дыяпазон",
86
+ cidrv6: "IPv6 дыяпазон",
87
+ base64: "радок у фармаце base64",
88
+ base64url: "радок у фармаце base64url",
89
+ json_string: "JSON радок",
90
+ e164: "нумар E.164",
91
+ credit_card: "нумар крэдытнай карты",
92
+ jwt: "JWT",
93
+ template_literal: "увод",
94
+ };
95
+ const TypeDictionary = {
96
+ nan: "NaN",
97
+ number: "лік",
98
+ array: "масіў",
99
+ };
100
+ return (issue) => {
101
+ switch (issue.code) {
102
+ case "invalid_type": {
103
+ const expected = TypeDictionary[issue.expected] ?? issue.expected;
104
+ const receivedType = util.parsedType(issue.input);
105
+ const received = TypeDictionary[receivedType] ?? receivedType;
106
+ if (/^[A-Z]/.test(issue.expected)) {
107
+ return `Няправільны ўвод: чакаўся instanceof ${issue.expected}, атрымана ${received}`;
108
+ }
109
+ return `Няправільны ўвод: чакаўся ${expected}, атрымана ${received}`;
110
+ }
111
+ case "invalid_value":
112
+ if (issue.values.length === 1)
113
+ return `Няправільны ўвод: чакалася ${util.stringifyPrimitive(issue.values[0])}`;
114
+ return `Няправільны варыянт: чакаўся адзін з ${util.joinValues(issue.values, "|")}`;
115
+ case "too_big": {
116
+ const adj = issue.inclusive ? "<=" : "<";
117
+ const sizing = getSizing(issue.origin);
118
+ if (sizing) {
119
+ const maxValue = Number(issue.maximum);
120
+ const unit = getBelarusianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
121
+ return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна ${sizing.verb} ${adj}${issue.maximum.toString()} ${unit}`;
122
+ }
123
+ return `Занадта вялікі: чакалася, што ${issue.origin ?? "значэнне"} павінна быць ${adj}${issue.maximum.toString()}`;
124
+ }
125
+ case "too_small": {
126
+ const adj = issue.inclusive ? ">=" : ">";
127
+ const sizing = getSizing(issue.origin);
128
+ if (sizing) {
129
+ const minValue = Number(issue.minimum);
130
+ const unit = getBelarusianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
131
+ return `Занадта малы: чакалася, што ${issue.origin} павінна ${sizing.verb} ${adj}${issue.minimum.toString()} ${unit}`;
132
+ }
133
+ return `Занадта малы: чакалася, што ${issue.origin} павінна быць ${adj}${issue.minimum.toString()}`;
134
+ }
135
+ case "invalid_format": {
136
+ const _issue = issue;
137
+ if (_issue.format === "starts_with")
138
+ return `Няправільны радок: павінен пачынацца з "${_issue.prefix}"`;
139
+ if (_issue.format === "ends_with")
140
+ return `Няправільны радок: павінен заканчвацца на "${_issue.suffix}"`;
141
+ if (_issue.format === "includes")
142
+ return `Няправільны радок: павінен змяшчаць "${_issue.includes}"`;
143
+ if (_issue.format === "regex")
144
+ return `Няправільны радок: павінен адпавядаць шаблону ${_issue.pattern}`;
145
+ return `Няправільны ${FormatDictionary[_issue.format] ?? issue.format}`;
146
+ }
147
+ case "not_multiple_of":
148
+ return `Няправільны лік: павінен быць кратным ${issue.divisor}`;
149
+ case "unrecognized_keys":
150
+ return `Нераспазнаны ${issue.keys.length > 1 ? "ключы" : "ключ"}: ${util.joinValues(issue.keys, ", ")}`;
151
+ case "invalid_key":
152
+ return `Няправільны ключ у ${issue.origin}`;
153
+ case "invalid_union":
154
+ return "Няправільны ўвод";
155
+ case "invalid_element":
156
+ return `Няправільнае значэнне ў ${issue.origin}`;
157
+ default:
158
+ return `Няправільны ўвод`;
159
+ }
160
+ };
161
+ };
162
+ export default function () {
163
+ return {
164
+ localeError: error(),
165
+ };
166
+ }
@@ -0,0 +1,4 @@
1
+ import type * as errors from "../core/errors.js";
2
+ export default function (): {
3
+ localeError: errors.$ZodErrorMap;
4
+ };