@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
package/src/intl/id.ts
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indonesian 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 formatTypeOfError = (
|
|
69
|
+
error: TypeOfError<
|
|
70
|
+
"String" | "Number" | "BigInt" | "Boolean" | "Symbol" | "Function"
|
|
71
|
+
>,
|
|
72
|
+
): string => {
|
|
73
|
+
const typeOf = error.expected.toLowerCase();
|
|
74
|
+
|
|
75
|
+
return `Nilai ${safelyStringifyUnknownValue(error.value)} bukan ${typeOf}.`;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const formatPlainObjectRootError = (
|
|
79
|
+
reason:
|
|
80
|
+
ObjectNotObjectError["reason"] | ObjectUnexpectedPrototypeError["reason"],
|
|
81
|
+
): string =>
|
|
82
|
+
reason.kind === "NotObject"
|
|
83
|
+
? `Nilai ${safelyStringifyUnknownValue(reason.value)} bukan objek.`
|
|
84
|
+
: "Nilai tersebut adalah objek, tetapi Output Object harus berupa objek biasa atau memiliki prototipe null.";
|
|
85
|
+
|
|
86
|
+
/** Formats a NeverError in Indonesian. */
|
|
87
|
+
export const formatNeverError: TypeErrorFormatter<NeverError> = (error) =>
|
|
88
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak valid untuk tipe Never.`;
|
|
89
|
+
|
|
90
|
+
/** Formats a String TypeOfError in Indonesian. */
|
|
91
|
+
export const formatStringError: TypeErrorFormatter<TypeOfError<"String">> =
|
|
92
|
+
formatTypeOfError;
|
|
93
|
+
|
|
94
|
+
/** Formats a TemplateLiteralError in Indonesian. */
|
|
95
|
+
export const formatTemplateLiteralError: TypeErrorFormatter<
|
|
96
|
+
TemplateLiteralError
|
|
97
|
+
> = (error) =>
|
|
98
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak cocok dengan literal template.`;
|
|
99
|
+
|
|
100
|
+
/** Formats a Number TypeOfError in Indonesian. */
|
|
101
|
+
export const formatNumberError: TypeErrorFormatter<TypeOfError<"Number">> =
|
|
102
|
+
formatTypeOfError;
|
|
103
|
+
|
|
104
|
+
/** Formats a BigInt TypeOfError in Indonesian. */
|
|
105
|
+
export const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">> =
|
|
106
|
+
formatTypeOfError;
|
|
107
|
+
|
|
108
|
+
/** Formats a Boolean TypeOfError in Indonesian. */
|
|
109
|
+
export const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">> =
|
|
110
|
+
formatTypeOfError;
|
|
111
|
+
|
|
112
|
+
/** Formats a Symbol TypeOfError in Indonesian. */
|
|
113
|
+
export const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">> =
|
|
114
|
+
formatTypeOfError;
|
|
115
|
+
|
|
116
|
+
/** Formats a Function TypeOfError in Indonesian. */
|
|
117
|
+
export const formatFunctionError: TypeErrorFormatter<TypeOfError<"Function">> =
|
|
118
|
+
formatTypeOfError;
|
|
119
|
+
|
|
120
|
+
/** Formats an EvoluTypeError in Indonesian. */
|
|
121
|
+
export const formatEvoluTypeError: TypeErrorFormatter<EvoluTypeError> = (
|
|
122
|
+
error,
|
|
123
|
+
) => `Nilai ${safelyStringifyUnknownValue(error.value)} bukan Tipe Evolu.`;
|
|
124
|
+
|
|
125
|
+
/** Formats an ObjectTagError in Indonesian. */
|
|
126
|
+
export const formatObjectTagError: TypeErrorFormatter<ObjectTagError> = (
|
|
127
|
+
error,
|
|
128
|
+
) =>
|
|
129
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak memiliki tag objek yang diharapkan ${safelyStringifyUnknownValue(error.expected)}.`;
|
|
130
|
+
|
|
131
|
+
/** Formats an InstanceOfError in Indonesian. */
|
|
132
|
+
export const formatInstanceOfError: TypeErrorFormatter<InstanceOfError> = (
|
|
133
|
+
error,
|
|
134
|
+
) =>
|
|
135
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan instance dari ${error.constructorName}.`;
|
|
136
|
+
|
|
137
|
+
/** Formats a LiteralError in Indonesian. */
|
|
138
|
+
export const formatLiteralError: TypeErrorFormatter<LiteralError> = (error) =>
|
|
139
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak sama persis dengan literal yang diharapkan: ${globalThis.String(error.expected)}.`;
|
|
140
|
+
|
|
141
|
+
/** Formats a UnionError in Indonesian. */
|
|
142
|
+
export const formatUnionError: TypeErrorFormatter<UnionError> = () =>
|
|
143
|
+
"Nilai tidak cocok dengan varian yang diizinkan mana pun.";
|
|
144
|
+
|
|
145
|
+
/** Formats a DateIsoError in Indonesian. */
|
|
146
|
+
export const formatDateIsoError: TypeErrorFormatter<DateIsoError> = (error) =>
|
|
147
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan string tanggal-waktu ISO kanonis.`;
|
|
148
|
+
|
|
149
|
+
/** Formats a DateIsoFromDateError in Indonesian. */
|
|
150
|
+
export const formatDateIsoFromDateError: TypeErrorFormatter<
|
|
151
|
+
DateIsoFromDateError
|
|
152
|
+
> = () => "Date tidak dapat direpresentasikan sebagai DateIso.";
|
|
153
|
+
|
|
154
|
+
/** Formats a DecimalStringError in Indonesian. */
|
|
155
|
+
export const formatDecimalStringError: TypeErrorFormatter<
|
|
156
|
+
DecimalStringError
|
|
157
|
+
> = (error) =>
|
|
158
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berupa string desimal kanonis.`;
|
|
159
|
+
|
|
160
|
+
/** Formats an Int64Error in Indonesian. */
|
|
161
|
+
export const formatInt64Error: TypeErrorFormatter<Int64Error> = (error) =>
|
|
162
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan bilangan bulat 64-bit bertanda (Int64) yang valid.`;
|
|
163
|
+
|
|
164
|
+
/** Formats a UInt64Error in Indonesian. */
|
|
165
|
+
export const formatUInt64Error: TypeErrorFormatter<UInt64Error> = (error) =>
|
|
166
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan bilangan bulat 64-bit tak bertanda (UInt64) yang valid.`;
|
|
167
|
+
|
|
168
|
+
/** Formats an Int64StringError in Indonesian. */
|
|
169
|
+
export const formatInt64StringError: TypeErrorFormatter<Int64StringError> = (
|
|
170
|
+
error,
|
|
171
|
+
) =>
|
|
172
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan string Int64 yang valid.`;
|
|
173
|
+
|
|
174
|
+
/** Formats a CapitalizedError in Indonesian. */
|
|
175
|
+
export const formatCapitalizedError: TypeErrorFormatter<CapitalizedError> = (
|
|
176
|
+
error,
|
|
177
|
+
) =>
|
|
178
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus menggunakan huruf kapital di awal.`;
|
|
179
|
+
|
|
180
|
+
/** Formats a TrimmedError in Indonesian. */
|
|
181
|
+
export const formatTrimmedError: TypeErrorFormatter<TrimmedError> = (error) =>
|
|
182
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus dipangkas.`;
|
|
183
|
+
|
|
184
|
+
/** Formats a MinLengthError in Indonesian. */
|
|
185
|
+
export const formatMinLengthError: TypeErrorFormatter<MinLengthError> = (
|
|
186
|
+
error,
|
|
187
|
+
) =>
|
|
188
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak memenuhi panjang minimum ${error.min}.`;
|
|
189
|
+
|
|
190
|
+
/** Formats a MaxLengthError in Indonesian. */
|
|
191
|
+
export const formatMaxLengthError: TypeErrorFormatter<MaxLengthError> = (
|
|
192
|
+
error,
|
|
193
|
+
) =>
|
|
194
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} melebihi panjang maksimum ${error.max}.`;
|
|
195
|
+
|
|
196
|
+
/** Formats a LengthError in Indonesian. */
|
|
197
|
+
export const formatLengthError: TypeErrorFormatter<LengthError> = (error) =>
|
|
198
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak memiliki panjang yang diperlukan, yaitu ${error.exact}.`;
|
|
199
|
+
|
|
200
|
+
/** Formats a RegexError in Indonesian. */
|
|
201
|
+
export const formatRegexError: TypeErrorFormatter<RegexError> = (error) =>
|
|
202
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak cocok dengan /${error.source}/${error.flags}.`;
|
|
203
|
+
|
|
204
|
+
/** Formats a Base64UrlError in Indonesian. */
|
|
205
|
+
export const formatBase64UrlError: TypeErrorFormatter<Base64UrlError> = (
|
|
206
|
+
error,
|
|
207
|
+
) =>
|
|
208
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan string Base64Url yang valid.`;
|
|
209
|
+
|
|
210
|
+
/** Formats a NameError in Indonesian. */
|
|
211
|
+
export const formatNameError: TypeErrorFormatter<NameError> = (error) =>
|
|
212
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan Name yang valid.`;
|
|
213
|
+
|
|
214
|
+
/** Formats a MnemonicError in Indonesian. */
|
|
215
|
+
export const formatMnemonicError: TypeErrorFormatter<MnemonicError> = (error) =>
|
|
216
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan mnemonik BIP39 bahasa Inggris yang valid.`;
|
|
217
|
+
|
|
218
|
+
/** Formats an IdError in Indonesian. */
|
|
219
|
+
export const formatIdError: TypeErrorFormatter<IdError> = (error) =>
|
|
220
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan Id yang valid.`;
|
|
221
|
+
|
|
222
|
+
/** Formats a TableIdError in Indonesian. */
|
|
223
|
+
export const formatTableIdError: TypeErrorFormatter<TableIdError> = (error) =>
|
|
224
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} bukan Id yang valid untuk tabel ${error.table}.`;
|
|
225
|
+
|
|
226
|
+
/** Formats a NonNegativeError in Indonesian. */
|
|
227
|
+
export const formatNonNegativeError: TypeErrorFormatter<NonNegativeError> = (
|
|
228
|
+
error,
|
|
229
|
+
) =>
|
|
230
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus non-negatif (>= 0).`;
|
|
231
|
+
|
|
232
|
+
/** Formats a NonNegativeDecimalStringError in Indonesian. */
|
|
233
|
+
export const formatNonNegativeDecimalStringError: TypeErrorFormatter<
|
|
234
|
+
NonNegativeDecimalStringError
|
|
235
|
+
> = (error) =>
|
|
236
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berupa string desimal non-negatif.`;
|
|
237
|
+
|
|
238
|
+
/** Formats a PositiveError in Indonesian. */
|
|
239
|
+
export const formatPositiveError: TypeErrorFormatter<PositiveError> = (error) =>
|
|
240
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus positif (> 0).`;
|
|
241
|
+
|
|
242
|
+
/** Formats a PositiveDecimalStringError in Indonesian. */
|
|
243
|
+
export const formatPositiveDecimalStringError: TypeErrorFormatter<
|
|
244
|
+
PositiveDecimalStringError
|
|
245
|
+
> = (error) =>
|
|
246
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berupa string desimal positif.`;
|
|
247
|
+
|
|
248
|
+
/** Formats a NonPositiveError in Indonesian. */
|
|
249
|
+
export const formatNonPositiveError: TypeErrorFormatter<NonPositiveError> = (
|
|
250
|
+
error,
|
|
251
|
+
) =>
|
|
252
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus non-positif (<= 0).`;
|
|
253
|
+
|
|
254
|
+
/** Formats a NonPositiveDecimalStringError in Indonesian. */
|
|
255
|
+
export const formatNonPositiveDecimalStringError: TypeErrorFormatter<
|
|
256
|
+
NonPositiveDecimalStringError
|
|
257
|
+
> = (error) =>
|
|
258
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berupa string desimal non-positif.`;
|
|
259
|
+
|
|
260
|
+
/** Formats a NegativeError in Indonesian. */
|
|
261
|
+
export const formatNegativeError: TypeErrorFormatter<NegativeError> = (error) =>
|
|
262
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus negatif (< 0).`;
|
|
263
|
+
|
|
264
|
+
/** Formats a NegativeDecimalStringError in Indonesian. */
|
|
265
|
+
export const formatNegativeDecimalStringError: TypeErrorFormatter<
|
|
266
|
+
NegativeDecimalStringError
|
|
267
|
+
> = (error) =>
|
|
268
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berupa string desimal negatif.`;
|
|
269
|
+
|
|
270
|
+
/** Formats an IntError in Indonesian. */
|
|
271
|
+
export const formatIntError: TypeErrorFormatter<IntError> = (error) =>
|
|
272
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berupa bilangan bulat aman.`;
|
|
273
|
+
|
|
274
|
+
/** Formats a GreaterThanError in Indonesian. */
|
|
275
|
+
export const formatGreaterThanError: TypeErrorFormatter<GreaterThanError> = (
|
|
276
|
+
error,
|
|
277
|
+
) =>
|
|
278
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus lebih besar dari ${error.min}.`;
|
|
279
|
+
|
|
280
|
+
/** Formats a GreaterThanOrEqualToError in Indonesian. */
|
|
281
|
+
export const formatGreaterThanOrEqualToError: TypeErrorFormatter<
|
|
282
|
+
GreaterThanOrEqualToError
|
|
283
|
+
> = (error) =>
|
|
284
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus lebih besar dari atau sama dengan ${error.min}.`;
|
|
285
|
+
|
|
286
|
+
/** Formats a LessThanError in Indonesian. */
|
|
287
|
+
export const formatLessThanError: TypeErrorFormatter<LessThanError> = (error) =>
|
|
288
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus lebih kecil dari ${error.max}.`;
|
|
289
|
+
|
|
290
|
+
/** Formats a LessThanOrEqualToError in Indonesian. */
|
|
291
|
+
export const formatLessThanOrEqualToError: TypeErrorFormatter<
|
|
292
|
+
LessThanOrEqualToError
|
|
293
|
+
> = (error) =>
|
|
294
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus lebih kecil dari atau sama dengan ${error.max}.`;
|
|
295
|
+
|
|
296
|
+
/** Formats a NonNaNError in Indonesian. */
|
|
297
|
+
export const formatNonNaNError: TypeErrorFormatter<NonNaNError> = () =>
|
|
298
|
+
"Nilai tidak boleh berupa NaN.";
|
|
299
|
+
|
|
300
|
+
/** Formats a FiniteError in Indonesian. */
|
|
301
|
+
export const formatFiniteError: TypeErrorFormatter<FiniteError> = (error) =>
|
|
302
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berhingga.`;
|
|
303
|
+
|
|
304
|
+
/** Formats a MultipleOfError in Indonesian. */
|
|
305
|
+
export const formatMultipleOfError: TypeErrorFormatter<MultipleOfError> = (
|
|
306
|
+
error,
|
|
307
|
+
) =>
|
|
308
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus kelipatan dari ${error.divisor}.`;
|
|
309
|
+
|
|
310
|
+
/** Formats a BetweenError in Indonesian. */
|
|
311
|
+
export const formatBetweenError: TypeErrorFormatter<BetweenError> = (error) =>
|
|
312
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} harus berada antara ${error.min} dan ${error.max}, termasuk batasnya.`;
|
|
313
|
+
|
|
314
|
+
/** Formats an ArrayError in Indonesian. */
|
|
315
|
+
export const formatArrayError: TypeErrorFormatter<ArrayError> = (error) => {
|
|
316
|
+
if (error.reason.kind === "NotArray") {
|
|
317
|
+
return `Nilai ${safelyStringifyUnknownValue(error.reason.value)} bukan array.`;
|
|
318
|
+
}
|
|
319
|
+
const issue = error.reason.issues[0];
|
|
320
|
+
|
|
321
|
+
switch (issue.kind) {
|
|
322
|
+
case "Hole":
|
|
323
|
+
return `Elemen array pada indeks ${issue.index} tidak ada.`;
|
|
324
|
+
case "Accessor":
|
|
325
|
+
return `Elemen array pada indeks ${issue.index} harus berupa properti data.`;
|
|
326
|
+
case "ExcessProperty":
|
|
327
|
+
return "Properti Array berlebih tidak diizinkan. Hapus properti tersebut atau gunakan Tipe lain.";
|
|
328
|
+
case "Element":
|
|
329
|
+
return `Elemen array pada indeks ${issue.index} tidak valid.`;
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
/** Formats a SetError in Indonesian. */
|
|
334
|
+
export const formatSetError: TypeErrorFormatter<SetError> = (error) => {
|
|
335
|
+
if (error.reason.kind === "NotSet") {
|
|
336
|
+
return `Nilai ${safelyStringifyUnknownValue(error.reason.value)} bukan Set.`;
|
|
337
|
+
}
|
|
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
|
+
const issue = error.reason.issues[0];
|
|
343
|
+
|
|
344
|
+
switch (issue.kind) {
|
|
345
|
+
case "ExcessProperty":
|
|
346
|
+
return `Properti Set berlebih ${safelyStringifyUnknownValue(issue.key)} tidak diizinkan.`;
|
|
347
|
+
case "Element":
|
|
348
|
+
return `Elemen Set pada indeks ${issue.index} tidak valid.`;
|
|
349
|
+
}
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
/** Formats a TupleError in Indonesian. */
|
|
353
|
+
export const formatTupleError: TypeErrorFormatter<
|
|
354
|
+
TupleError | TupleElementsError<TypeError>
|
|
355
|
+
> = (error) => {
|
|
356
|
+
if (error.reason.kind === "NotArray") {
|
|
357
|
+
return `Nilai ${safelyStringifyUnknownValue(error.reason.value)} bukan tuple.`;
|
|
358
|
+
}
|
|
359
|
+
if (error.reason.kind === "InvalidLength") {
|
|
360
|
+
return `Tuple harus berisi tepat ${error.reason.expected} elemen, tetapi nilainya berisi ${error.reason.actual}.`;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
const issue = error.reason.issues[0];
|
|
364
|
+
|
|
365
|
+
switch (issue.kind) {
|
|
366
|
+
case "Hole":
|
|
367
|
+
return `Elemen Tuple pada indeks ${issue.index} tidak ada.`;
|
|
368
|
+
case "Accessor":
|
|
369
|
+
return `Elemen Tuple pada indeks ${issue.index} harus berupa properti data.`;
|
|
370
|
+
case "ExcessProperty":
|
|
371
|
+
return "Properti Tuple berlebih tidak diizinkan. Hapus properti tersebut atau gunakan Tipe lain.";
|
|
372
|
+
case "Element":
|
|
373
|
+
return `Elemen Tuple pada indeks ${issue.index} tidak valid.`;
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/** Formats a RecordError in Indonesian. */
|
|
378
|
+
export const formatRecordError: TypeErrorFormatter<RecordError> = (error) => {
|
|
379
|
+
if (error.reason.kind === "NotRecord") {
|
|
380
|
+
return `Nilai ${safelyStringifyUnknownValue(error.reason.value)} bukan Record.`;
|
|
381
|
+
}
|
|
382
|
+
if (error.reason.kind === "NotPlainRecord") {
|
|
383
|
+
return "Nilai tersebut adalah objek, tetapi Output Record harus berupa objek biasa atau memiliki prototipe null.";
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const issue = error.reason.issues[0];
|
|
387
|
+
|
|
388
|
+
switch (issue.kind) {
|
|
389
|
+
case "Key":
|
|
390
|
+
return `Kunci properti ${safelyStringifyUnknownValue(issue.key)} tidak valid.`;
|
|
391
|
+
case "Value":
|
|
392
|
+
return `Nilai properti ${safelyStringifyUnknownValue(issue.key)} tidak valid.`;
|
|
393
|
+
case "Accessor":
|
|
394
|
+
return `Properti Record ${safelyStringifyUnknownValue(issue.key)} harus berupa properti data.`;
|
|
395
|
+
case "NonEnumerable":
|
|
396
|
+
return `Properti Record ${safelyStringifyUnknownValue(issue.key)} harus enumerable.`;
|
|
397
|
+
case "Collision":
|
|
398
|
+
return `Kunci Record ${safelyStringifyUnknownValue(issue.previousKey)} dan ${safelyStringifyUnknownValue(issue.key)} didekode menjadi kunci yang sama, ${safelyStringifyUnknownValue(issue.outputKey)}.`;
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
/** Formats an ObjectError in Indonesian. */
|
|
403
|
+
export const formatObjectError: TypeErrorFormatter<ObjectError> = (error) => {
|
|
404
|
+
if (error.reason.kind !== "Properties") {
|
|
405
|
+
return formatPlainObjectRootError(error.reason);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const key = Reflect.ownKeys(error.reason.errors).at(0);
|
|
409
|
+
assertNonNullable(key);
|
|
410
|
+
const propertyError = error.reason.errors[key];
|
|
411
|
+
assertNonNullable(propertyError);
|
|
412
|
+
|
|
413
|
+
if (propertyError.type === "ObjectPropertyAccess") {
|
|
414
|
+
switch ((propertyError as ObjectPropertyAccessError).reason) {
|
|
415
|
+
case "Accessor":
|
|
416
|
+
return "Properti Object harus berupa properti data. Wujudkan nilai accessor menjadi data biasa sebelum menggunakan Tipe ini atau gunakan Tipe lain.";
|
|
417
|
+
case "NonEnumerable":
|
|
418
|
+
return "Properti Object harus enumerable. Jadikan properti tersebut enumerable atau gunakan Tipe lain.";
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (propertyError.type === "ObjectMissingProperty") {
|
|
422
|
+
return `Properti wajib ${safelyStringifyUnknownValue(key)} tidak ada.`;
|
|
423
|
+
}
|
|
424
|
+
if (typeof key === "symbol") {
|
|
425
|
+
return "Kunci properti Object harus berupa string. Hapus properti symbol tersebut atau gunakan Tipe lain.";
|
|
426
|
+
}
|
|
427
|
+
if (propertyError.type === "ObjectExcessProperty") {
|
|
428
|
+
return `Properti ${safelyStringifyUnknownValue(key)} tidak diizinkan. Hapus properti tersebut atau gunakan Tipe lain.`;
|
|
429
|
+
}
|
|
430
|
+
return `Properti ${safelyStringifyUnknownValue(key)} tidak valid.`;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
/** Formats a DiscriminatedUnionError in Indonesian. */
|
|
434
|
+
export const formatDiscriminatedUnionError: TypeErrorFormatter<
|
|
435
|
+
DiscriminatedUnionError
|
|
436
|
+
> = (error) => {
|
|
437
|
+
switch (error.reason.kind) {
|
|
438
|
+
case "Object":
|
|
439
|
+
return formatPlainObjectRootError(error.reason.error.reason);
|
|
440
|
+
case "PropertyAccess": {
|
|
441
|
+
const property = `Properti discriminator ${safelyStringifyUnknownValue(error.reason.key)}`;
|
|
442
|
+
if (error.reason.reason === "Accessor") {
|
|
443
|
+
return `${property} harus berupa properti data.`;
|
|
444
|
+
}
|
|
445
|
+
if (error.reason.reason === "Inherited") {
|
|
446
|
+
return `${property} harus merupakan properti miliknya sendiri.`;
|
|
447
|
+
}
|
|
448
|
+
return `${property} harus enumerable.`;
|
|
449
|
+
}
|
|
450
|
+
case "Discriminator":
|
|
451
|
+
return `Properti discriminator ${safelyStringifyUnknownValue(error.reason.key)} memiliki nilai yang tidak diharapkan ${safelyStringifyUnknownValue(error.reason.value)}.`;
|
|
452
|
+
case "Member":
|
|
453
|
+
return `Varian yang dipilih ${safelyStringifyUnknownValue(error.reason.discriminator)} tidak valid.`;
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/** Formats a JsonValueError in Indonesian. */
|
|
458
|
+
export const formatJsonValueError: TypeErrorFormatter<JsonValueError> = (
|
|
459
|
+
error,
|
|
460
|
+
) => {
|
|
461
|
+
const issue = error.reason.issues[0];
|
|
462
|
+
|
|
463
|
+
switch (issue.kind) {
|
|
464
|
+
case "InvalidType":
|
|
465
|
+
return `Nilai ${safelyStringifyUnknownValue(issue.value)} bukan nilai JSON.`;
|
|
466
|
+
case "NonFiniteNumber":
|
|
467
|
+
return "Angka JSON harus berhingga.";
|
|
468
|
+
case "UnexpectedPrototype":
|
|
469
|
+
return "Nilai tersebut adalah objek, tetapi objek JsonValue harus berupa objek biasa atau memiliki prototipe null.";
|
|
470
|
+
case "Accessor":
|
|
471
|
+
return "Properti JSON harus berupa properti data. Wujudkan nilai accessor menjadi data biasa sebelum menggunakan Tipe ini atau gunakan Tipe lain.";
|
|
472
|
+
case "NonEnumerable":
|
|
473
|
+
return "Properti objek JSON harus enumerable. Hapus properti tersebut atau gunakan Tipe lain.";
|
|
474
|
+
case "SymbolProperty":
|
|
475
|
+
return "Kunci properti objek JSON harus berupa string. Hapus properti symbol tersebut atau gunakan Tipe lain.";
|
|
476
|
+
case "Hole":
|
|
477
|
+
return "Elemen array JSON tidak ada.";
|
|
478
|
+
case "ExcessProperty":
|
|
479
|
+
return "Properti array JSON berlebih tidak diizinkan. Hapus properti tersebut atau gunakan Tipe lain.";
|
|
480
|
+
case "CircularReference":
|
|
481
|
+
return "JsonValue tidak boleh berisi referensi sirkular.";
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
/** Formats a JsonError in Indonesian. */
|
|
486
|
+
export const formatJsonError: TypeErrorFormatter<JsonError> = (error) =>
|
|
487
|
+
`Nilai ${safelyStringifyUnknownValue(error.value)} tidak dapat diurai menjadi JsonValue.`;
|
package/src/intl/index.ts
CHANGED
|
@@ -4,4 +4,46 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
export * as ar from "./ar.ts";
|
|
8
|
+
export * as bn from "./bn.ts";
|
|
9
|
+
export * as ca from "./ca.ts";
|
|
7
10
|
export * as cs from "./cs.ts";
|
|
11
|
+
export * as da from "./da.ts";
|
|
12
|
+
export * as de from "./de.ts";
|
|
13
|
+
export * as el from "./el.ts";
|
|
14
|
+
export * as es from "./es.ts";
|
|
15
|
+
export * as fa from "./fa.ts";
|
|
16
|
+
export * as fi from "./fi.ts";
|
|
17
|
+
export * as fil from "./fil.ts";
|
|
18
|
+
export * as fr from "./fr.ts";
|
|
19
|
+
export * as he from "./he.ts";
|
|
20
|
+
export * as hi from "./hi.ts";
|
|
21
|
+
export * as hr from "./hr.ts";
|
|
22
|
+
export * as hu from "./hu.ts";
|
|
23
|
+
export * as id from "./id.ts";
|
|
24
|
+
export * as it from "./it.ts";
|
|
25
|
+
export * as ja from "./ja.ts";
|
|
26
|
+
export * as ko from "./ko.ts";
|
|
27
|
+
export * as ml from "./ml.ts";
|
|
28
|
+
export * as mr from "./mr.ts";
|
|
29
|
+
export * as ms from "./ms.ts";
|
|
30
|
+
export * as nb from "./nb.ts";
|
|
31
|
+
export * as nl from "./nl.ts";
|
|
32
|
+
export * as pa from "./pa.ts";
|
|
33
|
+
export * as pl from "./pl.ts";
|
|
34
|
+
export * as pt from "./pt.ts";
|
|
35
|
+
export * as ptBR from "./pt-BR.ts";
|
|
36
|
+
export * as ro from "./ro.ts";
|
|
37
|
+
export * as sk from "./sk.ts";
|
|
38
|
+
export * as sl from "./sl.ts";
|
|
39
|
+
export * as sv from "./sv.ts";
|
|
40
|
+
export * as sw from "./sw.ts";
|
|
41
|
+
export * as ta from "./ta.ts";
|
|
42
|
+
export * as te from "./te.ts";
|
|
43
|
+
export * as th from "./th.ts";
|
|
44
|
+
export * as tr from "./tr.ts";
|
|
45
|
+
export * as uk from "./uk.ts";
|
|
46
|
+
export * as ur from "./ur.ts";
|
|
47
|
+
export * as vi from "./vi.ts";
|
|
48
|
+
export * as zhCN from "./zh-CN.ts";
|
|
49
|
+
export * as zhTW from "./zh-TW.ts";
|