@evolu/common 8.5.0 → 8.6.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 (328) hide show
  1. package/dist/src/Array.d.ts +170 -97
  2. package/dist/src/Array.d.ts.map +1 -1
  3. package/dist/src/Array.js +67 -42
  4. package/dist/src/Assert.d.ts +233 -30
  5. package/dist/src/Assert.d.ts.map +1 -1
  6. package/dist/src/Assert.js +150 -30
  7. package/dist/src/BigInt.d.ts +3 -3
  8. package/dist/src/BigInt.js +3 -3
  9. package/dist/src/Brand.d.ts +7 -7
  10. package/dist/src/Buffer.d.ts +12 -4
  11. package/dist/src/Buffer.d.ts.map +1 -1
  12. package/dist/src/Cache.d.ts +8 -3
  13. package/dist/src/Cache.d.ts.map +1 -1
  14. package/dist/src/Cache.js +8 -3
  15. package/dist/src/Callbacks.d.ts +8 -4
  16. package/dist/src/Callbacks.d.ts.map +1 -1
  17. package/dist/src/Console.d.ts +45 -30
  18. package/dist/src/Console.d.ts.map +1 -1
  19. package/dist/src/Console.js +32 -21
  20. package/dist/src/Crypto.d.ts +13 -8
  21. package/dist/src/Crypto.d.ts.map +1 -1
  22. package/dist/src/Crypto.js +6 -3
  23. package/dist/src/Eq.d.ts +107 -58
  24. package/dist/src/Eq.d.ts.map +1 -1
  25. package/dist/src/Eq.js +308 -112
  26. package/dist/src/Function.d.ts +54 -24
  27. package/dist/src/Function.d.ts.map +1 -1
  28. package/dist/src/Function.js +34 -17
  29. package/dist/src/Http.d.ts +52 -19
  30. package/dist/src/Http.d.ts.map +1 -1
  31. package/dist/src/Identicon.d.ts +9 -4
  32. package/dist/src/Identicon.d.ts.map +1 -1
  33. package/dist/src/Identicon.js +9 -4
  34. package/dist/src/LockManager.d.ts +12 -10
  35. package/dist/src/LockManager.d.ts.map +1 -1
  36. package/dist/src/Lookup.d.ts +4 -2
  37. package/dist/src/Lookup.d.ts.map +1 -1
  38. package/dist/src/Lookup.js +4 -2
  39. package/dist/src/Number.d.ts +28 -24
  40. package/dist/src/Number.d.ts.map +1 -1
  41. package/dist/src/Number.js +16 -17
  42. package/dist/src/Object.d.ts +89 -47
  43. package/dist/src/Object.d.ts.map +1 -1
  44. package/dist/src/Object.js +88 -41
  45. package/dist/src/Option.d.ts +14 -5
  46. package/dist/src/Option.d.ts.map +1 -1
  47. package/dist/src/Option.js +14 -5
  48. package/dist/src/Order.d.ts +12 -12
  49. package/dist/src/Order.js +12 -12
  50. package/dist/src/Platform.d.ts +2 -2
  51. package/dist/src/Random.d.ts +7 -4
  52. package/dist/src/Random.d.ts.map +1 -1
  53. package/dist/src/Redacted.d.ts +13 -6
  54. package/dist/src/Redacted.d.ts.map +1 -1
  55. package/dist/src/Redacted.js +4 -2
  56. package/dist/src/Ref.d.ts +4 -4
  57. package/dist/src/Relation.d.ts +5 -7
  58. package/dist/src/Relation.d.ts.map +1 -1
  59. package/dist/src/Resource.d.ts +27 -12
  60. package/dist/src/Resource.d.ts.map +1 -1
  61. package/dist/src/Result.d.ts +258 -114
  62. package/dist/src/Result.d.ts.map +1 -1
  63. package/dist/src/Result.js +71 -34
  64. package/dist/src/Schedule.d.ts +233 -116
  65. package/dist/src/Schedule.d.ts.map +1 -1
  66. package/dist/src/Schedule.js +204 -110
  67. package/dist/src/Set.d.ts +43 -24
  68. package/dist/src/Set.d.ts.map +1 -1
  69. package/dist/src/Set.js +25 -13
  70. package/dist/src/Sqlite.d.ts +4 -4
  71. package/dist/src/Sqlite.d.ts.map +1 -1
  72. package/dist/src/Sqlite.js +9 -8
  73. package/dist/src/Task.d.ts +441 -212
  74. package/dist/src/Task.d.ts.map +1 -1
  75. package/dist/src/Task.js +238 -115
  76. package/dist/src/Test.d.ts +10 -4
  77. package/dist/src/Test.d.ts.map +1 -1
  78. package/dist/src/Test.js +10 -4
  79. package/dist/src/Time.d.ts +27 -17
  80. package/dist/src/Time.d.ts.map +1 -1
  81. package/dist/src/Time.js +16 -6
  82. package/dist/src/Type.d.ts +1096 -387
  83. package/dist/src/Type.d.ts.map +1 -1
  84. package/dist/src/Type.js +1046 -372
  85. package/dist/src/Types.d.ts +95 -40
  86. package/dist/src/Types.d.ts.map +1 -1
  87. package/dist/src/Types.js +13 -4
  88. package/dist/src/WebSocket.d.ts +14 -6
  89. package/dist/src/WebSocket.d.ts.map +1 -1
  90. package/dist/src/Worker.d.ts +10 -6
  91. package/dist/src/Worker.d.ts.map +1 -1
  92. package/dist/src/intl/_en.d.ts +3 -1
  93. package/dist/src/intl/_en.d.ts.map +1 -1
  94. package/dist/src/intl/_en.js +17 -3
  95. package/dist/src/intl/ar.d.ts +3 -1
  96. package/dist/src/intl/ar.d.ts.map +1 -1
  97. package/dist/src/intl/ar.js +15 -2
  98. package/dist/src/intl/bn.d.ts +3 -1
  99. package/dist/src/intl/bn.d.ts.map +1 -1
  100. package/dist/src/intl/bn.js +16 -3
  101. package/dist/src/intl/ca.d.ts +3 -1
  102. package/dist/src/intl/ca.d.ts.map +1 -1
  103. package/dist/src/intl/ca.js +16 -3
  104. package/dist/src/intl/cs.d.ts +3 -1
  105. package/dist/src/intl/cs.d.ts.map +1 -1
  106. package/dist/src/intl/cs.js +16 -3
  107. package/dist/src/intl/da.d.ts +3 -1
  108. package/dist/src/intl/da.d.ts.map +1 -1
  109. package/dist/src/intl/da.js +16 -3
  110. package/dist/src/intl/de.d.ts +3 -1
  111. package/dist/src/intl/de.d.ts.map +1 -1
  112. package/dist/src/intl/de.js +16 -3
  113. package/dist/src/intl/el.d.ts +3 -1
  114. package/dist/src/intl/el.d.ts.map +1 -1
  115. package/dist/src/intl/el.js +16 -3
  116. package/dist/src/intl/es.d.ts +3 -1
  117. package/dist/src/intl/es.d.ts.map +1 -1
  118. package/dist/src/intl/es.js +16 -3
  119. package/dist/src/intl/fa.d.ts +3 -1
  120. package/dist/src/intl/fa.d.ts.map +1 -1
  121. package/dist/src/intl/fa.js +16 -3
  122. package/dist/src/intl/fi.d.ts +3 -1
  123. package/dist/src/intl/fi.d.ts.map +1 -1
  124. package/dist/src/intl/fi.js +16 -3
  125. package/dist/src/intl/fil.d.ts +3 -1
  126. package/dist/src/intl/fil.d.ts.map +1 -1
  127. package/dist/src/intl/fil.js +16 -3
  128. package/dist/src/intl/fr.d.ts +3 -1
  129. package/dist/src/intl/fr.d.ts.map +1 -1
  130. package/dist/src/intl/fr.js +16 -3
  131. package/dist/src/intl/he.d.ts +3 -1
  132. package/dist/src/intl/he.d.ts.map +1 -1
  133. package/dist/src/intl/he.js +16 -3
  134. package/dist/src/intl/hi.d.ts +3 -1
  135. package/dist/src/intl/hi.d.ts.map +1 -1
  136. package/dist/src/intl/hi.js +16 -3
  137. package/dist/src/intl/hr.d.ts +3 -1
  138. package/dist/src/intl/hr.d.ts.map +1 -1
  139. package/dist/src/intl/hr.js +16 -3
  140. package/dist/src/intl/hu.d.ts +2 -1
  141. package/dist/src/intl/hu.d.ts.map +1 -1
  142. package/dist/src/intl/hu.js +15 -3
  143. package/dist/src/intl/id.d.ts +3 -1
  144. package/dist/src/intl/id.d.ts.map +1 -1
  145. package/dist/src/intl/id.js +16 -3
  146. package/dist/src/intl/it.d.ts +3 -1
  147. package/dist/src/intl/it.d.ts.map +1 -1
  148. package/dist/src/intl/it.js +16 -3
  149. package/dist/src/intl/ja.d.ts +3 -1
  150. package/dist/src/intl/ja.d.ts.map +1 -1
  151. package/dist/src/intl/ja.js +16 -3
  152. package/dist/src/intl/ko.d.ts +3 -1
  153. package/dist/src/intl/ko.d.ts.map +1 -1
  154. package/dist/src/intl/ko.js +16 -3
  155. package/dist/src/intl/ml.d.ts +3 -1
  156. package/dist/src/intl/ml.d.ts.map +1 -1
  157. package/dist/src/intl/ml.js +16 -3
  158. package/dist/src/intl/mr.d.ts +3 -1
  159. package/dist/src/intl/mr.d.ts.map +1 -1
  160. package/dist/src/intl/mr.js +16 -3
  161. package/dist/src/intl/ms.d.ts +3 -1
  162. package/dist/src/intl/ms.d.ts.map +1 -1
  163. package/dist/src/intl/ms.js +15 -2
  164. package/dist/src/intl/nb.d.ts +2 -1
  165. package/dist/src/intl/nb.d.ts.map +1 -1
  166. package/dist/src/intl/nb.js +14 -2
  167. package/dist/src/intl/nl.d.ts +3 -1
  168. package/dist/src/intl/nl.d.ts.map +1 -1
  169. package/dist/src/intl/nl.js +16 -3
  170. package/dist/src/intl/pa.d.ts +3 -1
  171. package/dist/src/intl/pa.d.ts.map +1 -1
  172. package/dist/src/intl/pa.js +16 -3
  173. package/dist/src/intl/pl.d.ts +2 -0
  174. package/dist/src/intl/pl.d.ts.map +1 -1
  175. package/dist/src/intl/pl.js +15 -2
  176. package/dist/src/intl/pt-BR.d.ts +3 -1
  177. package/dist/src/intl/pt-BR.d.ts.map +1 -1
  178. package/dist/src/intl/pt-BR.js +16 -3
  179. package/dist/src/intl/pt.d.ts +3 -1
  180. package/dist/src/intl/pt.d.ts.map +1 -1
  181. package/dist/src/intl/pt.js +15 -2
  182. package/dist/src/intl/ro.d.ts +3 -1
  183. package/dist/src/intl/ro.d.ts.map +1 -1
  184. package/dist/src/intl/ro.js +16 -3
  185. package/dist/src/intl/sk.d.ts +3 -1
  186. package/dist/src/intl/sk.d.ts.map +1 -1
  187. package/dist/src/intl/sk.js +15 -2
  188. package/dist/src/intl/sl.d.ts +3 -1
  189. package/dist/src/intl/sl.d.ts.map +1 -1
  190. package/dist/src/intl/sl.js +16 -3
  191. package/dist/src/intl/sv.d.ts +3 -1
  192. package/dist/src/intl/sv.d.ts.map +1 -1
  193. package/dist/src/intl/sv.js +16 -3
  194. package/dist/src/intl/sw.d.ts +1 -0
  195. package/dist/src/intl/sw.d.ts.map +1 -1
  196. package/dist/src/intl/sw.js +14 -2
  197. package/dist/src/intl/ta.d.ts +3 -1
  198. package/dist/src/intl/ta.d.ts.map +1 -1
  199. package/dist/src/intl/ta.js +16 -3
  200. package/dist/src/intl/te.d.ts +3 -1
  201. package/dist/src/intl/te.d.ts.map +1 -1
  202. package/dist/src/intl/te.js +16 -3
  203. package/dist/src/intl/th.d.ts +3 -1
  204. package/dist/src/intl/th.d.ts.map +1 -1
  205. package/dist/src/intl/th.js +16 -3
  206. package/dist/src/intl/tr.d.ts +3 -1
  207. package/dist/src/intl/tr.d.ts.map +1 -1
  208. package/dist/src/intl/tr.js +16 -3
  209. package/dist/src/intl/uk.d.ts +3 -1
  210. package/dist/src/intl/uk.d.ts.map +1 -1
  211. package/dist/src/intl/uk.js +16 -3
  212. package/dist/src/intl/ur.d.ts +3 -1
  213. package/dist/src/intl/ur.d.ts.map +1 -1
  214. package/dist/src/intl/ur.js +15 -2
  215. package/dist/src/intl/vi.d.ts +3 -1
  216. package/dist/src/intl/vi.d.ts.map +1 -1
  217. package/dist/src/intl/vi.js +16 -3
  218. package/dist/src/intl/zh-CN.d.ts +3 -1
  219. package/dist/src/intl/zh-CN.d.ts.map +1 -1
  220. package/dist/src/intl/zh-CN.js +16 -3
  221. package/dist/src/intl/zh-TW.d.ts +3 -1
  222. package/dist/src/intl/zh-TW.d.ts.map +1 -1
  223. package/dist/src/intl/zh-TW.js +16 -3
  224. package/dist/src/local-first/Evolu.d.ts +47 -24
  225. package/dist/src/local-first/Evolu.d.ts.map +1 -1
  226. package/dist/src/local-first/Owner.d.ts +10 -7
  227. package/dist/src/local-first/Owner.d.ts.map +1 -1
  228. package/dist/src/local-first/Owner.js +10 -7
  229. package/dist/src/local-first/Protocol.d.ts +5 -5
  230. package/dist/src/local-first/Protocol.js +5 -5
  231. package/dist/src/local-first/Query.d.ts +34 -21
  232. package/dist/src/local-first/Query.d.ts.map +1 -1
  233. package/dist/src/local-first/Query.js +25 -13
  234. package/dist/src/local-first/Relay.d.ts +12 -5
  235. package/dist/src/local-first/Relay.d.ts.map +1 -1
  236. package/dist/src/local-first/Schema.d.ts +19 -11
  237. package/dist/src/local-first/Schema.d.ts.map +1 -1
  238. package/dist/src/local-first/Schema.js +11 -6
  239. package/dist/src/local-first/Storage.d.ts +4 -2
  240. package/dist/src/local-first/Storage.d.ts.map +1 -1
  241. package/package.json +3 -4
  242. package/src/Array.ts +170 -97
  243. package/src/Assert.ts +336 -31
  244. package/src/BigInt.ts +3 -3
  245. package/src/Brand.ts +7 -7
  246. package/src/Buffer.ts +12 -4
  247. package/src/Cache.ts +8 -3
  248. package/src/Callbacks.ts +8 -4
  249. package/src/Console.ts +45 -30
  250. package/src/Crypto.ts +13 -8
  251. package/src/Eq.ts +450 -122
  252. package/src/Function.ts +54 -24
  253. package/src/Http.ts +52 -19
  254. package/src/Identicon.ts +9 -4
  255. package/src/LockManager.ts +12 -10
  256. package/src/Lookup.ts +4 -2
  257. package/src/Number.ts +28 -24
  258. package/src/Object.ts +115 -49
  259. package/src/Option.ts +14 -5
  260. package/src/Order.ts +12 -12
  261. package/src/Platform.ts +2 -2
  262. package/src/Random.ts +7 -4
  263. package/src/Redacted.ts +13 -6
  264. package/src/Ref.ts +4 -4
  265. package/src/Relation.ts +5 -7
  266. package/src/Resource.ts +27 -12
  267. package/src/Result.ts +258 -114
  268. package/src/Schedule.ts +233 -116
  269. package/src/Set.ts +43 -24
  270. package/src/Sqlite.ts +9 -8
  271. package/src/Task.ts +441 -212
  272. package/src/Test.ts +10 -4
  273. package/src/Time.ts +27 -17
  274. package/src/Type.ts +2077 -620
  275. package/src/Types.ts +108 -40
  276. package/src/WebSocket.ts +14 -6
  277. package/src/Worker.ts +10 -6
  278. package/src/intl/_en.ts +20 -4
  279. package/src/intl/ar.ts +17 -2
  280. package/src/intl/bn.ts +19 -4
  281. package/src/intl/ca.ts +19 -4
  282. package/src/intl/cs.ts +19 -4
  283. package/src/intl/da.ts +19 -4
  284. package/src/intl/de.ts +19 -4
  285. package/src/intl/el.ts +19 -4
  286. package/src/intl/es.ts +19 -4
  287. package/src/intl/fa.ts +19 -4
  288. package/src/intl/fi.ts +19 -4
  289. package/src/intl/fil.ts +19 -4
  290. package/src/intl/fr.ts +19 -4
  291. package/src/intl/he.ts +19 -4
  292. package/src/intl/hi.ts +19 -4
  293. package/src/intl/hr.ts +19 -4
  294. package/src/intl/hu.ts +18 -4
  295. package/src/intl/id.ts +19 -4
  296. package/src/intl/it.ts +19 -4
  297. package/src/intl/ja.ts +19 -4
  298. package/src/intl/ko.ts +19 -4
  299. package/src/intl/ml.ts +19 -4
  300. package/src/intl/mr.ts +19 -4
  301. package/src/intl/ms.ts +17 -2
  302. package/src/intl/nb.ts +16 -2
  303. package/src/intl/nl.ts +19 -4
  304. package/src/intl/pa.ts +19 -4
  305. package/src/intl/pl.ts +18 -2
  306. package/src/intl/pt-BR.ts +19 -4
  307. package/src/intl/pt.ts +17 -2
  308. package/src/intl/ro.ts +19 -4
  309. package/src/intl/sk.ts +17 -2
  310. package/src/intl/sl.ts +19 -4
  311. package/src/intl/sv.ts +19 -4
  312. package/src/intl/sw.ts +15 -2
  313. package/src/intl/ta.ts +19 -4
  314. package/src/intl/te.ts +19 -4
  315. package/src/intl/th.ts +19 -4
  316. package/src/intl/tr.ts +19 -4
  317. package/src/intl/uk.ts +19 -4
  318. package/src/intl/ur.ts +17 -2
  319. package/src/intl/vi.ts +19 -3
  320. package/src/intl/zh-CN.ts +19 -4
  321. package/src/intl/zh-TW.ts +19 -4
  322. package/src/local-first/Evolu.ts +47 -24
  323. package/src/local-first/Owner.ts +10 -7
  324. package/src/local-first/Protocol.ts +5 -5
  325. package/src/local-first/Query.ts +34 -21
  326. package/src/local-first/Relay.ts +12 -5
  327. package/src/local-first/Schema.ts +19 -11
  328. package/src/local-first/Storage.ts +4 -2
package/src/intl/de.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -336,10 +337,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
336
337
  if (error.reason.kind === "NotSet") {
337
338
  return `Der Wert ${safelyStringifyUnknownValue(error.reason.value)} ist kein Set.`;
338
339
  }
339
- if (error.reason.kind === "UnexpectedPrototype") {
340
- return "Der Wert ist eine Instanz einer Set-Unterklasse, aber ein Set Output muss eine direkte Set-Instanz sein.";
341
- }
342
-
343
340
  const issue = error.reason.issues[0];
344
341
 
345
342
  switch (issue.kind) {
@@ -350,6 +347,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
350
347
  }
351
348
  };
352
349
 
350
+ /** Formatiert MapError auf Deutsch. */
351
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
352
+ if (error.reason.kind === "NotMap") {
353
+ return `Der Wert ${safelyStringifyUnknownValue(error.reason.value)} ist kein Map.`;
354
+ }
355
+ const issue = error.reason.issues[0];
356
+
357
+ switch (issue.kind) {
358
+ case "ExcessProperty":
359
+ return `Die zusätzliche Map-Property ${safelyStringifyUnknownValue(issue.key)} ist nicht zulässig.`;
360
+ case "Key":
361
+ case "Value":
362
+ return `Das Map-Element am Index ${issue.index} ist ungültig.`;
363
+ case "Collision":
364
+ return `Die Map-Keys ${safelyStringifyUnknownValue(issue.previousKey)} und ${safelyStringifyUnknownValue(issue.key)} werden zum selben Key ${safelyStringifyUnknownValue(issue.outputKey)} dekodiert.`;
365
+ }
366
+ };
367
+
353
368
  /** Formatiert TupleError auf Deutsch. */
354
369
  export const formatTupleError: TypeErrorFormatter<
355
370
  TupleError | TupleElementsError<TypeError>
package/src/intl/el.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -342,10 +343,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
342
343
  if (error.reason.kind === "NotSet") {
343
344
  return `Η τιμή ${safelyStringifyUnknownValue(error.reason.value)} δεν είναι Set.`;
344
345
  }
345
- if (error.reason.kind === "UnexpectedPrototype") {
346
- return "Η τιμή είναι στιγμιότυπο υποκλάσης Set, αλλά ένα Set Output πρέπει να είναι άμεσο στιγμιότυπο Set.";
347
- }
348
-
349
346
  const issue = error.reason.issues[0];
350
347
 
351
348
  switch (issue.kind) {
@@ -356,6 +353,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
356
353
  }
357
354
  };
358
355
 
356
+ /** Formats a MapError in Greek. */
357
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
358
+ if (error.reason.kind === "NotMap") {
359
+ return `Η τιμή ${safelyStringifyUnknownValue(error.reason.value)} δεν είναι Map.`;
360
+ }
361
+ const issue = error.reason.issues[0];
362
+
363
+ switch (issue.kind) {
364
+ case "ExcessProperty":
365
+ return `Δεν επιτρέπεται επιπλέον ιδιότητα Map ${safelyStringifyUnknownValue(issue.key)}.`;
366
+ case "Key":
367
+ case "Value":
368
+ return `Το στοιχείο Map στη θέση ${issue.index} δεν είναι έγκυρο.`;
369
+ case "Collision":
370
+ return `Τα κλειδιά Map ${safelyStringifyUnknownValue(issue.previousKey)} και ${safelyStringifyUnknownValue(issue.key)} αποκωδικοποιούνται στο ίδιο κλειδί ${safelyStringifyUnknownValue(issue.outputKey)}.`;
371
+ }
372
+ };
373
+
359
374
  /** Formats a TupleError in Greek. */
360
375
  export const formatTupleError: TypeErrorFormatter<
361
376
  TupleError | TupleElementsError<TypeError>
package/src/intl/es.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -336,10 +337,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
336
337
  if (error.reason.kind === "NotSet") {
337
338
  return `El valor ${safelyStringifyUnknownValue(error.reason.value)} no es un Set.`;
338
339
  }
339
- if (error.reason.kind === "UnexpectedPrototype") {
340
- return "El valor es una instancia de una subclase de Set, pero un Output de Set debe ser una instancia directa de Set.";
341
- }
342
-
343
340
  const issue = error.reason.issues[0];
344
341
 
345
342
  switch (issue.kind) {
@@ -350,6 +347,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
350
347
  }
351
348
  };
352
349
 
350
+ /** Formatea MapError en español. */
351
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
352
+ if (error.reason.kind === "NotMap") {
353
+ return `El valor ${safelyStringifyUnknownValue(error.reason.value)} no es un Map.`;
354
+ }
355
+ const issue = error.reason.issues[0];
356
+
357
+ switch (issue.kind) {
358
+ case "ExcessProperty":
359
+ return `No se permite la propiedad adicional de Map ${safelyStringifyUnknownValue(issue.key)}.`;
360
+ case "Key":
361
+ case "Value":
362
+ return `El elemento de Map en el índice ${issue.index} no es válido.`;
363
+ case "Collision":
364
+ return `Las claves de Map ${safelyStringifyUnknownValue(issue.previousKey)} y ${safelyStringifyUnknownValue(issue.key)} se decodifican como la misma clave ${safelyStringifyUnknownValue(issue.outputKey)}.`;
365
+ }
366
+ };
367
+
353
368
  /** Formatea TupleError en español. */
354
369
  export const formatTupleError: TypeErrorFormatter<
355
370
  TupleError | TupleElementsError<TypeError>
package/src/intl/fa.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -335,10 +336,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
335
336
  if (error.reason.kind === "NotSet") {
336
337
  return `مقدار ${safelyStringifyUnknownValue(error.reason.value)} یک Set نیست.`;
337
338
  }
338
- if (error.reason.kind === "UnexpectedPrototype") {
339
- return "مقدار نمونه‌ای از یک زیرکلاس Set است، اما خروجی Set باید مستقیماً نمونه‌ای از Set باشد.";
340
- }
341
-
342
339
  const issue = error.reason.issues[0];
343
340
 
344
341
  switch (issue.kind) {
@@ -349,6 +346,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
349
346
  }
350
347
  };
351
348
 
349
+ /** MapError را به فارسی قالب‌بندی می‌کند. */
350
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
351
+ if (error.reason.kind === "NotMap") {
352
+ return `مقدار ${safelyStringifyUnknownValue(error.reason.value)} یک Map نیست.`;
353
+ }
354
+ const issue = error.reason.issues[0];
355
+
356
+ switch (issue.kind) {
357
+ case "ExcessProperty":
358
+ return `property اضافی ${safelyStringifyUnknownValue(issue.key)} روی Map مجاز نیست.`;
359
+ case "Key":
360
+ case "Value":
361
+ return `عنصر Map در اندیس ${issue.index} نامعتبر است.`;
362
+ case "Collision":
363
+ return `کلیدهای Map یعنی ${safelyStringifyUnknownValue(issue.previousKey)} و ${safelyStringifyUnknownValue(issue.key)} پس از decode به کلید یکسان ${safelyStringifyUnknownValue(issue.outputKey)} تبدیل می‌شوند.`;
364
+ }
365
+ };
366
+
352
367
  /** TupleError را به فارسی قالب‌بندی می‌کند. */
353
368
  export const formatTupleError: TypeErrorFormatter<
354
369
  TupleError | TupleElementsError<TypeError>
package/src/intl/fi.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -335,10 +336,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
335
336
  if (error.reason.kind === "NotSet") {
336
337
  return `Arvo ${safelyStringifyUnknownValue(error.reason.value)} ei ole Set.`;
337
338
  }
338
- if (error.reason.kind === "UnexpectedPrototype") {
339
- return "Arvo on Set-aliluokan instanssi, mutta Set Outputin on oltava suora Set-instanssi.";
340
- }
341
-
342
339
  const issue = error.reason.issues[0];
343
340
 
344
341
  switch (issue.kind) {
@@ -349,6 +346,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
349
346
  }
350
347
  };
351
348
 
349
+ /** Muotoilee MapError-virheen suomeksi. */
350
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
351
+ if (error.reason.kind === "NotMap") {
352
+ return `Arvo ${safelyStringifyUnknownValue(error.reason.value)} ei ole Map.`;
353
+ }
354
+ const issue = error.reason.issues[0];
355
+
356
+ switch (issue.kind) {
357
+ case "ExcessProperty":
358
+ return `Ylimääräinen Map-ominaisuus ${safelyStringifyUnknownValue(issue.key)} ei ole sallittu.`;
359
+ case "Key":
360
+ case "Value":
361
+ return `Mapin indeksissä ${issue.index} oleva alkio on virheellinen.`;
362
+ case "Collision":
363
+ return `Map-avaimet ${safelyStringifyUnknownValue(issue.previousKey)} ja ${safelyStringifyUnknownValue(issue.key)} dekoodautuvat samaksi avaimeksi ${safelyStringifyUnknownValue(issue.outputKey)}.`;
364
+ }
365
+ };
366
+
352
367
  /** Muotoilee TupleError-virheen suomeksi. */
353
368
  export const formatTupleError: TypeErrorFormatter<
354
369
  TupleError | TupleElementsError<TypeError>
package/src/intl/fil.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -336,10 +337,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
336
337
  if (error.reason.kind === "NotSet") {
337
338
  return `Ang halagang ${safelyStringifyUnknownValue(error.reason.value)} ay hindi Set.`;
338
339
  }
339
- if (error.reason.kind === "UnexpectedPrototype") {
340
- return "Ang halaga ay instance ng Set subclass, ngunit ang Set Output ay dapat direktang Set instance.";
341
- }
342
-
343
340
  const issue = error.reason.issues[0];
344
341
 
345
342
  switch (issue.kind) {
@@ -350,6 +347,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
350
347
  }
351
348
  };
352
349
 
350
+ /** Fino-format ang MapError sa Filipino. */
351
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
352
+ if (error.reason.kind === "NotMap") {
353
+ return `Ang halagang ${safelyStringifyUnknownValue(error.reason.value)} ay hindi Map.`;
354
+ }
355
+ const issue = error.reason.issues[0];
356
+
357
+ switch (issue.kind) {
358
+ case "ExcessProperty":
359
+ return `Hindi pinapayagan ang sobrang Map property na ${safelyStringifyUnknownValue(issue.key)}.`;
360
+ case "Key":
361
+ case "Value":
362
+ return `Hindi valid ang Map element sa index na ${issue.index}.`;
363
+ case "Collision":
364
+ return `Ang Map keys na ${safelyStringifyUnknownValue(issue.previousKey)} at ${safelyStringifyUnknownValue(issue.key)} ay nade-decode sa iisang key na ${safelyStringifyUnknownValue(issue.outputKey)}.`;
365
+ }
366
+ };
367
+
353
368
  /** Fino-format ang TupleError sa Filipino. */
354
369
  export const formatTupleError: TypeErrorFormatter<
355
370
  TupleError | TupleElementsError<TypeError>
package/src/intl/fr.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -336,10 +337,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
336
337
  if (error.reason.kind === "NotSet") {
337
338
  return `La valeur ${safelyStringifyUnknownValue(error.reason.value)} n’est pas un Set.`;
338
339
  }
339
- if (error.reason.kind === "UnexpectedPrototype") {
340
- return "La valeur est une instance d’une sous-classe de Set, mais la sortie Set doit être une instance directe de Set.";
341
- }
342
-
343
340
  const issue = error.reason.issues[0];
344
341
 
345
342
  switch (issue.kind) {
@@ -350,6 +347,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
350
347
  }
351
348
  };
352
349
 
350
+ /** Formats a MapError in French. */
351
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
352
+ if (error.reason.kind === "NotMap") {
353
+ return `La valeur ${safelyStringifyUnknownValue(error.reason.value)} n’est pas un Map.`;
354
+ }
355
+ const issue = error.reason.issues[0];
356
+
357
+ switch (issue.kind) {
358
+ case "ExcessProperty":
359
+ return `La propriété Map excédentaire ${safelyStringifyUnknownValue(issue.key)} n’est pas autorisée.`;
360
+ case "Key":
361
+ case "Value":
362
+ return `L’élément Map à l’indice ${issue.index} n’est pas valide.`;
363
+ case "Collision":
364
+ return `Les clés Map ${safelyStringifyUnknownValue(issue.previousKey)} et ${safelyStringifyUnknownValue(issue.key)} sont décodées en la même clé ${safelyStringifyUnknownValue(issue.outputKey)}.`;
365
+ }
366
+ };
367
+
353
368
  /** Formats a TupleError in French. */
354
369
  export const formatTupleError: TypeErrorFormatter<
355
370
  TupleError | TupleElementsError<TypeError>
package/src/intl/he.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -334,10 +335,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
334
335
  if (error.reason.kind === "NotSet") {
335
336
  return `הערך ${safelyStringifyUnknownValue(error.reason.value)} אינו Set.`;
336
337
  }
337
- if (error.reason.kind === "UnexpectedPrototype") {
338
- return "הערך הוא מופע של תת-מחלקה של Set, אך פלט של Set חייב להיות מופע ישיר של Set.";
339
- }
340
-
341
338
  const issue = error.reason.issues[0];
342
339
 
343
340
  switch (issue.kind) {
@@ -348,6 +345,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
348
345
  }
349
346
  };
350
347
 
348
+ /** מעצב שגיאת MapError בעברית. */
349
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
350
+ if (error.reason.kind === "NotMap") {
351
+ return `הערך ${safelyStringifyUnknownValue(error.reason.value)} אינו Map.`;
352
+ }
353
+ const issue = error.reason.issues[0];
354
+
355
+ switch (issue.kind) {
356
+ case "ExcessProperty":
357
+ return `מאפיין Map העודף ${safelyStringifyUnknownValue(issue.key)} אינו מותר.`;
358
+ case "Key":
359
+ case "Value":
360
+ return `איבר Map באינדקס ${issue.index} אינו חוקי.`;
361
+ case "Collision":
362
+ return `המפתחות ${safelyStringifyUnknownValue(issue.previousKey)} ו-${safelyStringifyUnknownValue(issue.key)} של Map מפוענחים לאותו מפתח ${safelyStringifyUnknownValue(issue.outputKey)}.`;
363
+ }
364
+ };
365
+
351
366
  /** מעצב שגיאת TupleError בעברית. */
352
367
  export const formatTupleError: TypeErrorFormatter<
353
368
  TupleError | TupleElementsError<TypeError>
package/src/intl/hi.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -335,10 +336,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
335
336
  if (error.reason.kind === "NotSet") {
336
337
  return `मान ${safelyStringifyUnknownValue(error.reason.value)} Set नहीं है।`;
337
338
  }
338
- if (error.reason.kind === "UnexpectedPrototype") {
339
- return "मान Set subclass का instance है, लेकिन Set Output को सीधे Set का instance होना चाहिए।";
340
- }
341
-
342
339
  const issue = error.reason.issues[0];
343
340
 
344
341
  switch (issue.kind) {
@@ -349,6 +346,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
349
346
  }
350
347
  };
351
348
 
349
+ /** MapError को हिंदी में format करता है। */
350
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
351
+ if (error.reason.kind === "NotMap") {
352
+ return `मान ${safelyStringifyUnknownValue(error.reason.value)} Map नहीं है।`;
353
+ }
354
+ const issue = error.reason.issues[0];
355
+
356
+ switch (issue.kind) {
357
+ case "ExcessProperty":
358
+ return `अतिरिक्त Map property ${safelyStringifyUnknownValue(issue.key)} की अनुमति नहीं है।`;
359
+ case "Key":
360
+ case "Value":
361
+ return `index ${issue.index} पर Map element अमान्य है।`;
362
+ case "Collision":
363
+ return `Map keys ${safelyStringifyUnknownValue(issue.previousKey)} और ${safelyStringifyUnknownValue(issue.key)} decode होकर एक ही key ${safelyStringifyUnknownValue(issue.outputKey)} बनती हैं।`;
364
+ }
365
+ };
366
+
352
367
  /** TupleError को हिंदी में format करता है। */
353
368
  export const formatTupleError: TypeErrorFormatter<
354
369
  TupleError | TupleElementsError<TypeError>
package/src/intl/hr.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -342,10 +343,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
342
343
  if (error.reason.kind === "NotSet") {
343
344
  return `Vrijednost ${safelyStringifyUnknownValue(error.reason.value)} nije Set.`;
344
345
  }
345
- if (error.reason.kind === "UnexpectedPrototype") {
346
- return "Vrijednost je instanca podklase Set, ali izlaz tipa Set mora biti izravna instanca Set-a.";
347
- }
348
-
349
346
  const issue = error.reason.issues[0];
350
347
 
351
348
  switch (issue.kind) {
@@ -356,6 +353,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
356
353
  }
357
354
  };
358
355
 
356
+ /** Formats a MapError in Croatian. */
357
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
358
+ if (error.reason.kind === "NotMap") {
359
+ return `Vrijednost ${safelyStringifyUnknownValue(error.reason.value)} nije Map.`;
360
+ }
361
+ const issue = error.reason.issues[0];
362
+
363
+ switch (issue.kind) {
364
+ case "ExcessProperty":
365
+ return `Dodatno svojstvo Map-a ${safelyStringifyUnknownValue(issue.key)} nije dopušteno.`;
366
+ case "Key":
367
+ case "Value":
368
+ return `Element Map-a na indeksu ${issue.index} nije valjan.`;
369
+ case "Collision":
370
+ return `Ključevi Map-a ${safelyStringifyUnknownValue(issue.previousKey)} i ${safelyStringifyUnknownValue(issue.key)} dekodiraju se u isti ključ ${safelyStringifyUnknownValue(issue.outputKey)}.`;
371
+ }
372
+ };
373
+
359
374
  /** Formats a TupleError in Croatian. */
360
375
  export const formatTupleError: TypeErrorFormatter<
361
376
  TupleError | TupleElementsError<TypeError>
package/src/intl/hu.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -241,10 +242,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
241
242
  if (error.reason.kind === "NotSet") {
242
243
  return `A(z) ${safelyStringifyUnknownValue(error.reason.value)} érték nem Set.`;
243
244
  }
244
- if (error.reason.kind === "UnexpectedPrototype") {
245
- return "Az érték egy Set-alosztály példánya, de a Set Outputnak közvetlen Set-példánynak kell lennie.";
246
- }
247
-
248
245
  const issue = error.reason.issues[0];
249
246
 
250
247
  switch (issue.kind) {
@@ -255,6 +252,23 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
255
252
  }
256
253
  };
257
254
 
255
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
256
+ if (error.reason.kind === "NotMap") {
257
+ return `A(z) ${safelyStringifyUnknownValue(error.reason.value)} érték nem Map.`;
258
+ }
259
+ const issue = error.reason.issues[0];
260
+
261
+ switch (issue.kind) {
262
+ case "ExcessProperty":
263
+ return `A többlet Map-tulajdonság ${safelyStringifyUnknownValue(issue.key)} nem engedélyezett.`;
264
+ case "Key":
265
+ case "Value":
266
+ return `A(z) ${issue.index} indexen lévő Map-elem érvénytelen.`;
267
+ case "Collision":
268
+ return `A(z) ${safelyStringifyUnknownValue(issue.previousKey)} és ${safelyStringifyUnknownValue(issue.key)} Map-kulcs ugyanarra a(z) ${safelyStringifyUnknownValue(issue.outputKey)} kulcsra dekódolódik.`;
269
+ }
270
+ };
271
+
258
272
  export const formatTupleError: TypeErrorFormatter<
259
273
  TupleError | TupleElementsError<TypeError>
260
274
  > = (error) => {
package/src/intl/id.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -335,10 +336,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
335
336
  if (error.reason.kind === "NotSet") {
336
337
  return `Nilai ${safelyStringifyUnknownValue(error.reason.value)} bukan Set.`;
337
338
  }
338
- if (error.reason.kind === "UnexpectedPrototype") {
339
- return "Nilai tersebut adalah instance subclass Set, tetapi Output Set harus berupa instance Set langsung.";
340
- }
341
-
342
339
  const issue = error.reason.issues[0];
343
340
 
344
341
  switch (issue.kind) {
@@ -349,6 +346,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
349
346
  }
350
347
  };
351
348
 
349
+ /** Formats a MapError in Indonesian. */
350
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
351
+ if (error.reason.kind === "NotMap") {
352
+ return `Nilai ${safelyStringifyUnknownValue(error.reason.value)} bukan Map.`;
353
+ }
354
+ const issue = error.reason.issues[0];
355
+
356
+ switch (issue.kind) {
357
+ case "ExcessProperty":
358
+ return `Properti Map berlebih ${safelyStringifyUnknownValue(issue.key)} tidak diizinkan.`;
359
+ case "Key":
360
+ case "Value":
361
+ return `Elemen Map pada indeks ${issue.index} tidak valid.`;
362
+ case "Collision":
363
+ return `Kunci Map ${safelyStringifyUnknownValue(issue.previousKey)} dan ${safelyStringifyUnknownValue(issue.key)} didekode menjadi kunci yang sama, ${safelyStringifyUnknownValue(issue.outputKey)}.`;
364
+ }
365
+ };
366
+
352
367
  /** Formats a TupleError in Indonesian. */
353
368
  export const formatTupleError: TypeErrorFormatter<
354
369
  TupleError | TupleElementsError<TypeError>
package/src/intl/it.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -336,10 +337,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
336
337
  if (error.reason.kind === "NotSet") {
337
338
  return `Il valore ${safelyStringifyUnknownValue(error.reason.value)} non è un Set.`;
338
339
  }
339
- if (error.reason.kind === "UnexpectedPrototype") {
340
- return "Il valore è un’istanza di una sottoclasse di Set, ma l’Output di Set deve essere un’istanza diretta di Set.";
341
- }
342
-
343
340
  const issue = error.reason.issues[0];
344
341
 
345
342
  switch (issue.kind) {
@@ -350,6 +347,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
350
347
  }
351
348
  };
352
349
 
350
+ /** Formatta MapError in italiano. */
351
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
352
+ if (error.reason.kind === "NotMap") {
353
+ return `Il valore ${safelyStringifyUnknownValue(error.reason.value)} non è un Map.`;
354
+ }
355
+ const issue = error.reason.issues[0];
356
+
357
+ switch (issue.kind) {
358
+ case "ExcessProperty":
359
+ return `La proprietà Map in eccesso ${safelyStringifyUnknownValue(issue.key)} non è consentita.`;
360
+ case "Key":
361
+ case "Value":
362
+ return `L’elemento del Map all’indice ${issue.index} non è valido.`;
363
+ case "Collision":
364
+ return `Le chiavi Map ${safelyStringifyUnknownValue(issue.previousKey)} e ${safelyStringifyUnknownValue(issue.key)} vengono decodificate nella stessa chiave ${safelyStringifyUnknownValue(issue.outputKey)}.`;
365
+ }
366
+ };
367
+
353
368
  /** Formatta TupleError in italiano. */
354
369
  export const formatTupleError: TypeErrorFormatter<
355
370
  TupleError | TupleElementsError<TypeError>
package/src/intl/ja.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -336,10 +337,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
336
337
  if (error.reason.kind === "NotSet") {
337
338
  return `値 ${safelyStringifyUnknownValue(error.reason.value)} は Set ではありません。`;
338
339
  }
339
- if (error.reason.kind === "UnexpectedPrototype") {
340
- return "値は Set のサブクラスのインスタンスですが、Set Output は Set 自体のインスタンスである必要があります。";
341
- }
342
-
343
340
  const issue = error.reason.issues[0];
344
341
 
345
342
  switch (issue.kind) {
@@ -350,6 +347,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
350
347
  }
351
348
  };
352
349
 
350
+ /** MapError を日本語でフォーマットします。 */
351
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
352
+ if (error.reason.kind === "NotMap") {
353
+ return `値 ${safelyStringifyUnknownValue(error.reason.value)} は Map ではありません。`;
354
+ }
355
+ const issue = error.reason.issues[0];
356
+
357
+ switch (issue.kind) {
358
+ case "ExcessProperty":
359
+ return `余分な Map プロパティ ${safelyStringifyUnknownValue(issue.key)} は許可されていません。`;
360
+ case "Key":
361
+ case "Value":
362
+ return `インデックス ${issue.index} の Map 要素が無効です。`;
363
+ case "Collision":
364
+ return `Map キー ${safelyStringifyUnknownValue(issue.previousKey)} と ${safelyStringifyUnknownValue(issue.key)} は、デコードすると同じキー ${safelyStringifyUnknownValue(issue.outputKey)} になります。`;
365
+ }
366
+ };
367
+
353
368
  /** TupleError を日本語でフォーマットします。 */
354
369
  export const formatTupleError: TypeErrorFormatter<
355
370
  TupleError | TupleElementsError<TypeError>
package/src/intl/ko.ts CHANGED
@@ -30,6 +30,7 @@ import type {
30
30
  LessThanError,
31
31
  LessThanOrEqualToError,
32
32
  LiteralError,
33
+ MapError,
33
34
  MaxLengthError,
34
35
  MinLengthError,
35
36
  MnemonicError,
@@ -335,10 +336,6 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
335
336
  if (error.reason.kind === "NotSet") {
336
337
  return `${safelyStringifyUnknownValue(error.reason.value)} 값은 Set이 아닙니다.`;
337
338
  }
338
- if (error.reason.kind === "UnexpectedPrototype") {
339
- return "값은 Set 서브클래스의 인스턴스이지만 Set Output은 직접적인 Set 인스턴스여야 합니다.";
340
- }
341
-
342
339
  const issue = error.reason.issues[0];
343
340
 
344
341
  switch (issue.kind) {
@@ -349,6 +346,24 @@ export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
349
346
  }
350
347
  };
351
348
 
349
+ /** MapError를 한국어로 포맷합니다. */
350
+ export const formatMapError: TypeErrorFormatter<MapError> = (error) => {
351
+ if (error.reason.kind === "NotMap") {
352
+ return `${safelyStringifyUnknownValue(error.reason.value)} 값은 Map이 아닙니다.`;
353
+ }
354
+ const issue = error.reason.issues[0];
355
+
356
+ switch (issue.kind) {
357
+ case "ExcessProperty":
358
+ return `불필요한 Map 프로퍼티 ${safelyStringifyUnknownValue(issue.key)}은(는) 허용되지 않습니다.`;
359
+ case "Key":
360
+ case "Value":
361
+ return `인덱스 ${issue.index}의 Map 요소가 유효하지 않습니다.`;
362
+ case "Collision":
363
+ return `Map 키 ${safelyStringifyUnknownValue(issue.previousKey)}와(과) ${safelyStringifyUnknownValue(issue.key)}은(는) 디코딩하면 동일한 키 ${safelyStringifyUnknownValue(issue.outputKey)}이(가) 됩니다.`;
364
+ }
365
+ };
366
+
352
367
  /** TupleError를 한국어로 포맷합니다. */
353
368
  export const formatTupleError: TypeErrorFormatter<
354
369
  TupleError | TupleElementsError<TypeError>