@evolu/common 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1285 -734
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +1057 -193
- 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 +1598 -712
- 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
package/src/intl/sk.ts
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slovak Evolu Type error formatters.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { assertNonNullable } from "../Assert.ts";
|
|
8
|
+
import { safelyStringifyUnknownValue } from "../String.ts";
|
|
9
|
+
import type {
|
|
10
|
+
ArrayError,
|
|
11
|
+
Base64UrlError,
|
|
12
|
+
BetweenError,
|
|
13
|
+
CapitalizedError,
|
|
14
|
+
DateIsoError,
|
|
15
|
+
DateIsoFromDateError,
|
|
16
|
+
DecimalStringError,
|
|
17
|
+
DiscriminatedUnionError,
|
|
18
|
+
EvoluTypeError,
|
|
19
|
+
FiniteError,
|
|
20
|
+
GreaterThanError,
|
|
21
|
+
GreaterThanOrEqualToError,
|
|
22
|
+
InstanceOfError,
|
|
23
|
+
Int64Error,
|
|
24
|
+
Int64StringError,
|
|
25
|
+
IntError,
|
|
26
|
+
IdError,
|
|
27
|
+
JsonError,
|
|
28
|
+
JsonValueError,
|
|
29
|
+
LengthError,
|
|
30
|
+
LessThanError,
|
|
31
|
+
LessThanOrEqualToError,
|
|
32
|
+
LiteralError,
|
|
33
|
+
MaxLengthError,
|
|
34
|
+
MinLengthError,
|
|
35
|
+
MnemonicError,
|
|
36
|
+
MultipleOfError,
|
|
37
|
+
NegativeDecimalStringError,
|
|
38
|
+
NegativeError,
|
|
39
|
+
NameError,
|
|
40
|
+
NeverError,
|
|
41
|
+
NonNaNError,
|
|
42
|
+
NonNegativeDecimalStringError,
|
|
43
|
+
NonNegativeError,
|
|
44
|
+
NonPositiveDecimalStringError,
|
|
45
|
+
NonPositiveError,
|
|
46
|
+
ObjectError,
|
|
47
|
+
ObjectNotObjectError,
|
|
48
|
+
ObjectPropertyAccessError,
|
|
49
|
+
ObjectTagError,
|
|
50
|
+
ObjectUnexpectedPrototypeError,
|
|
51
|
+
PositiveDecimalStringError,
|
|
52
|
+
PositiveError,
|
|
53
|
+
RecordError,
|
|
54
|
+
RegexError,
|
|
55
|
+
SetError,
|
|
56
|
+
TableIdError,
|
|
57
|
+
TemplateLiteralError,
|
|
58
|
+
TrimmedError,
|
|
59
|
+
TupleElementsError,
|
|
60
|
+
TupleError,
|
|
61
|
+
TypeError,
|
|
62
|
+
TypeErrorFormatter,
|
|
63
|
+
TypeOfError,
|
|
64
|
+
UInt64Error,
|
|
65
|
+
UnionError,
|
|
66
|
+
} from "../Type.ts";
|
|
67
|
+
|
|
68
|
+
const formatValueMustBe = (value: unknown, expected: string): string =>
|
|
69
|
+
`Hodnota ${safelyStringifyUnknownValue(value)} musí byť ${expected}.`;
|
|
70
|
+
|
|
71
|
+
const formatPlainObjectRootError = (
|
|
72
|
+
reason:
|
|
73
|
+
ObjectNotObjectError["reason"] | ObjectUnexpectedPrototypeError["reason"],
|
|
74
|
+
): string =>
|
|
75
|
+
reason.kind === "NotObject"
|
|
76
|
+
? `Hodnota ${safelyStringifyUnknownValue(reason.value)} nie je objekt.`
|
|
77
|
+
: "Hodnota je objekt, ale výstup typu Object musí byť obyčajný objekt alebo mať prototyp null.";
|
|
78
|
+
|
|
79
|
+
/** Formats a NeverError in Slovak. */
|
|
80
|
+
export const formatNeverError: TypeErrorFormatter<NeverError> = (error) =>
|
|
81
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platná pre typ Never.`;
|
|
82
|
+
/** Formats a String TypeOfError in Slovak. */
|
|
83
|
+
export const formatStringError: TypeErrorFormatter<TypeOfError<"String">> = (
|
|
84
|
+
error,
|
|
85
|
+
) => formatValueMustBe(error.value, "reťazec");
|
|
86
|
+
/** Formats a TemplateLiteralError in Slovak. */
|
|
87
|
+
export const formatTemplateLiteralError: TypeErrorFormatter<
|
|
88
|
+
TemplateLiteralError
|
|
89
|
+
> = (error) =>
|
|
90
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nezodpovedá šablónovému literálu.`;
|
|
91
|
+
/** Formats a Number TypeOfError in Slovak. */
|
|
92
|
+
export const formatNumberError: TypeErrorFormatter<TypeOfError<"Number">> = (
|
|
93
|
+
error,
|
|
94
|
+
) => formatValueMustBe(error.value, "číslo");
|
|
95
|
+
/** Formats a BigInt TypeOfError in Slovak. */
|
|
96
|
+
export const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">> = (
|
|
97
|
+
error,
|
|
98
|
+
) => formatValueMustBe(error.value, "celé číslo typu bigint");
|
|
99
|
+
/** Formats a Boolean TypeOfError in Slovak. */
|
|
100
|
+
export const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">> = (
|
|
101
|
+
error,
|
|
102
|
+
) => formatValueMustBe(error.value, "logická hodnota");
|
|
103
|
+
/** Formats a Symbol TypeOfError in Slovak. */
|
|
104
|
+
export const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">> = (
|
|
105
|
+
error,
|
|
106
|
+
) => formatValueMustBe(error.value, "symbol");
|
|
107
|
+
/** Formats a Function TypeOfError in Slovak. */
|
|
108
|
+
export const formatFunctionError: TypeErrorFormatter<
|
|
109
|
+
TypeOfError<"Function">
|
|
110
|
+
> = (error) => formatValueMustBe(error.value, "funkcia");
|
|
111
|
+
/** Formats an EvoluTypeError in Slovak. */
|
|
112
|
+
export const formatEvoluTypeError: TypeErrorFormatter<EvoluTypeError> = (
|
|
113
|
+
error,
|
|
114
|
+
) => `Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť Evolu Type.`;
|
|
115
|
+
/** Formats an ObjectTagError in Slovak. */
|
|
116
|
+
export const formatObjectTagError: TypeErrorFormatter<ObjectTagError> = (
|
|
117
|
+
error,
|
|
118
|
+
) =>
|
|
119
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nemá očakávanú značku objektu ${safelyStringifyUnknownValue(error.expected)}.`;
|
|
120
|
+
/** Formats an InstanceOfError in Slovak. */
|
|
121
|
+
export const formatInstanceOfError: TypeErrorFormatter<InstanceOfError> = (
|
|
122
|
+
error,
|
|
123
|
+
) =>
|
|
124
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť inštanciou ${error.constructorName}.`;
|
|
125
|
+
/** Formats a LiteralError in Slovak. */
|
|
126
|
+
export const formatLiteralError: TypeErrorFormatter<LiteralError> = (error) =>
|
|
127
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} sa musí presne rovnať očakávanému literálu ${globalThis.String(error.expected)}.`;
|
|
128
|
+
/** Formats a UnionError in Slovak. */
|
|
129
|
+
export const formatUnionError: TypeErrorFormatter<UnionError> = () =>
|
|
130
|
+
"Hodnota nezodpovedá žiadnemu z povolených variantov.";
|
|
131
|
+
/** Formats a DateIsoError in Slovak. */
|
|
132
|
+
export const formatDateIsoError: TypeErrorFormatter<DateIsoError> = (error) =>
|
|
133
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť reťazec dátumu a času v kanonickom formáte ISO.`;
|
|
134
|
+
/** Formats a DateIsoFromDateError in Slovak. */
|
|
135
|
+
export const formatDateIsoFromDateError: TypeErrorFormatter<
|
|
136
|
+
DateIsoFromDateError
|
|
137
|
+
> = () => "Dátum nie je možné reprezentovať ako DateIso.";
|
|
138
|
+
/** Formats a DecimalStringError in Slovak. */
|
|
139
|
+
export const formatDecimalStringError: TypeErrorFormatter<
|
|
140
|
+
DecimalStringError
|
|
141
|
+
> = (error) =>
|
|
142
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť kanonický desatinný reťazec.`;
|
|
143
|
+
/** Formats an Int64Error in Slovak. */
|
|
144
|
+
export const formatInt64Error: TypeErrorFormatter<Int64Error> = (error) =>
|
|
145
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť platné 64-bitové celé číslo so znamienkom (Int64).`;
|
|
146
|
+
/** Formats a UInt64Error in Slovak. */
|
|
147
|
+
export const formatUInt64Error: TypeErrorFormatter<UInt64Error> = (error) =>
|
|
148
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť platné 64-bitové celé číslo bez znamienka (UInt64).`;
|
|
149
|
+
/** Formats an Int64StringError in Slovak. */
|
|
150
|
+
export const formatInt64StringError: TypeErrorFormatter<Int64StringError> = (
|
|
151
|
+
error,
|
|
152
|
+
) =>
|
|
153
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť platný reťazec Int64.`;
|
|
154
|
+
/** Formats a CapitalizedError in Slovak. */
|
|
155
|
+
export const formatCapitalizedError: TypeErrorFormatter<CapitalizedError> = (
|
|
156
|
+
error,
|
|
157
|
+
) =>
|
|
158
|
+
`Reťazec ${safelyStringifyUnknownValue(error.value)} musí začínať veľkým písmenom.`;
|
|
159
|
+
/** Formats a TrimmedError in Slovak. */
|
|
160
|
+
export const formatTrimmedError: TypeErrorFormatter<TrimmedError> = (error) =>
|
|
161
|
+
`Reťazec ${safelyStringifyUnknownValue(error.value)} nesmie obsahovať medzery na začiatku ani na konci.`;
|
|
162
|
+
/** Formats a MinLengthError in Slovak. */
|
|
163
|
+
export const formatMinLengthError: TypeErrorFormatter<MinLengthError> = (
|
|
164
|
+
error,
|
|
165
|
+
) =>
|
|
166
|
+
typeof error.value === "string" && error.min === 1
|
|
167
|
+
? "Reťazec nesmie byť prázdny."
|
|
168
|
+
: `Hodnota ${safelyStringifyUnknownValue(error.value)} musí mať dĺžku aspoň ${error.min}.`;
|
|
169
|
+
/** Formats a MaxLengthError in Slovak. */
|
|
170
|
+
export const formatMaxLengthError: TypeErrorFormatter<MaxLengthError> = (
|
|
171
|
+
error,
|
|
172
|
+
) =>
|
|
173
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} môže mať dĺžku najviac ${error.max}.`;
|
|
174
|
+
/** Formats a LengthError in Slovak. */
|
|
175
|
+
export const formatLengthError: TypeErrorFormatter<LengthError> = (error) =>
|
|
176
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí mať presne dĺžku ${error.exact}.`;
|
|
177
|
+
/** Formats a RegexError in Slovak. */
|
|
178
|
+
export const formatRegexError: TypeErrorFormatter<RegexError> = (error) =>
|
|
179
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nezodpovedá regulárnemu výrazu /${error.source}/${error.flags}.`;
|
|
180
|
+
/** Formats a Base64UrlError in Slovak. */
|
|
181
|
+
export const formatBase64UrlError: TypeErrorFormatter<Base64UrlError> = (
|
|
182
|
+
error,
|
|
183
|
+
) =>
|
|
184
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platný reťazec Base64Url.`;
|
|
185
|
+
/** Formats a NameError in Slovak. */
|
|
186
|
+
export const formatNameError: TypeErrorFormatter<NameError> = (error) =>
|
|
187
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platný názov.`;
|
|
188
|
+
/** Formats a MnemonicError in Slovak. */
|
|
189
|
+
export const formatMnemonicError: TypeErrorFormatter<MnemonicError> = (error) =>
|
|
190
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platná anglická mnemotechnická fráza BIP39.`;
|
|
191
|
+
/** Formats an IdError in Slovak. */
|
|
192
|
+
export const formatIdError: TypeErrorFormatter<IdError> = (error) =>
|
|
193
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platné Id.`;
|
|
194
|
+
/** Formats a TableIdError in Slovak. */
|
|
195
|
+
export const formatTableIdError: TypeErrorFormatter<TableIdError> = (error) =>
|
|
196
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} nie je platné Id pre tabuľku ${safelyStringifyUnknownValue(error.table)}.`;
|
|
197
|
+
/** Formats a NonNegativeError in Slovak. */
|
|
198
|
+
export const formatNonNegativeError: TypeErrorFormatter<NonNegativeError> = (
|
|
199
|
+
error,
|
|
200
|
+
) =>
|
|
201
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nezáporná (>= 0).`;
|
|
202
|
+
/** Formats a NonNegativeDecimalStringError in Slovak. */
|
|
203
|
+
export const formatNonNegativeDecimalStringError: TypeErrorFormatter<
|
|
204
|
+
NonNegativeDecimalStringError
|
|
205
|
+
> = (error) =>
|
|
206
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nezáporný desatinný reťazec.`;
|
|
207
|
+
/** Formats a PositiveError in Slovak. */
|
|
208
|
+
export const formatPositiveError: TypeErrorFormatter<PositiveError> = (error) =>
|
|
209
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť kladná (> 0).`;
|
|
210
|
+
/** Formats a PositiveDecimalStringError in Slovak. */
|
|
211
|
+
export const formatPositiveDecimalStringError: TypeErrorFormatter<
|
|
212
|
+
PositiveDecimalStringError
|
|
213
|
+
> = (error) =>
|
|
214
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť kladný desatinný reťazec.`;
|
|
215
|
+
/** Formats a NonPositiveError in Slovak. */
|
|
216
|
+
export const formatNonPositiveError: TypeErrorFormatter<NonPositiveError> = (
|
|
217
|
+
error,
|
|
218
|
+
) =>
|
|
219
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nekladná (<= 0).`;
|
|
220
|
+
/** Formats a NonPositiveDecimalStringError in Slovak. */
|
|
221
|
+
export const formatNonPositiveDecimalStringError: TypeErrorFormatter<
|
|
222
|
+
NonPositiveDecimalStringError
|
|
223
|
+
> = (error) =>
|
|
224
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť nekladný desatinný reťazec.`;
|
|
225
|
+
/** Formats a NegativeError in Slovak. */
|
|
226
|
+
export const formatNegativeError: TypeErrorFormatter<NegativeError> = (error) =>
|
|
227
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť záporná (< 0).`;
|
|
228
|
+
/** Formats a NegativeDecimalStringError in Slovak. */
|
|
229
|
+
export const formatNegativeDecimalStringError: TypeErrorFormatter<
|
|
230
|
+
NegativeDecimalStringError
|
|
231
|
+
> = (error) =>
|
|
232
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť záporný desatinný reťazec.`;
|
|
233
|
+
/** Formats an IntError in Slovak. */
|
|
234
|
+
export const formatIntError: TypeErrorFormatter<IntError> = (error) =>
|
|
235
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť bezpečné celé číslo.`;
|
|
236
|
+
/** Formats a GreaterThanError in Slovak. */
|
|
237
|
+
export const formatGreaterThanError: TypeErrorFormatter<GreaterThanError> = (
|
|
238
|
+
error,
|
|
239
|
+
) =>
|
|
240
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť väčšia ako ${error.min}.`;
|
|
241
|
+
/** Formats a GreaterThanOrEqualToError in Slovak. */
|
|
242
|
+
export const formatGreaterThanOrEqualToError: TypeErrorFormatter<
|
|
243
|
+
GreaterThanOrEqualToError
|
|
244
|
+
> = (error) =>
|
|
245
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť väčšia alebo rovná ${error.min}.`;
|
|
246
|
+
/** Formats a LessThanError in Slovak. */
|
|
247
|
+
export const formatLessThanError: TypeErrorFormatter<LessThanError> = (error) =>
|
|
248
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť menšia ako ${error.max}.`;
|
|
249
|
+
/** Formats a LessThanOrEqualToError in Slovak. */
|
|
250
|
+
export const formatLessThanOrEqualToError: TypeErrorFormatter<
|
|
251
|
+
LessThanOrEqualToError
|
|
252
|
+
> = (error) =>
|
|
253
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť menšia alebo rovná ${error.max}.`;
|
|
254
|
+
/** Formats a NonNaNError in Slovak. */
|
|
255
|
+
export const formatNonNaNError: TypeErrorFormatter<NonNaNError> = () =>
|
|
256
|
+
"Hodnota nesmie byť NaN.";
|
|
257
|
+
/** Formats a FiniteError in Slovak. */
|
|
258
|
+
export const formatFiniteError: TypeErrorFormatter<FiniteError> = (error) =>
|
|
259
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť konečná.`;
|
|
260
|
+
/** Formats a MultipleOfError in Slovak. */
|
|
261
|
+
export const formatMultipleOfError: TypeErrorFormatter<MultipleOfError> = (
|
|
262
|
+
error,
|
|
263
|
+
) =>
|
|
264
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť násobkom čísla ${error.divisor}.`;
|
|
265
|
+
/** Formats a BetweenError in Slovak. */
|
|
266
|
+
export const formatBetweenError: TypeErrorFormatter<BetweenError> = (error) =>
|
|
267
|
+
`Hodnota ${safelyStringifyUnknownValue(error.value)} musí byť v rozsahu od ${error.min} do ${error.max} vrátane.`;
|
|
268
|
+
|
|
269
|
+
/** Formats an ArrayError in Slovak. */
|
|
270
|
+
export const formatArrayError: TypeErrorFormatter<ArrayError> = (error) => {
|
|
271
|
+
if (error.reason.kind === "NotArray")
|
|
272
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je pole.`;
|
|
273
|
+
const issue = error.reason.issues[0];
|
|
274
|
+
switch (issue.kind) {
|
|
275
|
+
case "Hole":
|
|
276
|
+
return `V poli chýba prvok na indexe ${issue.index}.`;
|
|
277
|
+
case "Accessor":
|
|
278
|
+
return `Prvok poľa na indexe ${issue.index} musí byť dátová vlastnosť.`;
|
|
279
|
+
case "ExcessProperty":
|
|
280
|
+
return "Pole obsahuje nepovolenú vlastnosť. Odstráňte ju alebo použite iný Type.";
|
|
281
|
+
case "Element":
|
|
282
|
+
return `Prvok poľa na indexe ${issue.index} nie je platný.`;
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
/** Formats a SetError in Slovak. */
|
|
286
|
+
export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
|
|
287
|
+
if (error.reason.kind === "NotSet")
|
|
288
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je Set.`;
|
|
289
|
+
if (error.reason.kind === "UnexpectedPrototype")
|
|
290
|
+
return "Hodnota je inštanciou podtriedy Set, ale výstup typu Set musí byť priamou inštanciou Set.";
|
|
291
|
+
const issue = error.reason.issues[0];
|
|
292
|
+
switch (issue.kind) {
|
|
293
|
+
case "ExcessProperty":
|
|
294
|
+
return `Set obsahuje nepovolenú vlastnosť ${safelyStringifyUnknownValue(issue.key)}.`;
|
|
295
|
+
case "Element":
|
|
296
|
+
return `Prvok Set na indexe ${issue.index} nie je platný.`;
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
/** Formats a TupleError in Slovak. */
|
|
300
|
+
export const formatTupleError: TypeErrorFormatter<
|
|
301
|
+
TupleError | TupleElementsError<TypeError>
|
|
302
|
+
> = (error) => {
|
|
303
|
+
if (error.reason.kind === "NotArray")
|
|
304
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je tuple.`;
|
|
305
|
+
if (error.reason.kind === "InvalidLength")
|
|
306
|
+
return `Tuple musí obsahovať presne ${error.reason.expected} prvkov, ale hodnota obsahuje ${error.reason.actual}.`;
|
|
307
|
+
const issue = error.reason.issues[0];
|
|
308
|
+
switch (issue.kind) {
|
|
309
|
+
case "Hole":
|
|
310
|
+
return `V Tuple chýba prvok na indexe ${issue.index}.`;
|
|
311
|
+
case "Accessor":
|
|
312
|
+
return `Prvok Tuple na indexe ${issue.index} musí byť dátová vlastnosť.`;
|
|
313
|
+
case "ExcessProperty":
|
|
314
|
+
return "Tuple obsahuje nepovolenú vlastnosť. Odstráňte ju alebo použite iný Type.";
|
|
315
|
+
case "Element":
|
|
316
|
+
return `Prvok Tuple na indexe ${issue.index} nie je platný.`;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
/** Formats a RecordError in Slovak. */
|
|
320
|
+
export const formatRecordError: TypeErrorFormatter<RecordError> = (error) => {
|
|
321
|
+
if (error.reason.kind === "NotRecord")
|
|
322
|
+
return `Hodnota ${safelyStringifyUnknownValue(error.reason.value)} nie je Record.`;
|
|
323
|
+
if (error.reason.kind === "NotPlainRecord")
|
|
324
|
+
return "Hodnota je objekt, ale výstup typu Record musí byť obyčajný objekt alebo mať prototyp null.";
|
|
325
|
+
const issue = error.reason.issues[0];
|
|
326
|
+
switch (issue.kind) {
|
|
327
|
+
case "Key":
|
|
328
|
+
return `Kľúč vlastnosti ${safelyStringifyUnknownValue(issue.key)} nie je platný.`;
|
|
329
|
+
case "Value":
|
|
330
|
+
return `Hodnota vlastnosti ${safelyStringifyUnknownValue(issue.key)} nie je platná.`;
|
|
331
|
+
case "Accessor":
|
|
332
|
+
return `Vlastnosť Record ${safelyStringifyUnknownValue(issue.key)} musí byť dátová vlastnosť.`;
|
|
333
|
+
case "NonEnumerable":
|
|
334
|
+
return `Vlastnosť Record ${safelyStringifyUnknownValue(issue.key)} musí byť enumerovateľná.`;
|
|
335
|
+
case "Collision":
|
|
336
|
+
return `Kľúče Record ${safelyStringifyUnknownValue(issue.previousKey)} a ${safelyStringifyUnknownValue(issue.key)} sa dekódujú na rovnaký kľúč ${safelyStringifyUnknownValue(issue.outputKey)}.`;
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
/** Formats an ObjectError in Slovak. */
|
|
340
|
+
export const formatObjectError: TypeErrorFormatter<ObjectError> = (error) => {
|
|
341
|
+
if (error.reason.kind !== "Properties")
|
|
342
|
+
return formatPlainObjectRootError(error.reason);
|
|
343
|
+
const key = Reflect.ownKeys(error.reason.errors).at(0);
|
|
344
|
+
assertNonNullable(key);
|
|
345
|
+
const propertyError = error.reason.errors[key];
|
|
346
|
+
assertNonNullable(propertyError);
|
|
347
|
+
if (propertyError.type === "ObjectPropertyAccess") {
|
|
348
|
+
switch ((propertyError as ObjectPropertyAccessError).reason) {
|
|
349
|
+
case "Accessor":
|
|
350
|
+
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.";
|
|
351
|
+
case "NonEnumerable":
|
|
352
|
+
return "Vlastnosť Object musí byť enumerovateľná.";
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (propertyError.type === "ObjectMissingProperty")
|
|
356
|
+
return `Chýba povinná vlastnosť ${safelyStringifyUnknownValue(key)}.`;
|
|
357
|
+
if (typeof key === "symbol")
|
|
358
|
+
return "Kľúč vlastnosti Object musí byť reťazec. Odstráňte vlastnosť so symbolom alebo použite iný Type.";
|
|
359
|
+
if (propertyError.type === "ObjectExcessProperty")
|
|
360
|
+
return `Vlastnosť ${safelyStringifyUnknownValue(key)} nie je povolená. Odstráňte ju alebo použite iný Type.`;
|
|
361
|
+
return `Vlastnosť ${safelyStringifyUnknownValue(key)} nie je platná.`;
|
|
362
|
+
};
|
|
363
|
+
/** Formats a DiscriminatedUnionError in Slovak. */
|
|
364
|
+
export const formatDiscriminatedUnionError: TypeErrorFormatter<
|
|
365
|
+
DiscriminatedUnionError
|
|
366
|
+
> = (error) => {
|
|
367
|
+
switch (error.reason.kind) {
|
|
368
|
+
case "Object":
|
|
369
|
+
return formatPlainObjectRootError(error.reason.error.reason);
|
|
370
|
+
case "PropertyAccess": {
|
|
371
|
+
const property = `Rozlišovacia vlastnosť ${safelyStringifyUnknownValue(error.reason.key)}`;
|
|
372
|
+
if (error.reason.reason === "Accessor")
|
|
373
|
+
return `${property} musí byť dátová vlastnosť.`;
|
|
374
|
+
if (error.reason.reason === "Inherited")
|
|
375
|
+
return `${property} musí byť vlastná vlastnosť.`;
|
|
376
|
+
return `${property} musí byť enumerovateľná.`;
|
|
377
|
+
}
|
|
378
|
+
case "Discriminator":
|
|
379
|
+
return `Rozlišovacia vlastnosť ${safelyStringifyUnknownValue(error.reason.key)} má neočakávanú hodnotu ${safelyStringifyUnknownValue(error.reason.value)}.`;
|
|
380
|
+
case "Member":
|
|
381
|
+
return `Vybraný variant ${safelyStringifyUnknownValue(error.reason.discriminator)} nie je platný.`;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
/** Formats a JsonValueError in Slovak. */
|
|
385
|
+
export const formatJsonValueError: TypeErrorFormatter<JsonValueError> = (
|
|
386
|
+
error,
|
|
387
|
+
) => {
|
|
388
|
+
const issue = error.reason.issues[0];
|
|
389
|
+
switch (issue.kind) {
|
|
390
|
+
case "InvalidType":
|
|
391
|
+
return `Hodnota ${safelyStringifyUnknownValue(issue.value)} nie je hodnota JSON.`;
|
|
392
|
+
case "NonFiniteNumber":
|
|
393
|
+
return "Číslo JSON musí byť konečné.";
|
|
394
|
+
case "UnexpectedPrototype":
|
|
395
|
+
return "Hodnota je objekt, ale objekt JsonValue musí byť obyčajný objekt alebo mať prototyp null.";
|
|
396
|
+
case "Accessor":
|
|
397
|
+
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.";
|
|
398
|
+
case "NonEnumerable":
|
|
399
|
+
return "Vlastnosť objektu JSON musí byť enumerovateľná. Odstráňte ju alebo použite iný Type.";
|
|
400
|
+
case "SymbolProperty":
|
|
401
|
+
return "Kľúč vlastnosti objektu JSON musí byť reťazec. Odstráňte vlastnosť so symbolom alebo použite iný Type.";
|
|
402
|
+
case "Hole":
|
|
403
|
+
return "V poli JSON chýba prvok.";
|
|
404
|
+
case "ExcessProperty":
|
|
405
|
+
return "Pole JSON obsahuje nepovolenú vlastnosť. Odstráňte ju alebo použite iný Type.";
|
|
406
|
+
case "CircularReference":
|
|
407
|
+
return "JsonValue nesmie obsahovať cyklické referencie.";
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
/** Formats a JsonError in Slovak. */
|
|
411
|
+
export const formatJsonError: TypeErrorFormatter<JsonError> = (error) =>
|
|
412
|
+
`Hodnotu ${safelyStringifyUnknownValue(error.value)} nemožno analyzovať ako JsonValue.`;
|