@evolu/common 8.2.0 → 8.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/Function.d.ts +1 -0
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Http.d.ts +9 -0
- package/dist/src/Http.d.ts.map +1 -1
- package/dist/src/Object.d.ts +1 -0
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/RefCount.d.ts +1 -0
- package/dist/src/RefCount.d.ts.map +1 -1
- package/dist/src/Relation.d.ts +2 -0
- package/dist/src/Relation.d.ts.map +1 -1
- package/dist/src/Resource.d.ts +1 -0
- package/dist/src/Resource.d.ts.map +1 -1
- package/dist/src/Result.d.ts +383 -548
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +296 -46
- package/dist/src/StackTrace.d.ts +1 -0
- package/dist/src/StackTrace.d.ts.map +1 -1
- package/dist/src/Task.d.ts +985 -1069
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +1007 -156
- package/dist/src/Time.d.ts +1 -0
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Type.d.ts +1322 -793
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +1192 -244
- package/dist/src/intl/_en.d.ts +126 -0
- package/dist/src/intl/_en.d.ts.map +1 -0
- package/dist/src/intl/_en.js +267 -0
- package/dist/src/intl/ar.d.ts +117 -0
- package/dist/src/intl/ar.d.ts.map +1 -0
- package/dist/src/intl/ar.js +245 -0
- package/dist/src/intl/bn.d.ts +117 -0
- package/dist/src/intl/bn.d.ts.map +1 -0
- package/dist/src/intl/bn.js +258 -0
- package/dist/src/intl/ca.d.ts +117 -0
- package/dist/src/intl/ca.d.ts.map +1 -0
- package/dist/src/intl/ca.js +258 -0
- package/dist/src/intl/cs.d.ts +20 -7
- package/dist/src/intl/cs.d.ts.map +1 -1
- package/dist/src/intl/cs.js +54 -27
- package/dist/src/intl/da.d.ts +117 -0
- package/dist/src/intl/da.d.ts.map +1 -0
- package/dist/src/intl/da.js +258 -0
- package/dist/src/intl/de.d.ts +117 -0
- package/dist/src/intl/de.d.ts.map +1 -0
- package/dist/src/intl/de.js +258 -0
- package/dist/src/intl/el.d.ts +117 -0
- package/dist/src/intl/el.d.ts.map +1 -0
- package/dist/src/intl/el.js +265 -0
- package/dist/src/intl/es.d.ts +117 -0
- package/dist/src/intl/es.d.ts.map +1 -0
- package/dist/src/intl/es.js +258 -0
- package/dist/src/intl/fa.d.ts +117 -0
- package/dist/src/intl/fa.d.ts.map +1 -0
- package/dist/src/intl/fa.js +258 -0
- package/dist/src/intl/fi.d.ts +117 -0
- package/dist/src/intl/fi.d.ts.map +1 -0
- package/dist/src/intl/fi.js +258 -0
- package/dist/src/intl/fil.d.ts +117 -0
- package/dist/src/intl/fil.d.ts.map +1 -0
- package/dist/src/intl/fil.js +258 -0
- package/dist/src/intl/fr.d.ts +117 -0
- package/dist/src/intl/fr.d.ts.map +1 -0
- package/dist/src/intl/fr.js +258 -0
- package/dist/src/intl/he.d.ts +117 -0
- package/dist/src/intl/he.d.ts.map +1 -0
- package/dist/src/intl/he.js +258 -0
- package/dist/src/intl/hi.d.ts +117 -0
- package/dist/src/intl/hi.d.ts.map +1 -0
- package/dist/src/intl/hi.js +258 -0
- package/dist/src/intl/hr.d.ts +117 -0
- package/dist/src/intl/hr.d.ts.map +1 -0
- package/dist/src/intl/hr.js +265 -0
- package/dist/src/intl/hu.d.ts +63 -0
- package/dist/src/intl/hu.d.ts.map +1 -0
- package/dist/src/intl/hu.js +204 -0
- package/dist/src/intl/id.d.ts +117 -0
- package/dist/src/intl/id.d.ts.map +1 -0
- package/dist/src/intl/id.js +258 -0
- package/dist/src/intl/index.d.ts +42 -0
- package/dist/src/intl/index.d.ts.map +1 -1
- package/dist/src/intl/index.js +42 -0
- package/dist/src/intl/it.d.ts +117 -0
- package/dist/src/intl/it.d.ts.map +1 -0
- package/dist/src/intl/it.js +258 -0
- package/dist/src/intl/ja.d.ts +117 -0
- package/dist/src/intl/ja.d.ts.map +1 -0
- package/dist/src/intl/ja.js +258 -0
- package/dist/src/intl/ko.d.ts +117 -0
- package/dist/src/intl/ko.d.ts.map +1 -0
- package/dist/src/intl/ko.js +258 -0
- package/dist/src/intl/ml.d.ts +117 -0
- package/dist/src/intl/ml.d.ts.map +1 -0
- package/dist/src/intl/ml.js +258 -0
- package/dist/src/intl/mr.d.ts +117 -0
- package/dist/src/intl/mr.d.ts.map +1 -0
- package/dist/src/intl/mr.js +258 -0
- package/dist/src/intl/ms.d.ts +117 -0
- package/dist/src/intl/ms.d.ts.map +1 -0
- package/dist/src/intl/ms.js +245 -0
- package/dist/src/intl/nb.d.ts +63 -0
- package/dist/src/intl/nb.d.ts.map +1 -0
- package/dist/src/intl/nb.js +191 -0
- package/dist/src/intl/nl.d.ts +117 -0
- package/dist/src/intl/nl.d.ts.map +1 -0
- package/dist/src/intl/nl.js +258 -0
- package/dist/src/intl/pa.d.ts +117 -0
- package/dist/src/intl/pa.d.ts.map +1 -0
- package/dist/src/intl/pa.js +258 -0
- package/dist/src/intl/pl.d.ts +117 -0
- package/dist/src/intl/pl.d.ts.map +1 -0
- package/dist/src/intl/pl.js +242 -0
- package/dist/src/intl/pt-BR.d.ts +117 -0
- package/dist/src/intl/pt-BR.d.ts.map +1 -0
- package/dist/src/intl/pt-BR.js +258 -0
- package/dist/src/intl/pt.d.ts +117 -0
- package/dist/src/intl/pt.d.ts.map +1 -0
- package/dist/src/intl/pt.js +246 -0
- package/dist/src/intl/ro.d.ts +117 -0
- package/dist/src/intl/ro.d.ts.map +1 -0
- package/dist/src/intl/ro.js +258 -0
- package/dist/src/intl/sk.d.ts +117 -0
- package/dist/src/intl/sk.d.ts.map +1 -0
- package/dist/src/intl/sk.js +244 -0
- package/dist/src/intl/sl.d.ts +117 -0
- package/dist/src/intl/sl.d.ts.map +1 -0
- package/dist/src/intl/sl.js +258 -0
- package/dist/src/intl/sv.d.ts +117 -0
- package/dist/src/intl/sv.d.ts.map +1 -0
- package/dist/src/intl/sv.js +258 -0
- package/dist/src/intl/sw.d.ts +63 -0
- package/dist/src/intl/sw.d.ts.map +1 -0
- package/dist/src/intl/sw.js +191 -0
- package/dist/src/intl/ta.d.ts +117 -0
- package/dist/src/intl/ta.d.ts.map +1 -0
- package/dist/src/intl/ta.js +258 -0
- package/dist/src/intl/te.d.ts +117 -0
- package/dist/src/intl/te.d.ts.map +1 -0
- package/dist/src/intl/te.js +258 -0
- package/dist/src/intl/th.d.ts +117 -0
- package/dist/src/intl/th.d.ts.map +1 -0
- package/dist/src/intl/th.js +258 -0
- package/dist/src/intl/tr.d.ts +117 -0
- package/dist/src/intl/tr.d.ts.map +1 -0
- package/dist/src/intl/tr.js +255 -0
- package/dist/src/intl/uk.d.ts +117 -0
- package/dist/src/intl/uk.d.ts.map +1 -0
- package/dist/src/intl/uk.js +258 -0
- package/dist/src/intl/ur.d.ts +117 -0
- package/dist/src/intl/ur.d.ts.map +1 -0
- package/dist/src/intl/ur.js +245 -0
- package/dist/src/intl/vi.d.ts +117 -0
- package/dist/src/intl/vi.d.ts.map +1 -0
- package/dist/src/intl/vi.js +255 -0
- package/dist/src/intl/zh-CN.d.ts +117 -0
- package/dist/src/intl/zh-CN.d.ts.map +1 -0
- package/dist/src/intl/zh-CN.js +258 -0
- package/dist/src/intl/zh-TW.d.ts +117 -0
- package/dist/src/intl/zh-TW.d.ts.map +1 -0
- package/dist/src/intl/zh-TW.js +258 -0
- package/dist/src/local-first/Owner.d.ts +156 -62
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +119 -20
- package/package.json +1 -1
- package/src/Function.ts +2 -0
- package/src/Http.ts +9 -0
- package/src/Object.ts +2 -0
- package/src/RefCount.ts +2 -0
- package/src/Relation.ts +4 -0
- package/src/Resource.ts +2 -0
- package/src/Result.ts +397 -560
- package/src/StackTrace.ts +2 -0
- package/src/Task.ts +1143 -1222
- package/src/Time.ts +2 -0
- package/src/Type.ts +1759 -794
- package/src/intl/_en.ts +497 -0
- package/src/intl/ar.ts +417 -0
- package/src/intl/bn.ts +486 -0
- package/src/intl/ca.ts +488 -0
- package/src/intl/cs.ts +95 -31
- package/src/intl/da.ts +488 -0
- package/src/intl/de.ts +488 -0
- package/src/intl/el.ts +494 -0
- package/src/intl/es.ts +488 -0
- package/src/intl/fa.ts +487 -0
- package/src/intl/fi.ts +487 -0
- package/src/intl/fil.ts +488 -0
- package/src/intl/fr.ts +488 -0
- package/src/intl/he.ts +486 -0
- package/src/intl/hi.ts +487 -0
- package/src/intl/hr.ts +494 -0
- package/src/intl/hu.ts +387 -0
- package/src/intl/id.ts +487 -0
- package/src/intl/index.ts +42 -0
- package/src/intl/it.ts +488 -0
- package/src/intl/ja.ts +488 -0
- package/src/intl/ko.ts +487 -0
- package/src/intl/ml.ts +487 -0
- package/src/intl/mr.ts +487 -0
- package/src/intl/ms.ts +410 -0
- package/src/intl/nb.ts +364 -0
- package/src/intl/nl.ts +488 -0
- package/src/intl/pa.ts +487 -0
- package/src/intl/pl.ts +450 -0
- package/src/intl/pt-BR.ts +487 -0
- package/src/intl/pt.ts +424 -0
- package/src/intl/ro.ts +488 -0
- package/src/intl/sk.ts +412 -0
- package/src/intl/sl.ts +487 -0
- package/src/intl/sv.ts +488 -0
- package/src/intl/sw.ts +324 -0
- package/src/intl/ta.ts +487 -0
- package/src/intl/te.ts +487 -0
- package/src/intl/th.ts +484 -0
- package/src/intl/tr.ts +487 -0
- package/src/intl/uk.ts +488 -0
- package/src/intl/ur.ts +410 -0
- package/src/intl/vi.ts +435 -0
- package/src/intl/zh-CN.ts +482 -0
- package/src/intl/zh-TW.ts +482 -0
- package/src/local-first/Owner.ts +156 -62
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatatoare românești pentru erorile Evolu Type.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { assertNonNullable } from "../Assert.js";
|
|
7
|
+
import { safelyStringifyUnknownValue } from "../String.js";
|
|
8
|
+
const formatTypeOfError = (error) => {
|
|
9
|
+
const typeOf = error.expected.toLowerCase();
|
|
10
|
+
return `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este de tipul ${typeOf}.`;
|
|
11
|
+
};
|
|
12
|
+
const formatPlainObjectRootError = (reason) => reason.kind === "NotObject"
|
|
13
|
+
? `Valoarea ${safelyStringifyUnknownValue(reason.value)} nu este un obiect.`
|
|
14
|
+
: "Valoarea este un obiect, dar un Output Object trebuie să fie un obiect simplu sau să aibă un prototip null.";
|
|
15
|
+
/** Formatează un NeverError în română. */
|
|
16
|
+
export const formatNeverError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este validă pentru tipul Never.`;
|
|
17
|
+
/** Formatează un String TypeOfError în română. */
|
|
18
|
+
export const formatStringError = formatTypeOfError;
|
|
19
|
+
/** Formatează un TemplateLiteralError în română. */
|
|
20
|
+
export const formatTemplateLiteralError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu corespunde șablonului literal.`;
|
|
21
|
+
/** Formatează un Number TypeOfError în română. */
|
|
22
|
+
export const formatNumberError = formatTypeOfError;
|
|
23
|
+
/** Formatează un BigInt TypeOfError în română. */
|
|
24
|
+
export const formatBigIntError = formatTypeOfError;
|
|
25
|
+
/** Formatează un Boolean TypeOfError în română. */
|
|
26
|
+
export const formatBooleanError = formatTypeOfError;
|
|
27
|
+
/** Formatează un Symbol TypeOfError în română. */
|
|
28
|
+
export const formatSymbolError = formatTypeOfError;
|
|
29
|
+
/** Formatează un Function TypeOfError în română. */
|
|
30
|
+
export const formatFunctionError = formatTypeOfError;
|
|
31
|
+
/** Formatează un EvoluTypeError în română. */
|
|
32
|
+
export const formatEvoluTypeError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un Evolu Type.`;
|
|
33
|
+
/** Formatează un ObjectTagError în română. */
|
|
34
|
+
export const formatObjectTagError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu are eticheta de obiect așteptată ${safelyStringifyUnknownValue(error.expected)}.`;
|
|
35
|
+
/** Formatează un InstanceOfError în română. */
|
|
36
|
+
export const formatInstanceOfError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este o instanță a ${error.constructorName}.`;
|
|
37
|
+
/** Formatează un LiteralError în română. */
|
|
38
|
+
export const formatLiteralError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este strict egală cu literalul așteptat: ${globalThis.String(error.expected)}.`;
|
|
39
|
+
/** Formatează un UnionError în română. */
|
|
40
|
+
export const formatUnionError = () => "O valoare nu corespunde niciunei variante permise.";
|
|
41
|
+
/** Formatează un DateIsoError în română. */
|
|
42
|
+
export const formatDateIsoError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un șir canonic de dată și oră ISO.`;
|
|
43
|
+
/** Formatează un DateIsoFromDateError în română. */
|
|
44
|
+
export const formatDateIsoFromDateError = () => "Date nu poate fi reprezentat ca DateIso.";
|
|
45
|
+
/** Formatează un DecimalStringError în română. */
|
|
46
|
+
export const formatDecimalStringError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un șir zecimal canonic.`;
|
|
47
|
+
/** Formatează un Int64Error în română. */
|
|
48
|
+
export const formatInt64Error = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un număr întreg cu semn valid pe 64 de biți (Int64).`;
|
|
49
|
+
/** Formatează un UInt64Error în română. */
|
|
50
|
+
export const formatUInt64Error = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un număr întreg fără semn valid pe 64 de biți (UInt64).`;
|
|
51
|
+
/** Formatează un Int64StringError în română. */
|
|
52
|
+
export const formatInt64StringError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un șir Int64 valid.`;
|
|
53
|
+
/** Formatează un CapitalizedError în română. */
|
|
54
|
+
export const formatCapitalizedError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să înceapă cu literă mare.`;
|
|
55
|
+
/** Formatează un TrimmedError în română. */
|
|
56
|
+
export const formatTrimmedError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie fără spații la început sau la sfârșit.`;
|
|
57
|
+
/** Formatează un MinLengthError în română. */
|
|
58
|
+
export const formatMinLengthError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu îndeplinește lungimea minimă de ${error.min}.`;
|
|
59
|
+
/** Formatează un MaxLengthError în română. */
|
|
60
|
+
export const formatMaxLengthError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} depășește lungimea maximă de ${error.max}.`;
|
|
61
|
+
/** Formatează un LengthError în română. */
|
|
62
|
+
export const formatLengthError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu are lungimea necesară de ${error.exact}.`;
|
|
63
|
+
/** Formatează un RegexError în română. */
|
|
64
|
+
export const formatRegexError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu corespunde cu /${error.source}/${error.flags}.`;
|
|
65
|
+
/** Formatează un Base64UrlError în română. */
|
|
66
|
+
export const formatBase64UrlError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un șir Base64Url valid.`;
|
|
67
|
+
/** Formatează un NameError în română. */
|
|
68
|
+
export const formatNameError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un Name valid.`;
|
|
69
|
+
/** Formatează un MnemonicError în română. */
|
|
70
|
+
export const formatMnemonicError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este o frază mnemonică BIP39 în engleză validă.`;
|
|
71
|
+
/** Formatează un IdError în română. */
|
|
72
|
+
export const formatIdError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un Id valid.`;
|
|
73
|
+
/** Formatează un TableIdError în română. */
|
|
74
|
+
export const formatTableIdError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu este un Id valid pentru tabelul ${error.table}.`;
|
|
75
|
+
/** Formatează un NonNegativeError în română. */
|
|
76
|
+
export const formatNonNegativeError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie nenegativă (>= 0).`;
|
|
77
|
+
/** Formatează un NonNegativeDecimalStringError în română. */
|
|
78
|
+
export const formatNonNegativeDecimalStringError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un șir zecimal nenegativ.`;
|
|
79
|
+
/** Formatează un PositiveError în română. */
|
|
80
|
+
export const formatPositiveError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie pozitivă (> 0).`;
|
|
81
|
+
/** Formatează un PositiveDecimalStringError în română. */
|
|
82
|
+
export const formatPositiveDecimalStringError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un șir zecimal pozitiv.`;
|
|
83
|
+
/** Formatează un NonPositiveError în română. */
|
|
84
|
+
export const formatNonPositiveError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie nepozitivă (<= 0).`;
|
|
85
|
+
/** Formatează un NonPositiveDecimalStringError în română. */
|
|
86
|
+
export const formatNonPositiveDecimalStringError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un șir zecimal nepozitiv.`;
|
|
87
|
+
/** Formatează un NegativeError în română. */
|
|
88
|
+
export const formatNegativeError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie negativă (< 0).`;
|
|
89
|
+
/** Formatează un NegativeDecimalStringError în română. */
|
|
90
|
+
export const formatNegativeDecimalStringError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un șir zecimal negativ.`;
|
|
91
|
+
/** Formatează un IntError în română. */
|
|
92
|
+
export const formatIntError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un număr întreg sigur.`;
|
|
93
|
+
/** Formatează un GreaterThanError în română. */
|
|
94
|
+
export const formatGreaterThanError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie mai mare decât ${error.min}.`;
|
|
95
|
+
/** Formatează un GreaterThanOrEqualToError în română. */
|
|
96
|
+
export const formatGreaterThanOrEqualToError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie mai mare sau egală cu ${error.min}.`;
|
|
97
|
+
/** Formatează un LessThanError în română. */
|
|
98
|
+
export const formatLessThanError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie mai mică decât ${error.max}.`;
|
|
99
|
+
/** Formatează un LessThanOrEqualToError în română. */
|
|
100
|
+
export const formatLessThanOrEqualToError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie mai mică sau egală cu ${error.max}.`;
|
|
101
|
+
/** Formatează un NonNaNError în română. */
|
|
102
|
+
export const formatNonNaNError = () => "Valoarea nu trebuie să fie NaN.";
|
|
103
|
+
/** Formatează un FiniteError în română. */
|
|
104
|
+
export const formatFiniteError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie finită.`;
|
|
105
|
+
/** Formatează un MultipleOfError în română. */
|
|
106
|
+
export const formatMultipleOfError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie un multiplu de ${error.divisor}.`;
|
|
107
|
+
/** Formatează un BetweenError în română. */
|
|
108
|
+
export const formatBetweenError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} trebuie să fie între ${error.min} și ${error.max}, inclusiv.`;
|
|
109
|
+
/** Formatează un ArrayError în română. */
|
|
110
|
+
export const formatArrayError = (error) => {
|
|
111
|
+
if (error.reason.kind === "NotArray") {
|
|
112
|
+
return `Valoarea ${safelyStringifyUnknownValue(error.reason.value)} nu este un tablou.`;
|
|
113
|
+
}
|
|
114
|
+
const issue = error.reason.issues[0];
|
|
115
|
+
switch (issue.kind) {
|
|
116
|
+
case "Hole":
|
|
117
|
+
return `Lipsește un element al tabloului la indexul ${issue.index}.`;
|
|
118
|
+
case "Accessor":
|
|
119
|
+
return `Elementul tabloului de la indexul ${issue.index} trebuie să fie o proprietate de date.`;
|
|
120
|
+
case "ExcessProperty":
|
|
121
|
+
return "O proprietate Array în exces nu este permisă. Eliminați-o sau utilizați un Type diferit.";
|
|
122
|
+
case "Element":
|
|
123
|
+
return `Elementul tabloului de la indexul ${issue.index} nu este valid.`;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
/** Formatează un SetError în română. */
|
|
127
|
+
export const formatSetError = (error) => {
|
|
128
|
+
if (error.reason.kind === "NotSet") {
|
|
129
|
+
return `Valoarea ${safelyStringifyUnknownValue(error.reason.value)} nu este un Set.`;
|
|
130
|
+
}
|
|
131
|
+
if (error.reason.kind === "UnexpectedPrototype") {
|
|
132
|
+
return "Valoarea este o instanță a unei subclase Set, dar un Output Set trebuie să fie o instanță Set directă.";
|
|
133
|
+
}
|
|
134
|
+
const issue = error.reason.issues[0];
|
|
135
|
+
switch (issue.kind) {
|
|
136
|
+
case "ExcessProperty":
|
|
137
|
+
return `O proprietate Set în exces ${safelyStringifyUnknownValue(issue.key)} nu este permisă.`;
|
|
138
|
+
case "Element":
|
|
139
|
+
return `Elementul Set de la indexul ${issue.index} nu este valid.`;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
/** Formatează un TupleError în română. */
|
|
143
|
+
export const formatTupleError = (error) => {
|
|
144
|
+
if (error.reason.kind === "NotArray") {
|
|
145
|
+
return `Valoarea ${safelyStringifyUnknownValue(error.reason.value)} nu este un tuplu.`;
|
|
146
|
+
}
|
|
147
|
+
if (error.reason.kind === "InvalidLength") {
|
|
148
|
+
return `Un Tuple trebuie să conțină exact ${error.reason.expected} elemente, dar valoarea conține ${error.reason.actual}.`;
|
|
149
|
+
}
|
|
150
|
+
const issue = error.reason.issues[0];
|
|
151
|
+
switch (issue.kind) {
|
|
152
|
+
case "Hole":
|
|
153
|
+
return `Lipsește un element Tuple la indexul ${issue.index}.`;
|
|
154
|
+
case "Accessor":
|
|
155
|
+
return `Elementul Tuple de la indexul ${issue.index} trebuie să fie o proprietate de date.`;
|
|
156
|
+
case "ExcessProperty":
|
|
157
|
+
return "O proprietate Tuple în exces nu este permisă. Eliminați-o sau utilizați un Type diferit.";
|
|
158
|
+
case "Element":
|
|
159
|
+
return `Elementul Tuple de la indexul ${issue.index} nu este valid.`;
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
/** Formatează un RecordError în română. */
|
|
163
|
+
export const formatRecordError = (error) => {
|
|
164
|
+
if (error.reason.kind === "NotRecord") {
|
|
165
|
+
return `Valoarea ${safelyStringifyUnknownValue(error.reason.value)} nu este un Record.`;
|
|
166
|
+
}
|
|
167
|
+
if (error.reason.kind === "NotPlainRecord") {
|
|
168
|
+
return "Valoarea este un obiect, dar un Output Record trebuie să fie un obiect simplu sau să aibă un prototip null.";
|
|
169
|
+
}
|
|
170
|
+
const issue = error.reason.issues[0];
|
|
171
|
+
switch (issue.kind) {
|
|
172
|
+
case "Key":
|
|
173
|
+
return `Cheia proprietății ${safelyStringifyUnknownValue(issue.key)} nu este validă.`;
|
|
174
|
+
case "Value":
|
|
175
|
+
return `Valoarea proprietății ${safelyStringifyUnknownValue(issue.key)} nu este validă.`;
|
|
176
|
+
case "Accessor":
|
|
177
|
+
return `Proprietatea Record ${safelyStringifyUnknownValue(issue.key)} trebuie să fie o proprietate de date.`;
|
|
178
|
+
case "NonEnumerable":
|
|
179
|
+
return `Proprietatea Record ${safelyStringifyUnknownValue(issue.key)} trebuie să fie enumerabilă.`;
|
|
180
|
+
case "Collision":
|
|
181
|
+
return `Cheile Record ${safelyStringifyUnknownValue(issue.previousKey)} și ${safelyStringifyUnknownValue(issue.key)} se decodează la aceeași cheie ${safelyStringifyUnknownValue(issue.outputKey)}.`;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
/** Formatează un ObjectError în română. */
|
|
185
|
+
export const formatObjectError = (error) => {
|
|
186
|
+
if (error.reason.kind !== "Properties") {
|
|
187
|
+
return formatPlainObjectRootError(error.reason);
|
|
188
|
+
}
|
|
189
|
+
const key = Reflect.ownKeys(error.reason.errors).at(0);
|
|
190
|
+
assertNonNullable(key);
|
|
191
|
+
const propertyError = error.reason.errors[key];
|
|
192
|
+
assertNonNullable(propertyError);
|
|
193
|
+
if (propertyError.type === "ObjectPropertyAccess") {
|
|
194
|
+
switch (propertyError.reason) {
|
|
195
|
+
case "Accessor":
|
|
196
|
+
return "O proprietate Object trebuie să fie o proprietate de date. Materializați valorile accesorilor în date simple înainte de a utiliza acest Type sau utilizați un Type diferit.";
|
|
197
|
+
case "NonEnumerable":
|
|
198
|
+
return "O proprietate Object trebuie să fie enumerabilă. Faceți-o enumerabilă sau utilizați un Type diferit.";
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (propertyError.type === "ObjectMissingProperty") {
|
|
202
|
+
return `Lipsește proprietatea obligatorie ${safelyStringifyUnknownValue(key)}.`;
|
|
203
|
+
}
|
|
204
|
+
if (typeof key === "symbol") {
|
|
205
|
+
return "Cheia unei proprietăți Object trebuie să fie un șir. Eliminați proprietatea simbol sau utilizați un Type diferit.";
|
|
206
|
+
}
|
|
207
|
+
if (propertyError.type === "ObjectExcessProperty") {
|
|
208
|
+
return `Proprietatea ${safelyStringifyUnknownValue(key)} nu este permisă. Eliminați-o sau utilizați un Type diferit.`;
|
|
209
|
+
}
|
|
210
|
+
return `Proprietatea ${safelyStringifyUnknownValue(key)} nu este validă.`;
|
|
211
|
+
};
|
|
212
|
+
/** Formatează un DiscriminatedUnionError în română. */
|
|
213
|
+
export const formatDiscriminatedUnionError = (error) => {
|
|
214
|
+
switch (error.reason.kind) {
|
|
215
|
+
case "Object":
|
|
216
|
+
return formatPlainObjectRootError(error.reason.error.reason);
|
|
217
|
+
case "PropertyAccess": {
|
|
218
|
+
const property = `Proprietatea discriminator ${safelyStringifyUnknownValue(error.reason.key)}`;
|
|
219
|
+
if (error.reason.reason === "Accessor") {
|
|
220
|
+
return `${property} trebuie să fie o proprietate de date.`;
|
|
221
|
+
}
|
|
222
|
+
if (error.reason.reason === "Inherited") {
|
|
223
|
+
return `${property} trebuie să fie o proprietate proprie.`;
|
|
224
|
+
}
|
|
225
|
+
return `${property} trebuie să fie enumerabilă.`;
|
|
226
|
+
}
|
|
227
|
+
case "Discriminator":
|
|
228
|
+
return `Proprietatea discriminator ${safelyStringifyUnknownValue(error.reason.key)} are valoarea neașteptată ${safelyStringifyUnknownValue(error.reason.value)}.`;
|
|
229
|
+
case "Member":
|
|
230
|
+
return `Varianta selectată ${safelyStringifyUnknownValue(error.reason.discriminator)} nu este validă.`;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
/** Formatează un JsonValueError în română. */
|
|
234
|
+
export const formatJsonValueError = (error) => {
|
|
235
|
+
const issue = error.reason.issues[0];
|
|
236
|
+
switch (issue.kind) {
|
|
237
|
+
case "InvalidType":
|
|
238
|
+
return `Valoarea ${safelyStringifyUnknownValue(issue.value)} nu este o valoare JSON.`;
|
|
239
|
+
case "NonFiniteNumber":
|
|
240
|
+
return "Un număr JSON trebuie să fie finit.";
|
|
241
|
+
case "UnexpectedPrototype":
|
|
242
|
+
return "Valoarea este un obiect, dar un obiect JsonValue trebuie să fie un obiect simplu sau să aibă un prototip null.";
|
|
243
|
+
case "Accessor":
|
|
244
|
+
return "O proprietate JSON trebuie să fie o proprietate de date. Materializați valorile accesorilor în date simple înainte de a utiliza acest Type sau utilizați un Type diferit.";
|
|
245
|
+
case "NonEnumerable":
|
|
246
|
+
return "O proprietate a unui obiect JSON trebuie să fie enumerabilă. Eliminați-o sau utilizați un Type diferit.";
|
|
247
|
+
case "SymbolProperty":
|
|
248
|
+
return "Cheia unei proprietăți a unui obiect JSON trebuie să fie un șir. Eliminați proprietatea simbol sau utilizați un Type diferit.";
|
|
249
|
+
case "Hole":
|
|
250
|
+
return "Lipsește un element al unui tablou JSON.";
|
|
251
|
+
case "ExcessProperty":
|
|
252
|
+
return "O proprietate a unui tablou JSON în exces nu este permisă. Eliminați-o sau utilizați un Type diferit.";
|
|
253
|
+
case "CircularReference":
|
|
254
|
+
return "Un JsonValue nu trebuie să conțină referințe circulare.";
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
/** Formatează un JsonError în română. */
|
|
258
|
+
export const formatJsonError = (error) => `Valoarea ${safelyStringifyUnknownValue(error.value)} nu poate fi analizată ca JsonValue.`;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slovak Evolu Type error formatters.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ArrayError, Base64UrlError, BetweenError, CapitalizedError, DateIsoError, DateIsoFromDateError, DecimalStringError, DiscriminatedUnionError, EvoluTypeError, FiniteError, GreaterThanError, GreaterThanOrEqualToError, InstanceOfError, Int64Error, Int64StringError, IntError, IdError, JsonError, JsonValueError, LengthError, LessThanError, LessThanOrEqualToError, LiteralError, MaxLengthError, MinLengthError, MnemonicError, MultipleOfError, NegativeDecimalStringError, NegativeError, NameError, NeverError, NonNaNError, NonNegativeDecimalStringError, NonNegativeError, NonPositiveDecimalStringError, NonPositiveError, ObjectError, ObjectTagError, PositiveDecimalStringError, PositiveError, RecordError, RegexError, SetError, TableIdError, TemplateLiteralError, TrimmedError, TupleElementsError, TupleError, TypeError, TypeErrorFormatter, TypeOfError, UInt64Error, UnionError } from "../Type.ts";
|
|
7
|
+
/** Formats a NeverError in Slovak. */
|
|
8
|
+
export declare const formatNeverError: TypeErrorFormatter<NeverError>;
|
|
9
|
+
/** Formats a String TypeOfError in Slovak. */
|
|
10
|
+
export declare const formatStringError: TypeErrorFormatter<TypeOfError<"String">>;
|
|
11
|
+
/** Formats a TemplateLiteralError in Slovak. */
|
|
12
|
+
export declare const formatTemplateLiteralError: TypeErrorFormatter<TemplateLiteralError>;
|
|
13
|
+
/** Formats a Number TypeOfError in Slovak. */
|
|
14
|
+
export declare const formatNumberError: TypeErrorFormatter<TypeOfError<"Number">>;
|
|
15
|
+
/** Formats a BigInt TypeOfError in Slovak. */
|
|
16
|
+
export declare const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">>;
|
|
17
|
+
/** Formats a Boolean TypeOfError in Slovak. */
|
|
18
|
+
export declare const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">>;
|
|
19
|
+
/** Formats a Symbol TypeOfError in Slovak. */
|
|
20
|
+
export declare const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">>;
|
|
21
|
+
/** Formats a Function TypeOfError in Slovak. */
|
|
22
|
+
export declare const formatFunctionError: TypeErrorFormatter<TypeOfError<"Function">>;
|
|
23
|
+
/** Formats an EvoluTypeError in Slovak. */
|
|
24
|
+
export declare const formatEvoluTypeError: TypeErrorFormatter<EvoluTypeError>;
|
|
25
|
+
/** Formats an ObjectTagError in Slovak. */
|
|
26
|
+
export declare const formatObjectTagError: TypeErrorFormatter<ObjectTagError>;
|
|
27
|
+
/** Formats an InstanceOfError in Slovak. */
|
|
28
|
+
export declare const formatInstanceOfError: TypeErrorFormatter<InstanceOfError>;
|
|
29
|
+
/** Formats a LiteralError in Slovak. */
|
|
30
|
+
export declare const formatLiteralError: TypeErrorFormatter<LiteralError>;
|
|
31
|
+
/** Formats a UnionError in Slovak. */
|
|
32
|
+
export declare const formatUnionError: TypeErrorFormatter<UnionError>;
|
|
33
|
+
/** Formats a DateIsoError in Slovak. */
|
|
34
|
+
export declare const formatDateIsoError: TypeErrorFormatter<DateIsoError>;
|
|
35
|
+
/** Formats a DateIsoFromDateError in Slovak. */
|
|
36
|
+
export declare const formatDateIsoFromDateError: TypeErrorFormatter<DateIsoFromDateError>;
|
|
37
|
+
/** Formats a DecimalStringError in Slovak. */
|
|
38
|
+
export declare const formatDecimalStringError: TypeErrorFormatter<DecimalStringError>;
|
|
39
|
+
/** Formats an Int64Error in Slovak. */
|
|
40
|
+
export declare const formatInt64Error: TypeErrorFormatter<Int64Error>;
|
|
41
|
+
/** Formats a UInt64Error in Slovak. */
|
|
42
|
+
export declare const formatUInt64Error: TypeErrorFormatter<UInt64Error>;
|
|
43
|
+
/** Formats an Int64StringError in Slovak. */
|
|
44
|
+
export declare const formatInt64StringError: TypeErrorFormatter<Int64StringError>;
|
|
45
|
+
/** Formats a CapitalizedError in Slovak. */
|
|
46
|
+
export declare const formatCapitalizedError: TypeErrorFormatter<CapitalizedError>;
|
|
47
|
+
/** Formats a TrimmedError in Slovak. */
|
|
48
|
+
export declare const formatTrimmedError: TypeErrorFormatter<TrimmedError>;
|
|
49
|
+
/** Formats a MinLengthError in Slovak. */
|
|
50
|
+
export declare const formatMinLengthError: TypeErrorFormatter<MinLengthError>;
|
|
51
|
+
/** Formats a MaxLengthError in Slovak. */
|
|
52
|
+
export declare const formatMaxLengthError: TypeErrorFormatter<MaxLengthError>;
|
|
53
|
+
/** Formats a LengthError in Slovak. */
|
|
54
|
+
export declare const formatLengthError: TypeErrorFormatter<LengthError>;
|
|
55
|
+
/** Formats a RegexError in Slovak. */
|
|
56
|
+
export declare const formatRegexError: TypeErrorFormatter<RegexError>;
|
|
57
|
+
/** Formats a Base64UrlError in Slovak. */
|
|
58
|
+
export declare const formatBase64UrlError: TypeErrorFormatter<Base64UrlError>;
|
|
59
|
+
/** Formats a NameError in Slovak. */
|
|
60
|
+
export declare const formatNameError: TypeErrorFormatter<NameError>;
|
|
61
|
+
/** Formats a MnemonicError in Slovak. */
|
|
62
|
+
export declare const formatMnemonicError: TypeErrorFormatter<MnemonicError>;
|
|
63
|
+
/** Formats an IdError in Slovak. */
|
|
64
|
+
export declare const formatIdError: TypeErrorFormatter<IdError>;
|
|
65
|
+
/** Formats a TableIdError in Slovak. */
|
|
66
|
+
export declare const formatTableIdError: TypeErrorFormatter<TableIdError>;
|
|
67
|
+
/** Formats a NonNegativeError in Slovak. */
|
|
68
|
+
export declare const formatNonNegativeError: TypeErrorFormatter<NonNegativeError>;
|
|
69
|
+
/** Formats a NonNegativeDecimalStringError in Slovak. */
|
|
70
|
+
export declare const formatNonNegativeDecimalStringError: TypeErrorFormatter<NonNegativeDecimalStringError>;
|
|
71
|
+
/** Formats a PositiveError in Slovak. */
|
|
72
|
+
export declare const formatPositiveError: TypeErrorFormatter<PositiveError>;
|
|
73
|
+
/** Formats a PositiveDecimalStringError in Slovak. */
|
|
74
|
+
export declare const formatPositiveDecimalStringError: TypeErrorFormatter<PositiveDecimalStringError>;
|
|
75
|
+
/** Formats a NonPositiveError in Slovak. */
|
|
76
|
+
export declare const formatNonPositiveError: TypeErrorFormatter<NonPositiveError>;
|
|
77
|
+
/** Formats a NonPositiveDecimalStringError in Slovak. */
|
|
78
|
+
export declare const formatNonPositiveDecimalStringError: TypeErrorFormatter<NonPositiveDecimalStringError>;
|
|
79
|
+
/** Formats a NegativeError in Slovak. */
|
|
80
|
+
export declare const formatNegativeError: TypeErrorFormatter<NegativeError>;
|
|
81
|
+
/** Formats a NegativeDecimalStringError in Slovak. */
|
|
82
|
+
export declare const formatNegativeDecimalStringError: TypeErrorFormatter<NegativeDecimalStringError>;
|
|
83
|
+
/** Formats an IntError in Slovak. */
|
|
84
|
+
export declare const formatIntError: TypeErrorFormatter<IntError>;
|
|
85
|
+
/** Formats a GreaterThanError in Slovak. */
|
|
86
|
+
export declare const formatGreaterThanError: TypeErrorFormatter<GreaterThanError>;
|
|
87
|
+
/** Formats a GreaterThanOrEqualToError in Slovak. */
|
|
88
|
+
export declare const formatGreaterThanOrEqualToError: TypeErrorFormatter<GreaterThanOrEqualToError>;
|
|
89
|
+
/** Formats a LessThanError in Slovak. */
|
|
90
|
+
export declare const formatLessThanError: TypeErrorFormatter<LessThanError>;
|
|
91
|
+
/** Formats a LessThanOrEqualToError in Slovak. */
|
|
92
|
+
export declare const formatLessThanOrEqualToError: TypeErrorFormatter<LessThanOrEqualToError>;
|
|
93
|
+
/** Formats a NonNaNError in Slovak. */
|
|
94
|
+
export declare const formatNonNaNError: TypeErrorFormatter<NonNaNError>;
|
|
95
|
+
/** Formats a FiniteError in Slovak. */
|
|
96
|
+
export declare const formatFiniteError: TypeErrorFormatter<FiniteError>;
|
|
97
|
+
/** Formats a MultipleOfError in Slovak. */
|
|
98
|
+
export declare const formatMultipleOfError: TypeErrorFormatter<MultipleOfError>;
|
|
99
|
+
/** Formats a BetweenError in Slovak. */
|
|
100
|
+
export declare const formatBetweenError: TypeErrorFormatter<BetweenError>;
|
|
101
|
+
/** Formats an ArrayError in Slovak. */
|
|
102
|
+
export declare const formatArrayError: TypeErrorFormatter<ArrayError>;
|
|
103
|
+
/** Formats a SetError in Slovak. */
|
|
104
|
+
export declare const formatSetError: TypeErrorFormatter<SetError>;
|
|
105
|
+
/** Formats a TupleError in Slovak. */
|
|
106
|
+
export declare const formatTupleError: TypeErrorFormatter<TupleError | TupleElementsError<TypeError>>;
|
|
107
|
+
/** Formats a RecordError in Slovak. */
|
|
108
|
+
export declare const formatRecordError: TypeErrorFormatter<RecordError>;
|
|
109
|
+
/** Formats an ObjectError in Slovak. */
|
|
110
|
+
export declare const formatObjectError: TypeErrorFormatter<ObjectError>;
|
|
111
|
+
/** Formats a DiscriminatedUnionError in Slovak. */
|
|
112
|
+
export declare const formatDiscriminatedUnionError: TypeErrorFormatter<DiscriminatedUnionError>;
|
|
113
|
+
/** Formats a JsonValueError in Slovak. */
|
|
114
|
+
export declare const formatJsonValueError: TypeErrorFormatter<JsonValueError>;
|
|
115
|
+
/** Formats a JsonError in Slovak. */
|
|
116
|
+
export declare const formatJsonError: TypeErrorFormatter<JsonError>;
|
|
117
|
+
//# sourceMappingURL=sk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sk.d.ts","sourceRoot":"","sources":["../../../src/intl/sk.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,yBAA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nD,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAC5D,uBAAuB,CAkBxB,CAAC;AACF,0CAA0C;AAC1C,eAAO,MAAM,oBAAoB,EAAE,kBAAkB,CAAC,cAAc,CAwBnE,CAAC;AACF,qCAAqC;AACrC,eAAO,MAAM,eAAe,EAAE,kBAAkB,CAAC,SAAS,CAC+B,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slovak Evolu Type error formatters.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { assertNonNullable } from "../Assert.js";
|
|
7
|
+
import { safelyStringifyUnknownValue } from "../String.js";
|
|
8
|
+
const formatValueMustBe = (value, expected) => `Hodnota ${safelyStringifyUnknownValue(value)} musí byť ${expected}.`;
|
|
9
|
+
const formatPlainObjectRootError = (reason) => reason.kind === "NotObject"
|
|
10
|
+
? `Hodnota ${safelyStringifyUnknownValue(reason.value)} nie je objekt.`
|
|
11
|
+
: "Hodnota je objekt, ale výstup typu Object musí byť obyčajný objekt alebo mať prototyp null.";
|
|
12
|
+
/** Formats a NeverError in Slovak. */
|
|
13
|
+
export const formatNeverError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platná pre typ Never.`;
|
|
14
|
+
/** Formats a String TypeOfError in Slovak. */
|
|
15
|
+
export const formatStringError = (error) => formatValueMustBe(error.value, "reťazec");
|
|
16
|
+
/** Formats a TemplateLiteralError in Slovak. */
|
|
17
|
+
export const formatTemplateLiteralError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nezodpovedá šablónovému literálu.`;
|
|
18
|
+
/** Formats a Number TypeOfError in Slovak. */
|
|
19
|
+
export const formatNumberError = (error) => formatValueMustBe(error.value, "číslo");
|
|
20
|
+
/** Formats a BigInt TypeOfError in Slovak. */
|
|
21
|
+
export const formatBigIntError = (error) => formatValueMustBe(error.value, "celé číslo typu bigint");
|
|
22
|
+
/** Formats a Boolean TypeOfError in Slovak. */
|
|
23
|
+
export const formatBooleanError = (error) => formatValueMustBe(error.value, "logická hodnota");
|
|
24
|
+
/** Formats a Symbol TypeOfError in Slovak. */
|
|
25
|
+
export const formatSymbolError = (error) => formatValueMustBe(error.value, "symbol");
|
|
26
|
+
/** Formats a Function TypeOfError in Slovak. */
|
|
27
|
+
export const formatFunctionError = (error) => formatValueMustBe(error.value, "funkcia");
|
|
28
|
+
/** Formats an EvoluTypeError in Slovak. */
|
|
29
|
+
export const formatEvoluTypeError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť Evolu Type.`;
|
|
30
|
+
/** Formats an ObjectTagError in Slovak. */
|
|
31
|
+
export const formatObjectTagError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nemá očakávanú značku objektu ${safelyStringifyUnknownValue(error.expected)}.`;
|
|
32
|
+
/** Formats an InstanceOfError in Slovak. */
|
|
33
|
+
export const formatInstanceOfError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť inštanciou ${error.constructorName}.`;
|
|
34
|
+
/** Formats a LiteralError in Slovak. */
|
|
35
|
+
export const formatLiteralError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} sa musí presne rovnať očakávanému literálu ${globalThis.String(error.expected)}.`;
|
|
36
|
+
/** Formats a UnionError in Slovak. */
|
|
37
|
+
export const formatUnionError = () => "Hodnota nezodpovedá žiadnemu z povolených variantov.";
|
|
38
|
+
/** Formats a DateIsoError in Slovak. */
|
|
39
|
+
export const formatDateIsoError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť reťazec dátumu a času v kanonickom formáte ISO.`;
|
|
40
|
+
/** Formats a DateIsoFromDateError in Slovak. */
|
|
41
|
+
export const formatDateIsoFromDateError = () => "Dátum nie je možné reprezentovať ako DateIso.";
|
|
42
|
+
/** Formats a DecimalStringError in Slovak. */
|
|
43
|
+
export const formatDecimalStringError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť kanonický desatinný reťazec.`;
|
|
44
|
+
/** Formats an Int64Error in Slovak. */
|
|
45
|
+
export const formatInt64Error = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť platné 64-bitové celé číslo so znamienkom (Int64).`;
|
|
46
|
+
/** Formats a UInt64Error in Slovak. */
|
|
47
|
+
export const formatUInt64Error = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť platné 64-bitové celé číslo bez znamienka (UInt64).`;
|
|
48
|
+
/** Formats an Int64StringError in Slovak. */
|
|
49
|
+
export const formatInt64StringError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť platný reťazec Int64.`;
|
|
50
|
+
/** Formats a CapitalizedError in Slovak. */
|
|
51
|
+
export const formatCapitalizedError = (error) => `Reťazec ${safelyStringifyUnknownValue(error.value)} musí začínať veľkým písmenom.`;
|
|
52
|
+
/** Formats a TrimmedError in Slovak. */
|
|
53
|
+
export const formatTrimmedError = (error) => `Reťazec ${safelyStringifyUnknownValue(error.value)} nesmie obsahovať medzery na začiatku ani na konci.`;
|
|
54
|
+
/** Formats a MinLengthError in Slovak. */
|
|
55
|
+
export const formatMinLengthError = (error) => typeof error.value === "string" && error.min === 1
|
|
56
|
+
? "Reťazec nesmie byť prázdny."
|
|
57
|
+
: `Hodnota ${safelyStringifyUnknownValue(error.value)} musí mať dĺžku aspoň ${error.min}.`;
|
|
58
|
+
/** Formats a MaxLengthError in Slovak. */
|
|
59
|
+
export const formatMaxLengthError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} môže mať dĺžku najviac ${error.max}.`;
|
|
60
|
+
/** Formats a LengthError in Slovak. */
|
|
61
|
+
export const formatLengthError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí mať presne dĺžku ${error.exact}.`;
|
|
62
|
+
/** Formats a RegexError in Slovak. */
|
|
63
|
+
export const formatRegexError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nezodpovedá regulárnemu výrazu /${error.source}/${error.flags}.`;
|
|
64
|
+
/** Formats a Base64UrlError in Slovak. */
|
|
65
|
+
export const formatBase64UrlError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platný reťazec Base64Url.`;
|
|
66
|
+
/** Formats a NameError in Slovak. */
|
|
67
|
+
export const formatNameError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platný názov.`;
|
|
68
|
+
/** Formats a MnemonicError in Slovak. */
|
|
69
|
+
export const formatMnemonicError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platná anglická mnemotechnická fráza BIP39.`;
|
|
70
|
+
/** Formats an IdError in Slovak. */
|
|
71
|
+
export const formatIdError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platné Id.`;
|
|
72
|
+
/** Formats a TableIdError in Slovak. */
|
|
73
|
+
export const formatTableIdError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platné Id pre tabuľku ${safelyStringifyUnknownValue(error.table)}.`;
|
|
74
|
+
/** Formats a NonNegativeError in Slovak. */
|
|
75
|
+
export const formatNonNegativeError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nezáporná (>= 0).`;
|
|
76
|
+
/** Formats a NonNegativeDecimalStringError in Slovak. */
|
|
77
|
+
export const formatNonNegativeDecimalStringError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nezáporný desatinný reťazec.`;
|
|
78
|
+
/** Formats a PositiveError in Slovak. */
|
|
79
|
+
export const formatPositiveError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť kladná (> 0).`;
|
|
80
|
+
/** Formats a PositiveDecimalStringError in Slovak. */
|
|
81
|
+
export const formatPositiveDecimalStringError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť kladný desatinný reťazec.`;
|
|
82
|
+
/** Formats a NonPositiveError in Slovak. */
|
|
83
|
+
export const formatNonPositiveError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nekladná (<= 0).`;
|
|
84
|
+
/** Formats a NonPositiveDecimalStringError in Slovak. */
|
|
85
|
+
export const formatNonPositiveDecimalStringError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nekladný desatinný reťazec.`;
|
|
86
|
+
/** Formats a NegativeError in Slovak. */
|
|
87
|
+
export const formatNegativeError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť záporná (< 0).`;
|
|
88
|
+
/** Formats a NegativeDecimalStringError in Slovak. */
|
|
89
|
+
export const formatNegativeDecimalStringError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť záporný desatinný reťazec.`;
|
|
90
|
+
/** Formats an IntError in Slovak. */
|
|
91
|
+
export const formatIntError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť bezpečné celé číslo.`;
|
|
92
|
+
/** Formats a GreaterThanError in Slovak. */
|
|
93
|
+
export const formatGreaterThanError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť väčšia ako ${error.min}.`;
|
|
94
|
+
/** Formats a GreaterThanOrEqualToError in Slovak. */
|
|
95
|
+
export const formatGreaterThanOrEqualToError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť väčšia alebo rovná ${error.min}.`;
|
|
96
|
+
/** Formats a LessThanError in Slovak. */
|
|
97
|
+
export const formatLessThanError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť menšia ako ${error.max}.`;
|
|
98
|
+
/** Formats a LessThanOrEqualToError in Slovak. */
|
|
99
|
+
export const formatLessThanOrEqualToError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť menšia alebo rovná ${error.max}.`;
|
|
100
|
+
/** Formats a NonNaNError in Slovak. */
|
|
101
|
+
export const formatNonNaNError = () => "Hodnota nesmie byť NaN.";
|
|
102
|
+
/** Formats a FiniteError in Slovak. */
|
|
103
|
+
export const formatFiniteError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť konečná.`;
|
|
104
|
+
/** Formats a MultipleOfError in Slovak. */
|
|
105
|
+
export const formatMultipleOfError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť násobkom čísla ${error.divisor}.`;
|
|
106
|
+
/** Formats a BetweenError in Slovak. */
|
|
107
|
+
export const formatBetweenError = (error) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť v rozsahu od ${error.min} do ${error.max} vrátane.`;
|
|
108
|
+
/** Formats an ArrayError in Slovak. */
|
|
109
|
+
export const formatArrayError = (error) => {
|
|
110
|
+
if (error.reason.kind === "NotArray")
|
|
111
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je pole.`;
|
|
112
|
+
const issue = error.reason.issues[0];
|
|
113
|
+
switch (issue.kind) {
|
|
114
|
+
case "Hole":
|
|
115
|
+
return `V poli chýba prvok na indexe ${issue.index}.`;
|
|
116
|
+
case "Accessor":
|
|
117
|
+
return `Prvok poľa na indexe ${issue.index} musí byť dátová vlastnosť.`;
|
|
118
|
+
case "ExcessProperty":
|
|
119
|
+
return "Pole obsahuje nepovolenú vlastnosť. Odstráňte ju alebo použite iný Type.";
|
|
120
|
+
case "Element":
|
|
121
|
+
return `Prvok poľa na indexe ${issue.index} nie je platný.`;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
/** Formats a SetError in Slovak. */
|
|
125
|
+
export const formatSetError = (error) => {
|
|
126
|
+
if (error.reason.kind === "NotSet")
|
|
127
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je Set.`;
|
|
128
|
+
if (error.reason.kind === "UnexpectedPrototype")
|
|
129
|
+
return "Hodnota je inštanciou podtriedy Set, ale výstup typu Set musí byť priamou inštanciou Set.";
|
|
130
|
+
const issue = error.reason.issues[0];
|
|
131
|
+
switch (issue.kind) {
|
|
132
|
+
case "ExcessProperty":
|
|
133
|
+
return `Set obsahuje nepovolenú vlastnosť ${safelyStringifyUnknownValue(issue.key)}.`;
|
|
134
|
+
case "Element":
|
|
135
|
+
return `Prvok Set na indexe ${issue.index} nie je platný.`;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
/** Formats a TupleError in Slovak. */
|
|
139
|
+
export const formatTupleError = (error) => {
|
|
140
|
+
if (error.reason.kind === "NotArray")
|
|
141
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je tuple.`;
|
|
142
|
+
if (error.reason.kind === "InvalidLength")
|
|
143
|
+
return `Tuple musí obsahovať presne ${error.reason.expected} prvkov, ale hodnota obsahuje ${error.reason.actual}.`;
|
|
144
|
+
const issue = error.reason.issues[0];
|
|
145
|
+
switch (issue.kind) {
|
|
146
|
+
case "Hole":
|
|
147
|
+
return `V Tuple chýba prvok na indexe ${issue.index}.`;
|
|
148
|
+
case "Accessor":
|
|
149
|
+
return `Prvok Tuple na indexe ${issue.index} musí byť dátová vlastnosť.`;
|
|
150
|
+
case "ExcessProperty":
|
|
151
|
+
return "Tuple obsahuje nepovolenú vlastnosť. Odstráňte ju alebo použite iný Type.";
|
|
152
|
+
case "Element":
|
|
153
|
+
return `Prvok Tuple na indexe ${issue.index} nie je platný.`;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
/** Formats a RecordError in Slovak. */
|
|
157
|
+
export const formatRecordError = (error) => {
|
|
158
|
+
if (error.reason.kind === "NotRecord")
|
|
159
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je Record.`;
|
|
160
|
+
if (error.reason.kind === "NotPlainRecord")
|
|
161
|
+
return "Hodnota je objekt, ale výstup typu Record musí byť obyčajný objekt alebo mať prototyp null.";
|
|
162
|
+
const issue = error.reason.issues[0];
|
|
163
|
+
switch (issue.kind) {
|
|
164
|
+
case "Key":
|
|
165
|
+
return `Kľúč vlastnosti ${safelyStringifyUnknownValue(issue.key)} nie je platný.`;
|
|
166
|
+
case "Value":
|
|
167
|
+
return `Hodnota vlastnosti ${safelyStringifyUnknownValue(issue.key)} nie je platná.`;
|
|
168
|
+
case "Accessor":
|
|
169
|
+
return `Vlastnosť Record ${safelyStringifyUnknownValue(issue.key)} musí byť dátová vlastnosť.`;
|
|
170
|
+
case "NonEnumerable":
|
|
171
|
+
return `Vlastnosť Record ${safelyStringifyUnknownValue(issue.key)} musí byť enumerovateľná.`;
|
|
172
|
+
case "Collision":
|
|
173
|
+
return `Kľúče Record ${safelyStringifyUnknownValue(issue.previousKey)} a ${safelyStringifyUnknownValue(issue.key)} sa dekódujú na rovnaký kľúč ${safelyStringifyUnknownValue(issue.outputKey)}.`;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
/** Formats an ObjectError in Slovak. */
|
|
177
|
+
export const formatObjectError = (error) => {
|
|
178
|
+
if (error.reason.kind !== "Properties")
|
|
179
|
+
return formatPlainObjectRootError(error.reason);
|
|
180
|
+
const key = Reflect.ownKeys(error.reason.errors).at(0);
|
|
181
|
+
assertNonNullable(key);
|
|
182
|
+
const propertyError = error.reason.errors[key];
|
|
183
|
+
assertNonNullable(propertyError);
|
|
184
|
+
if (propertyError.type === "ObjectPropertyAccess") {
|
|
185
|
+
switch (propertyError.reason) {
|
|
186
|
+
case "Accessor":
|
|
187
|
+
return "Vlastnosť Object musí byť dátová vlastnosť. Pred použitím tohto Type materializujte hodnoty prístupových vlastností do obyčajných dát alebo použite iný Type.";
|
|
188
|
+
case "NonEnumerable":
|
|
189
|
+
return "Vlastnosť Object musí byť enumerovateľná.";
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (propertyError.type === "ObjectMissingProperty")
|
|
193
|
+
return `Chýba povinná vlastnosť ${safelyStringifyUnknownValue(key)}.`;
|
|
194
|
+
if (typeof key === "symbol")
|
|
195
|
+
return "Kľúč vlastnosti Object musí byť reťazec. Odstráňte vlastnosť so symbolom alebo použite iný Type.";
|
|
196
|
+
if (propertyError.type === "ObjectExcessProperty")
|
|
197
|
+
return `Vlastnosť ${safelyStringifyUnknownValue(key)} nie je povolená. Odstráňte ju alebo použite iný Type.`;
|
|
198
|
+
return `Vlastnosť ${safelyStringifyUnknownValue(key)} nie je platná.`;
|
|
199
|
+
};
|
|
200
|
+
/** Formats a DiscriminatedUnionError in Slovak. */
|
|
201
|
+
export const formatDiscriminatedUnionError = (error) => {
|
|
202
|
+
switch (error.reason.kind) {
|
|
203
|
+
case "Object":
|
|
204
|
+
return formatPlainObjectRootError(error.reason.error.reason);
|
|
205
|
+
case "PropertyAccess": {
|
|
206
|
+
const property = `Rozlišovacia vlastnosť ${safelyStringifyUnknownValue(error.reason.key)}`;
|
|
207
|
+
if (error.reason.reason === "Accessor")
|
|
208
|
+
return `${property} musí byť dátová vlastnosť.`;
|
|
209
|
+
if (error.reason.reason === "Inherited")
|
|
210
|
+
return `${property} musí byť vlastná vlastnosť.`;
|
|
211
|
+
return `${property} musí byť enumerovateľná.`;
|
|
212
|
+
}
|
|
213
|
+
case "Discriminator":
|
|
214
|
+
return `Rozlišovacia vlastnosť ${safelyStringifyUnknownValue(error.reason.key)} má neočakávanú hodnotu ${safelyStringifyUnknownValue(error.reason.value)}.`;
|
|
215
|
+
case "Member":
|
|
216
|
+
return `Vybraný variant ${safelyStringifyUnknownValue(error.reason.discriminator)} nie je platný.`;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
/** Formats a JsonValueError in Slovak. */
|
|
220
|
+
export const formatJsonValueError = (error) => {
|
|
221
|
+
const issue = error.reason.issues[0];
|
|
222
|
+
switch (issue.kind) {
|
|
223
|
+
case "InvalidType":
|
|
224
|
+
return `Hodnota ${safelyStringifyUnknownValue(issue.value)} nie je hodnota JSON.`;
|
|
225
|
+
case "NonFiniteNumber":
|
|
226
|
+
return "Číslo JSON musí byť konečné.";
|
|
227
|
+
case "UnexpectedPrototype":
|
|
228
|
+
return "Hodnota je objekt, ale objekt JsonValue musí byť obyčajný objekt alebo mať prototyp null.";
|
|
229
|
+
case "Accessor":
|
|
230
|
+
return "Vlastnosť JSON musí byť dátová vlastnosť. Pred použitím tohto Type materializujte hodnoty prístupových vlastností do obyčajných dát alebo použite iný Type.";
|
|
231
|
+
case "NonEnumerable":
|
|
232
|
+
return "Vlastnosť objektu JSON musí byť enumerovateľná. Odstráňte ju alebo použite iný Type.";
|
|
233
|
+
case "SymbolProperty":
|
|
234
|
+
return "Kľúč vlastnosti objektu JSON musí byť reťazec. Odstráňte vlastnosť so symbolom alebo použite iný Type.";
|
|
235
|
+
case "Hole":
|
|
236
|
+
return "V poli JSON chýba prvok.";
|
|
237
|
+
case "ExcessProperty":
|
|
238
|
+
return "Pole JSON obsahuje nepovolenú vlastnosť. Odstráňte ju alebo použite iný Type.";
|
|
239
|
+
case "CircularReference":
|
|
240
|
+
return "JsonValue nesmie obsahovať cyklické referencie.";
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
/** Formats a JsonError in Slovak. */
|
|
244
|
+
export const formatJsonError = (error) => `Hodnotu ${safelyStringifyUnknownValue(error.value)} nemožno analyzovať ako JsonValue.`;
|