@evolu/common 8.9.0 → 8.10.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/Bytes.d.ts +647 -0
- package/dist/src/Bytes.d.ts.map +1 -0
- package/dist/src/{Binary.js → Bytes.js} +266 -16
- package/dist/src/Config.d.ts +142 -0
- package/dist/src/Config.d.ts.map +1 -0
- package/dist/src/Config.js +181 -0
- package/dist/src/Fs.d.ts +302 -0
- package/dist/src/Fs.d.ts.map +1 -0
- package/dist/src/Fs.js +111 -0
- package/dist/src/Number.d.ts +50 -7
- package/dist/src/Number.d.ts.map +1 -1
- package/dist/src/Number.js +47 -8
- package/dist/src/Object.d.ts +32 -0
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +41 -0
- package/dist/src/Sqlite.js +1 -1
- package/dist/src/Time.d.ts +74 -12
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +40 -2
- package/dist/src/Type.d.ts +1451 -79
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +1303 -96
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/intl/_en.d.ts +24 -1
- package/dist/src/intl/_en.d.ts.map +1 -1
- package/dist/src/intl/_en.js +20 -0
- package/dist/src/intl/ar.d.ts +24 -1
- package/dist/src/intl/ar.d.ts.map +1 -1
- package/dist/src/intl/ar.js +20 -0
- package/dist/src/intl/bn.d.ts +24 -1
- package/dist/src/intl/bn.d.ts.map +1 -1
- package/dist/src/intl/bn.js +20 -0
- package/dist/src/intl/ca.d.ts +24 -1
- package/dist/src/intl/ca.d.ts.map +1 -1
- package/dist/src/intl/ca.js +20 -0
- package/dist/src/intl/cs.d.ts +24 -1
- package/dist/src/intl/cs.d.ts.map +1 -1
- package/dist/src/intl/cs.js +20 -0
- package/dist/src/intl/da.d.ts +24 -1
- package/dist/src/intl/da.d.ts.map +1 -1
- package/dist/src/intl/da.js +20 -0
- package/dist/src/intl/de.d.ts +24 -1
- package/dist/src/intl/de.d.ts.map +1 -1
- package/dist/src/intl/de.js +20 -0
- package/dist/src/intl/el.d.ts +24 -1
- package/dist/src/intl/el.d.ts.map +1 -1
- package/dist/src/intl/el.js +20 -0
- package/dist/src/intl/es.d.ts +24 -1
- package/dist/src/intl/es.d.ts.map +1 -1
- package/dist/src/intl/es.js +20 -0
- package/dist/src/intl/fa.d.ts +24 -1
- package/dist/src/intl/fa.d.ts.map +1 -1
- package/dist/src/intl/fa.js +20 -0
- package/dist/src/intl/fi.d.ts +24 -1
- package/dist/src/intl/fi.d.ts.map +1 -1
- package/dist/src/intl/fi.js +20 -0
- package/dist/src/intl/fil.d.ts +24 -1
- package/dist/src/intl/fil.d.ts.map +1 -1
- package/dist/src/intl/fil.js +20 -0
- package/dist/src/intl/fr.d.ts +24 -1
- package/dist/src/intl/fr.d.ts.map +1 -1
- package/dist/src/intl/fr.js +20 -0
- package/dist/src/intl/he.d.ts +24 -1
- package/dist/src/intl/he.d.ts.map +1 -1
- package/dist/src/intl/he.js +20 -0
- package/dist/src/intl/hi.d.ts +24 -1
- package/dist/src/intl/hi.d.ts.map +1 -1
- package/dist/src/intl/hi.js +20 -0
- package/dist/src/intl/hr.d.ts +24 -1
- package/dist/src/intl/hr.d.ts.map +1 -1
- package/dist/src/intl/hr.js +20 -0
- package/dist/src/intl/hu.d.ts +22 -1
- package/dist/src/intl/hu.d.ts.map +1 -1
- package/dist/src/intl/hu.js +18 -0
- package/dist/src/intl/id.d.ts +24 -1
- package/dist/src/intl/id.d.ts.map +1 -1
- package/dist/src/intl/id.js +20 -0
- package/dist/src/intl/it.d.ts +24 -1
- package/dist/src/intl/it.d.ts.map +1 -1
- package/dist/src/intl/it.js +20 -0
- package/dist/src/intl/ja.d.ts +24 -1
- package/dist/src/intl/ja.d.ts.map +1 -1
- package/dist/src/intl/ja.js +20 -0
- package/dist/src/intl/ko.d.ts +24 -1
- package/dist/src/intl/ko.d.ts.map +1 -1
- package/dist/src/intl/ko.js +20 -0
- package/dist/src/intl/ml.d.ts +24 -1
- package/dist/src/intl/ml.d.ts.map +1 -1
- package/dist/src/intl/ml.js +20 -0
- package/dist/src/intl/mr.d.ts +24 -1
- package/dist/src/intl/mr.d.ts.map +1 -1
- package/dist/src/intl/mr.js +20 -0
- package/dist/src/intl/ms.d.ts +24 -1
- package/dist/src/intl/ms.d.ts.map +1 -1
- package/dist/src/intl/ms.js +20 -0
- package/dist/src/intl/nb.d.ts +22 -1
- package/dist/src/intl/nb.d.ts.map +1 -1
- package/dist/src/intl/nb.js +18 -0
- package/dist/src/intl/nl.d.ts +24 -1
- package/dist/src/intl/nl.d.ts.map +1 -1
- package/dist/src/intl/nl.js +20 -0
- package/dist/src/intl/pa.d.ts +24 -1
- package/dist/src/intl/pa.d.ts.map +1 -1
- package/dist/src/intl/pa.js +20 -0
- package/dist/src/intl/pl.d.ts +23 -0
- package/dist/src/intl/pl.d.ts.map +1 -1
- package/dist/src/intl/pl.js +20 -0
- package/dist/src/intl/pt-BR.d.ts +24 -1
- package/dist/src/intl/pt-BR.d.ts.map +1 -1
- package/dist/src/intl/pt-BR.js +20 -0
- package/dist/src/intl/pt.d.ts +24 -1
- package/dist/src/intl/pt.d.ts.map +1 -1
- package/dist/src/intl/pt.js +20 -0
- package/dist/src/intl/ro.d.ts +24 -1
- package/dist/src/intl/ro.d.ts.map +1 -1
- package/dist/src/intl/ro.js +20 -0
- package/dist/src/intl/sk.d.ts +24 -1
- package/dist/src/intl/sk.d.ts.map +1 -1
- package/dist/src/intl/sk.js +20 -0
- package/dist/src/intl/sl.d.ts +24 -1
- package/dist/src/intl/sl.d.ts.map +1 -1
- package/dist/src/intl/sl.js +20 -0
- package/dist/src/intl/sv.d.ts +24 -1
- package/dist/src/intl/sv.d.ts.map +1 -1
- package/dist/src/intl/sv.js +20 -0
- package/dist/src/intl/sw.d.ts +21 -0
- package/dist/src/intl/sw.d.ts.map +1 -1
- package/dist/src/intl/sw.js +18 -0
- package/dist/src/intl/ta.d.ts +24 -1
- package/dist/src/intl/ta.d.ts.map +1 -1
- package/dist/src/intl/ta.js +20 -0
- package/dist/src/intl/te.d.ts +24 -1
- package/dist/src/intl/te.d.ts.map +1 -1
- package/dist/src/intl/te.js +20 -0
- package/dist/src/intl/th.d.ts +24 -1
- package/dist/src/intl/th.d.ts.map +1 -1
- package/dist/src/intl/th.js +20 -0
- package/dist/src/intl/tr.d.ts +24 -1
- package/dist/src/intl/tr.d.ts.map +1 -1
- package/dist/src/intl/tr.js +20 -0
- package/dist/src/intl/uk.d.ts +80 -57
- package/dist/src/intl/uk.d.ts.map +1 -1
- package/dist/src/intl/uk.js +174 -149
- package/dist/src/intl/ur.d.ts +24 -1
- package/dist/src/intl/ur.d.ts.map +1 -1
- package/dist/src/intl/ur.js +20 -0
- package/dist/src/intl/vi.d.ts +24 -1
- package/dist/src/intl/vi.d.ts.map +1 -1
- package/dist/src/intl/vi.js +20 -0
- package/dist/src/intl/zh-CN.d.ts +24 -1
- package/dist/src/intl/zh-CN.d.ts.map +1 -1
- package/dist/src/intl/zh-CN.js +20 -0
- package/dist/src/intl/zh-TW.d.ts +24 -1
- package/dist/src/intl/zh-TW.d.ts.map +1 -1
- package/dist/src/intl/zh-TW.js +20 -0
- package/dist/src/local-first/Protocol.d.ts +1 -1
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +1 -1
- package/dist/src/local-first/Schema.d.ts +10 -0
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +1 -1
- package/dist/src/local-first/Timestamp.js +1 -1
- package/package.json +1 -1
- package/src/{Binary.test.ts → Bytes.test.ts} +286 -1
- package/src/{Binary.ts → Bytes.ts} +652 -21
- package/src/Config.test.ts +672 -0
- package/src/Config.ts +410 -0
- package/src/Fs.test.ts +105 -0
- package/src/Fs.ts +414 -0
- package/src/Number.test.ts +82 -18
- package/src/Number.ts +76 -8
- package/src/Object.test.ts +115 -1
- package/src/Object.ts +44 -0
- package/src/Sqlite.ts +1 -1
- package/src/Time.test.ts +82 -11
- package/src/Time.ts +141 -16
- package/src/Type.test.ts +3114 -157
- package/src/Type.ts +2553 -196
- package/src/index.ts +3 -1
- package/src/intl/_en.ts +70 -0
- package/src/intl/ar.ts +71 -0
- package/src/intl/bn.ts +70 -0
- package/src/intl/ca.ts +70 -0
- package/src/intl/cs.ts +70 -0
- package/src/intl/da.ts +70 -0
- package/src/intl/de.ts +70 -0
- package/src/intl/el.ts +70 -0
- package/src/intl/es.ts +70 -0
- package/src/intl/fa.ts +70 -0
- package/src/intl/fi.ts +70 -0
- package/src/intl/fil.ts +70 -0
- package/src/intl/fr.ts +70 -0
- package/src/intl/he.ts +70 -0
- package/src/intl/hi.ts +70 -0
- package/src/intl/hr.ts +70 -0
- package/src/intl/hu.ts +69 -0
- package/src/intl/id.ts +70 -0
- package/src/intl/intl.test.ts +819 -1
- package/src/intl/it.ts +70 -0
- package/src/intl/ja.ts +70 -0
- package/src/intl/ko.ts +68 -0
- package/src/intl/ml.ts +70 -0
- package/src/intl/mr.ts +70 -0
- package/src/intl/ms.ts +71 -0
- package/src/intl/nb.ts +69 -0
- package/src/intl/nl.ts +70 -0
- package/src/intl/pa.ts +70 -0
- package/src/intl/pl.ts +63 -0
- package/src/intl/pt-BR.ts +70 -0
- package/src/intl/pt.ts +71 -0
- package/src/intl/ro.ts +70 -0
- package/src/intl/sk.ts +71 -0
- package/src/intl/sl.ts +70 -0
- package/src/intl/sv.ts +70 -0
- package/src/intl/sw.ts +62 -0
- package/src/intl/ta.ts +70 -0
- package/src/intl/te.ts +70 -0
- package/src/intl/th.ts +68 -0
- package/src/intl/tr.ts +70 -0
- package/src/intl/uk.ts +228 -155
- package/src/intl/ur.ts +70 -0
- package/src/intl/vi.ts +70 -0
- package/src/intl/zh-CN.ts +68 -0
- package/src/intl/zh-TW.ts +68 -0
- package/src/local-first/Protocol.test.ts +1 -1
- package/src/local-first/Protocol.ts +1 -1
- package/src/local-first/Schema.ts +11 -0
- package/src/local-first/Storage.ts +1 -1
- package/src/local-first/Timestamp.ts +1 -1
- package/dist/src/Binary.d.ts +0 -254
- package/dist/src/Binary.d.ts.map +0 -1
package/src/intl/ur.ts
CHANGED
|
@@ -4,13 +4,21 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { DurationLiteralError } from "../Time.ts";
|
|
8
|
+
import type { PercentageLiteralError } from "../Number.ts";
|
|
9
|
+
import type { ByteSizeLiteralError } from "../Bytes.ts";
|
|
7
10
|
import { assertNonNullable } from "../Assert.ts";
|
|
8
11
|
import { safelyStringifyUnknownValue } from "../String.ts";
|
|
9
12
|
import type {
|
|
10
13
|
ArrayError,
|
|
11
14
|
Base64UrlError,
|
|
15
|
+
BooleanFromStringError,
|
|
12
16
|
BetweenError,
|
|
17
|
+
IdentifierError,
|
|
13
18
|
CapitalizedError,
|
|
19
|
+
UncapitalizedError,
|
|
20
|
+
UppercasedError,
|
|
21
|
+
LowercasedError,
|
|
14
22
|
DateIsoError,
|
|
15
23
|
DateIsoFromDateError,
|
|
16
24
|
DecimalStringError,
|
|
@@ -23,6 +31,7 @@ import type {
|
|
|
23
31
|
Int64Error,
|
|
24
32
|
Int64StringError,
|
|
25
33
|
IntError,
|
|
34
|
+
IntFromStringError,
|
|
26
35
|
IdError,
|
|
27
36
|
JsonError,
|
|
28
37
|
JsonValueError,
|
|
@@ -56,6 +65,7 @@ import type {
|
|
|
56
65
|
SetError,
|
|
57
66
|
TableIdError,
|
|
58
67
|
TemplateLiteralError,
|
|
68
|
+
StartsWithError,
|
|
59
69
|
TrimmedError,
|
|
60
70
|
TupleElementsError,
|
|
61
71
|
TupleError,
|
|
@@ -152,14 +162,44 @@ export const formatInt64StringError: TypeErrorFormatter<Int64StringError> = (
|
|
|
152
162
|
error,
|
|
153
163
|
) =>
|
|
154
164
|
`قدر ${safelyStringifyUnknownValue(error.value)} درست Int64 string نہیں ہے۔`;
|
|
165
|
+
|
|
166
|
+
/** Formats an IdentifierError in Urdu. */
|
|
167
|
+
export const formatIdentifierError: TypeErrorFormatter<IdentifierError> = (
|
|
168
|
+
error,
|
|
169
|
+
) =>
|
|
170
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} ${error.casing} شناخت کنندہ نہیں ہے۔`;
|
|
171
|
+
|
|
155
172
|
/** CapitalizedError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
156
173
|
export const formatCapitalizedError: TypeErrorFormatter<CapitalizedError> = (
|
|
157
174
|
error,
|
|
158
175
|
) =>
|
|
159
176
|
`قدر ${safelyStringifyUnknownValue(error.value)} کا پہلا حرف بڑا ہونا چاہیے۔`;
|
|
177
|
+
|
|
178
|
+
/** Formats an UncapitalizedError in Urdu. */
|
|
179
|
+
export const formatUncapitalizedError: TypeErrorFormatter<
|
|
180
|
+
UncapitalizedError
|
|
181
|
+
> = (error) =>
|
|
182
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} بڑے حرف سے شروع نہیں ہونی چاہیے۔`;
|
|
183
|
+
|
|
184
|
+
/** Formats an UppercasedError in Urdu. */
|
|
185
|
+
export const formatUppercasedError: TypeErrorFormatter<UppercasedError> = (
|
|
186
|
+
error,
|
|
187
|
+
) => `قدر ${safelyStringifyUnknownValue(error.value)} بڑے حروف میں ہونی چاہیے۔`;
|
|
188
|
+
|
|
189
|
+
/** Formats a LowercasedError in Urdu. */
|
|
190
|
+
export const formatLowercasedError: TypeErrorFormatter<LowercasedError> = (
|
|
191
|
+
error,
|
|
192
|
+
) =>
|
|
193
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} چھوٹے حروف میں ہونی چاہیے۔`;
|
|
160
194
|
/** TrimmedError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
161
195
|
export const formatTrimmedError: TypeErrorFormatter<TrimmedError> = (error) =>
|
|
162
196
|
`قدر ${safelyStringifyUnknownValue(error.value)} کے شروع یا آخر میں خالی جگہ نہیں ہونی چاہیے۔`;
|
|
197
|
+
/** Formats a StartsWithError in Urdu. */
|
|
198
|
+
export const formatStartsWithError: TypeErrorFormatter<StartsWithError> = (
|
|
199
|
+
error,
|
|
200
|
+
) =>
|
|
201
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} کی ابتدا ${safelyStringifyUnknownValue(error.prefix)} سے ہونی چاہیے۔`;
|
|
202
|
+
|
|
163
203
|
/** MinLengthError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
164
204
|
export const formatMinLengthError: TypeErrorFormatter<MinLengthError> = (
|
|
165
205
|
error,
|
|
@@ -265,6 +305,18 @@ export const formatMultipleOfError: TypeErrorFormatter<MultipleOfError> = (
|
|
|
265
305
|
export const formatBetweenError: TypeErrorFormatter<BetweenError> = (error) =>
|
|
266
306
|
`قدر ${safelyStringifyUnknownValue(error.value)} ${error.min} اور ${error.max} کے درمیان، دونوں شامل، ہونی چاہیے۔`;
|
|
267
307
|
|
|
308
|
+
/** BooleanFromStringError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
309
|
+
export const formatBooleanFromStringError: TypeErrorFormatter<
|
|
310
|
+
BooleanFromStringError
|
|
311
|
+
> = (error) =>
|
|
312
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} بولین نہیں ہے۔ true یا false استعمال کریں۔`;
|
|
313
|
+
|
|
314
|
+
/** IntFromStringError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
315
|
+
export const formatIntFromStringError: TypeErrorFormatter<
|
|
316
|
+
IntFromStringError
|
|
317
|
+
> = (error) =>
|
|
318
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} اعشاری عددِ صحیح نہیں ہے۔`;
|
|
319
|
+
|
|
268
320
|
/** ArrayError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
269
321
|
export const formatArrayError: TypeErrorFormatter<ArrayError> = (error) => {
|
|
270
322
|
if (error.reason.kind === "NotArray")
|
|
@@ -423,3 +475,21 @@ export const formatJsonValueError: TypeErrorFormatter<JsonValueError> = (
|
|
|
423
475
|
/** JsonError کو اردو میں فارمیٹ کرتا ہے۔ */
|
|
424
476
|
export const formatJsonError: TypeErrorFormatter<JsonError> = (error) =>
|
|
425
477
|
`قدر ${safelyStringifyUnknownValue(error.value)} کو JsonValue میں parse نہیں کیا جا سکتا۔`;
|
|
478
|
+
|
|
479
|
+
/** Formats a {@link ByteSizeLiteralError}. */
|
|
480
|
+
export const formatByteSizeLiteralError: TypeErrorFormatter<
|
|
481
|
+
ByteSizeLiteralError
|
|
482
|
+
> = (error) =>
|
|
483
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} بائٹ کے حجم کا لٹرل نہیں ہے۔ "512KiB" یا "1MiB" جیسی قدر استعمال کریں۔`;
|
|
484
|
+
|
|
485
|
+
/** Formats a {@link DurationLiteralError}. */
|
|
486
|
+
export const formatDurationLiteralError: TypeErrorFormatter<
|
|
487
|
+
DurationLiteralError
|
|
488
|
+
> = (error) =>
|
|
489
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} دورانیے کا لٹرل نہیں ہے۔ "500ms" یا "1.5s" جیسی قدر استعمال کریں۔`;
|
|
490
|
+
|
|
491
|
+
/** Formats a {@link PercentageLiteralError}. */
|
|
492
|
+
export const formatPercentageLiteralError: TypeErrorFormatter<
|
|
493
|
+
PercentageLiteralError
|
|
494
|
+
> = (error) =>
|
|
495
|
+
`قدر ${safelyStringifyUnknownValue(error.value)} فیصد کا لٹرل نہیں ہے۔ "50%" یا "12.5%" جیسی قدر استعمال کریں۔`;
|
package/src/intl/vi.ts
CHANGED
|
@@ -4,13 +4,21 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { DurationLiteralError } from "../Time.ts";
|
|
8
|
+
import type { PercentageLiteralError } from "../Number.ts";
|
|
9
|
+
import type { ByteSizeLiteralError } from "../Bytes.ts";
|
|
7
10
|
import { assertNonNullable } from "../Assert.ts";
|
|
8
11
|
import { safelyStringifyUnknownValue } from "../String.ts";
|
|
9
12
|
import type {
|
|
10
13
|
ArrayError,
|
|
11
14
|
Base64UrlError,
|
|
15
|
+
BooleanFromStringError,
|
|
12
16
|
BetweenError,
|
|
17
|
+
IdentifierError,
|
|
13
18
|
CapitalizedError,
|
|
19
|
+
UncapitalizedError,
|
|
20
|
+
UppercasedError,
|
|
21
|
+
LowercasedError,
|
|
14
22
|
DateIsoError,
|
|
15
23
|
DateIsoFromDateError,
|
|
16
24
|
DecimalStringError,
|
|
@@ -23,6 +31,7 @@ import type {
|
|
|
23
31
|
Int64Error,
|
|
24
32
|
Int64StringError,
|
|
25
33
|
IntError,
|
|
34
|
+
IntFromStringError,
|
|
26
35
|
IdError,
|
|
27
36
|
JsonError,
|
|
28
37
|
JsonValueError,
|
|
@@ -56,6 +65,7 @@ import type {
|
|
|
56
65
|
SetError,
|
|
57
66
|
TableIdError,
|
|
58
67
|
TemplateLiteralError,
|
|
68
|
+
StartsWithError,
|
|
59
69
|
TrimmedError,
|
|
60
70
|
TupleElementsError,
|
|
61
71
|
TupleError,
|
|
@@ -153,14 +163,44 @@ export const formatInt64StringError: TypeErrorFormatter<Int64StringError> = (
|
|
|
153
163
|
error,
|
|
154
164
|
) =>
|
|
155
165
|
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là chuỗi Int64 hợp lệ.`;
|
|
166
|
+
|
|
167
|
+
/** Formats an IdentifierError in Vietnamese. */
|
|
168
|
+
export const formatIdentifierError: TypeErrorFormatter<IdentifierError> = (
|
|
169
|
+
error,
|
|
170
|
+
) =>
|
|
171
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là định danh ${error.casing}.`;
|
|
172
|
+
|
|
156
173
|
/** Định dạng CapitalizedError bằng tiếng Việt. */
|
|
157
174
|
export const formatCapitalizedError: TypeErrorFormatter<CapitalizedError> = (
|
|
158
175
|
error,
|
|
159
176
|
) =>
|
|
160
177
|
`Giá trị ${safelyStringifyUnknownValue(error.value)} phải viết hoa chữ cái đầu.`;
|
|
178
|
+
|
|
179
|
+
/** Formats an UncapitalizedError in Vietnamese. */
|
|
180
|
+
export const formatUncapitalizedError: TypeErrorFormatter<
|
|
181
|
+
UncapitalizedError
|
|
182
|
+
> = (error) =>
|
|
183
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không được bắt đầu bằng chữ hoa.`;
|
|
184
|
+
|
|
185
|
+
/** Formats an UppercasedError in Vietnamese. */
|
|
186
|
+
export const formatUppercasedError: TypeErrorFormatter<UppercasedError> = (
|
|
187
|
+
error,
|
|
188
|
+
) => `Giá trị ${safelyStringifyUnknownValue(error.value)} phải được viết hoa.`;
|
|
189
|
+
|
|
190
|
+
/** Formats a LowercasedError in Vietnamese. */
|
|
191
|
+
export const formatLowercasedError: TypeErrorFormatter<LowercasedError> = (
|
|
192
|
+
error,
|
|
193
|
+
) =>
|
|
194
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} phải được viết thường.`;
|
|
161
195
|
/** Định dạng TrimmedError bằng tiếng Việt. */
|
|
162
196
|
export const formatTrimmedError: TypeErrorFormatter<TrimmedError> = (error) =>
|
|
163
197
|
`Giá trị ${safelyStringifyUnknownValue(error.value)} phải được cắt khoảng trắng đầu và cuối.`;
|
|
198
|
+
/** Formats a StartsWithError in Vietnamese. */
|
|
199
|
+
export const formatStartsWithError: TypeErrorFormatter<StartsWithError> = (
|
|
200
|
+
error,
|
|
201
|
+
) =>
|
|
202
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} phải bắt đầu bằng ${safelyStringifyUnknownValue(error.prefix)}.`;
|
|
203
|
+
|
|
164
204
|
/** Định dạng MinLengthError bằng tiếng Việt. */
|
|
165
205
|
export const formatMinLengthError: TypeErrorFormatter<MinLengthError> = (
|
|
166
206
|
error,
|
|
@@ -266,6 +306,18 @@ export const formatMultipleOfError: TypeErrorFormatter<MultipleOfError> = (
|
|
|
266
306
|
export const formatBetweenError: TypeErrorFormatter<BetweenError> = (error) =>
|
|
267
307
|
`Giá trị ${safelyStringifyUnknownValue(error.value)} phải nằm trong khoảng từ ${error.min} đến ${error.max}, kể cả hai đầu.`;
|
|
268
308
|
|
|
309
|
+
/** Định dạng BooleanFromStringError bằng tiếng Việt. */
|
|
310
|
+
export const formatBooleanFromStringError: TypeErrorFormatter<
|
|
311
|
+
BooleanFromStringError
|
|
312
|
+
> = (error) =>
|
|
313
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là giá trị boolean. Hãy dùng true hoặc false.`;
|
|
314
|
+
|
|
315
|
+
/** Định dạng IntFromStringError bằng tiếng Việt. */
|
|
316
|
+
export const formatIntFromStringError: TypeErrorFormatter<
|
|
317
|
+
IntFromStringError
|
|
318
|
+
> = (error) =>
|
|
319
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là số nguyên thập phân.`;
|
|
320
|
+
|
|
269
321
|
/** Định dạng ArrayError bằng tiếng Việt. */
|
|
270
322
|
export const formatArrayError: TypeErrorFormatter<ArrayError> = (error) => {
|
|
271
323
|
if (error.reason.kind === "NotArray") {
|
|
@@ -449,3 +501,21 @@ export const formatJsonValueError: TypeErrorFormatter<JsonValueError> = (
|
|
|
449
501
|
/** Định dạng JsonError bằng tiếng Việt. */
|
|
450
502
|
export const formatJsonError: TypeErrorFormatter<JsonError> = (error) =>
|
|
451
503
|
`Giá trị ${safelyStringifyUnknownValue(error.value)} không thể được phân tích thành JsonValue.`;
|
|
504
|
+
|
|
505
|
+
/** Formats a {@link ByteSizeLiteralError}. */
|
|
506
|
+
export const formatByteSizeLiteralError: TypeErrorFormatter<
|
|
507
|
+
ByteSizeLiteralError
|
|
508
|
+
> = (error) =>
|
|
509
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là hằng kích thước byte. Hãy dùng giá trị như "512KiB" hoặc "1MiB".`;
|
|
510
|
+
|
|
511
|
+
/** Formats a {@link DurationLiteralError}. */
|
|
512
|
+
export const formatDurationLiteralError: TypeErrorFormatter<
|
|
513
|
+
DurationLiteralError
|
|
514
|
+
> = (error) =>
|
|
515
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là hằng khoảng thời gian. Hãy dùng giá trị như "500ms" hoặc "1.5s".`;
|
|
516
|
+
|
|
517
|
+
/** Formats a {@link PercentageLiteralError}. */
|
|
518
|
+
export const formatPercentageLiteralError: TypeErrorFormatter<
|
|
519
|
+
PercentageLiteralError
|
|
520
|
+
> = (error) =>
|
|
521
|
+
`Giá trị ${safelyStringifyUnknownValue(error.value)} không phải là hằng phần trăm. Hãy dùng giá trị như "50%" hoặc "12.5%".`;
|
package/src/intl/zh-CN.ts
CHANGED
|
@@ -4,13 +4,21 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { DurationLiteralError } from "../Time.ts";
|
|
8
|
+
import type { PercentageLiteralError } from "../Number.ts";
|
|
9
|
+
import type { ByteSizeLiteralError } from "../Bytes.ts";
|
|
7
10
|
import { assertNonNullable } from "../Assert.ts";
|
|
8
11
|
import { safelyStringifyUnknownValue } from "../String.ts";
|
|
9
12
|
import type {
|
|
10
13
|
ArrayError,
|
|
11
14
|
Base64UrlError,
|
|
15
|
+
BooleanFromStringError,
|
|
12
16
|
BetweenError,
|
|
17
|
+
IdentifierError,
|
|
13
18
|
CapitalizedError,
|
|
19
|
+
UncapitalizedError,
|
|
20
|
+
UppercasedError,
|
|
21
|
+
LowercasedError,
|
|
14
22
|
DateIsoError,
|
|
15
23
|
DateIsoFromDateError,
|
|
16
24
|
DecimalStringError,
|
|
@@ -23,6 +31,7 @@ import type {
|
|
|
23
31
|
Int64Error,
|
|
24
32
|
Int64StringError,
|
|
25
33
|
IntError,
|
|
34
|
+
IntFromStringError,
|
|
26
35
|
IdError,
|
|
27
36
|
JsonError,
|
|
28
37
|
JsonValueError,
|
|
@@ -56,6 +65,7 @@ import type {
|
|
|
56
65
|
SetError,
|
|
57
66
|
TableIdError,
|
|
58
67
|
TemplateLiteralError,
|
|
68
|
+
StartsWithError,
|
|
59
69
|
TrimmedError,
|
|
60
70
|
TupleElementsError,
|
|
61
71
|
TupleError,
|
|
@@ -110,6 +120,12 @@ export const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">> =
|
|
|
110
120
|
export const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">> =
|
|
111
121
|
formatTypeOfError;
|
|
112
122
|
|
|
123
|
+
/** Formats a BooleanFromStringError。 */
|
|
124
|
+
export const formatBooleanFromStringError: TypeErrorFormatter<
|
|
125
|
+
BooleanFromStringError
|
|
126
|
+
> = (error) =>
|
|
127
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是布尔值。请使用 true 或 false。`;
|
|
128
|
+
|
|
113
129
|
/** 以简体中文格式化 Symbol TypeOfError。 */
|
|
114
130
|
export const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">> =
|
|
115
131
|
formatTypeOfError;
|
|
@@ -171,15 +187,43 @@ export const formatInt64StringError: TypeErrorFormatter<Int64StringError> = (
|
|
|
171
187
|
error,
|
|
172
188
|
) => `值 ${safelyStringifyUnknownValue(error.value)} 不是有效的 Int64 字符串。`;
|
|
173
189
|
|
|
190
|
+
/** Formats an IdentifierError in Simplified Chinese. */
|
|
191
|
+
export const formatIdentifierError: TypeErrorFormatter<IdentifierError> = (
|
|
192
|
+
error,
|
|
193
|
+
) =>
|
|
194
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是 ${error.casing} 标识符。`;
|
|
195
|
+
|
|
174
196
|
/** 以简体中文格式化 CapitalizedError。 */
|
|
175
197
|
export const formatCapitalizedError: TypeErrorFormatter<CapitalizedError> = (
|
|
176
198
|
error,
|
|
177
199
|
) => `值 ${safelyStringifyUnknownValue(error.value)} 必须以大写字母开头。`;
|
|
178
200
|
|
|
201
|
+
/** Formats an UncapitalizedError in Simplified Chinese. */
|
|
202
|
+
export const formatUncapitalizedError: TypeErrorFormatter<
|
|
203
|
+
UncapitalizedError
|
|
204
|
+
> = (error) =>
|
|
205
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不得以大写字母开头。`;
|
|
206
|
+
|
|
207
|
+
/** Formats an UppercasedError in Simplified Chinese. */
|
|
208
|
+
export const formatUppercasedError: TypeErrorFormatter<UppercasedError> = (
|
|
209
|
+
error,
|
|
210
|
+
) => `值 ${safelyStringifyUnknownValue(error.value)} 必须为大写。`;
|
|
211
|
+
|
|
212
|
+
/** Formats a LowercasedError in Simplified Chinese. */
|
|
213
|
+
export const formatLowercasedError: TypeErrorFormatter<LowercasedError> = (
|
|
214
|
+
error,
|
|
215
|
+
) => `值 ${safelyStringifyUnknownValue(error.value)} 必须为小写。`;
|
|
216
|
+
|
|
179
217
|
/** 以简体中文格式化 TrimmedError。 */
|
|
180
218
|
export const formatTrimmedError: TypeErrorFormatter<TrimmedError> = (error) =>
|
|
181
219
|
`值 ${safelyStringifyUnknownValue(error.value)} 必须去除首尾空白。`;
|
|
182
220
|
|
|
221
|
+
/** Formats a StartsWithError in Simplified Chinese. */
|
|
222
|
+
export const formatStartsWithError: TypeErrorFormatter<StartsWithError> = (
|
|
223
|
+
error,
|
|
224
|
+
) =>
|
|
225
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 必须以 ${safelyStringifyUnknownValue(error.prefix)} 开头。`;
|
|
226
|
+
|
|
183
227
|
/** 以简体中文格式化 MinLengthError。 */
|
|
184
228
|
export const formatMinLengthError: TypeErrorFormatter<MinLengthError> = (
|
|
185
229
|
error,
|
|
@@ -268,6 +312,12 @@ export const formatNegativeDecimalStringError: TypeErrorFormatter<
|
|
|
268
312
|
export const formatIntError: TypeErrorFormatter<IntError> = (error) =>
|
|
269
313
|
`值 ${safelyStringifyUnknownValue(error.value)} 必须是安全整数。`;
|
|
270
314
|
|
|
315
|
+
/** Formats an IntFromStringError。 */
|
|
316
|
+
export const formatIntFromStringError: TypeErrorFormatter<
|
|
317
|
+
IntFromStringError
|
|
318
|
+
> = (error) =>
|
|
319
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是十进制整数。`;
|
|
320
|
+
|
|
271
321
|
/** 以简体中文格式化 GreaterThanError。 */
|
|
272
322
|
export const formatGreaterThanError: TypeErrorFormatter<GreaterThanError> = (
|
|
273
323
|
error,
|
|
@@ -495,3 +545,21 @@ export const formatJsonValueError: TypeErrorFormatter<JsonValueError> = (
|
|
|
495
545
|
/** 以简体中文格式化 JsonError。 */
|
|
496
546
|
export const formatJsonError: TypeErrorFormatter<JsonError> = (error) =>
|
|
497
547
|
`值 ${safelyStringifyUnknownValue(error.value)} 无法解析为 JsonValue。`;
|
|
548
|
+
|
|
549
|
+
/** Formats a {@link ByteSizeLiteralError}. */
|
|
550
|
+
export const formatByteSizeLiteralError: TypeErrorFormatter<
|
|
551
|
+
ByteSizeLiteralError
|
|
552
|
+
> = (error) =>
|
|
553
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是字节大小字面量。请使用 "512KiB" 或 "1MiB" 这样的值。`;
|
|
554
|
+
|
|
555
|
+
/** Formats a {@link DurationLiteralError}. */
|
|
556
|
+
export const formatDurationLiteralError: TypeErrorFormatter<
|
|
557
|
+
DurationLiteralError
|
|
558
|
+
> = (error) =>
|
|
559
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是时长字面量。请使用 "500ms" 或 "1.5s" 这样的值。`;
|
|
560
|
+
|
|
561
|
+
/** Formats a {@link PercentageLiteralError}. */
|
|
562
|
+
export const formatPercentageLiteralError: TypeErrorFormatter<
|
|
563
|
+
PercentageLiteralError
|
|
564
|
+
> = (error) =>
|
|
565
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是百分比字面量。请使用 "50%" 或 "12.5%" 这样的值。`;
|
package/src/intl/zh-TW.ts
CHANGED
|
@@ -4,13 +4,21 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type { DurationLiteralError } from "../Time.ts";
|
|
8
|
+
import type { PercentageLiteralError } from "../Number.ts";
|
|
9
|
+
import type { ByteSizeLiteralError } from "../Bytes.ts";
|
|
7
10
|
import { assertNonNullable } from "../Assert.ts";
|
|
8
11
|
import { safelyStringifyUnknownValue } from "../String.ts";
|
|
9
12
|
import type {
|
|
10
13
|
ArrayError,
|
|
11
14
|
Base64UrlError,
|
|
15
|
+
BooleanFromStringError,
|
|
12
16
|
BetweenError,
|
|
17
|
+
IdentifierError,
|
|
13
18
|
CapitalizedError,
|
|
19
|
+
UncapitalizedError,
|
|
20
|
+
UppercasedError,
|
|
21
|
+
LowercasedError,
|
|
14
22
|
DateIsoError,
|
|
15
23
|
DateIsoFromDateError,
|
|
16
24
|
DecimalStringError,
|
|
@@ -23,6 +31,7 @@ import type {
|
|
|
23
31
|
Int64Error,
|
|
24
32
|
Int64StringError,
|
|
25
33
|
IntError,
|
|
34
|
+
IntFromStringError,
|
|
26
35
|
IdError,
|
|
27
36
|
JsonError,
|
|
28
37
|
JsonValueError,
|
|
@@ -56,6 +65,7 @@ import type {
|
|
|
56
65
|
SetError,
|
|
57
66
|
TableIdError,
|
|
58
67
|
TemplateLiteralError,
|
|
68
|
+
StartsWithError,
|
|
59
69
|
TrimmedError,
|
|
60
70
|
TupleElementsError,
|
|
61
71
|
TupleError,
|
|
@@ -110,6 +120,12 @@ export const formatBigIntError: TypeErrorFormatter<TypeOfError<"BigInt">> =
|
|
|
110
120
|
export const formatBooleanError: TypeErrorFormatter<TypeOfError<"Boolean">> =
|
|
111
121
|
formatTypeOfError;
|
|
112
122
|
|
|
123
|
+
/** 以繁體中文格式化 BooleanFromStringError。 */
|
|
124
|
+
export const formatBooleanFromStringError: TypeErrorFormatter<
|
|
125
|
+
BooleanFromStringError
|
|
126
|
+
> = (error) =>
|
|
127
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是布林值。請使用 true 或 false。`;
|
|
128
|
+
|
|
113
129
|
/** 以繁體中文格式化 Symbol TypeOfError。 */
|
|
114
130
|
export const formatSymbolError: TypeErrorFormatter<TypeOfError<"Symbol">> =
|
|
115
131
|
formatTypeOfError;
|
|
@@ -171,15 +187,43 @@ export const formatInt64StringError: TypeErrorFormatter<Int64StringError> = (
|
|
|
171
187
|
error,
|
|
172
188
|
) => `值 ${safelyStringifyUnknownValue(error.value)} 不是有效的 Int64 字串。`;
|
|
173
189
|
|
|
190
|
+
/** Formats an IdentifierError in Traditional Chinese. */
|
|
191
|
+
export const formatIdentifierError: TypeErrorFormatter<IdentifierError> = (
|
|
192
|
+
error,
|
|
193
|
+
) =>
|
|
194
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是 ${error.casing} 識別字。`;
|
|
195
|
+
|
|
174
196
|
/** 以繁體中文格式化 CapitalizedError。 */
|
|
175
197
|
export const formatCapitalizedError: TypeErrorFormatter<CapitalizedError> = (
|
|
176
198
|
error,
|
|
177
199
|
) => `值 ${safelyStringifyUnknownValue(error.value)} 必須以大寫字母開頭。`;
|
|
178
200
|
|
|
201
|
+
/** Formats an UncapitalizedError in Traditional Chinese. */
|
|
202
|
+
export const formatUncapitalizedError: TypeErrorFormatter<
|
|
203
|
+
UncapitalizedError
|
|
204
|
+
> = (error) =>
|
|
205
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不得以大寫字母開頭。`;
|
|
206
|
+
|
|
207
|
+
/** Formats an UppercasedError in Traditional Chinese. */
|
|
208
|
+
export const formatUppercasedError: TypeErrorFormatter<UppercasedError> = (
|
|
209
|
+
error,
|
|
210
|
+
) => `值 ${safelyStringifyUnknownValue(error.value)} 必須為大寫。`;
|
|
211
|
+
|
|
212
|
+
/** Formats a LowercasedError in Traditional Chinese. */
|
|
213
|
+
export const formatLowercasedError: TypeErrorFormatter<LowercasedError> = (
|
|
214
|
+
error,
|
|
215
|
+
) => `值 ${safelyStringifyUnknownValue(error.value)} 必須為小寫。`;
|
|
216
|
+
|
|
179
217
|
/** 以繁體中文格式化 TrimmedError。 */
|
|
180
218
|
export const formatTrimmedError: TypeErrorFormatter<TrimmedError> = (error) =>
|
|
181
219
|
`值 ${safelyStringifyUnknownValue(error.value)} 不得有前後空白。`;
|
|
182
220
|
|
|
221
|
+
/** Formats a StartsWithError in Traditional Chinese. */
|
|
222
|
+
export const formatStartsWithError: TypeErrorFormatter<StartsWithError> = (
|
|
223
|
+
error,
|
|
224
|
+
) =>
|
|
225
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 必須以 ${safelyStringifyUnknownValue(error.prefix)} 開頭。`;
|
|
226
|
+
|
|
183
227
|
/** 以繁體中文格式化 MinLengthError。 */
|
|
184
228
|
export const formatMinLengthError: TypeErrorFormatter<MinLengthError> = (
|
|
185
229
|
error,
|
|
@@ -268,6 +312,12 @@ export const formatNegativeDecimalStringError: TypeErrorFormatter<
|
|
|
268
312
|
export const formatIntError: TypeErrorFormatter<IntError> = (error) =>
|
|
269
313
|
`值 ${safelyStringifyUnknownValue(error.value)} 必須是安全整數。`;
|
|
270
314
|
|
|
315
|
+
/** 以繁體中文格式化 IntFromStringError。 */
|
|
316
|
+
export const formatIntFromStringError: TypeErrorFormatter<
|
|
317
|
+
IntFromStringError
|
|
318
|
+
> = (error) =>
|
|
319
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是十進位整數。`;
|
|
320
|
+
|
|
271
321
|
/** 以繁體中文格式化 GreaterThanError。 */
|
|
272
322
|
export const formatGreaterThanError: TypeErrorFormatter<GreaterThanError> = (
|
|
273
323
|
error,
|
|
@@ -495,3 +545,21 @@ export const formatJsonValueError: TypeErrorFormatter<JsonValueError> = (
|
|
|
495
545
|
/** 以繁體中文格式化 JsonError。 */
|
|
496
546
|
export const formatJsonError: TypeErrorFormatter<JsonError> = (error) =>
|
|
497
547
|
`值 ${safelyStringifyUnknownValue(error.value)} 無法剖析為 JsonValue。`;
|
|
548
|
+
|
|
549
|
+
/** Formats a {@link ByteSizeLiteralError}. */
|
|
550
|
+
export const formatByteSizeLiteralError: TypeErrorFormatter<
|
|
551
|
+
ByteSizeLiteralError
|
|
552
|
+
> = (error) =>
|
|
553
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是位元組大小字面值。請使用 "512KiB" 或 "1MiB" 這樣的值。`;
|
|
554
|
+
|
|
555
|
+
/** Formats a {@link DurationLiteralError}. */
|
|
556
|
+
export const formatDurationLiteralError: TypeErrorFormatter<
|
|
557
|
+
DurationLiteralError
|
|
558
|
+
> = (error) =>
|
|
559
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是時間長度字面值。請使用 "500ms" 或 "1.5s" 這樣的值。`;
|
|
560
|
+
|
|
561
|
+
/** Formats a {@link PercentageLiteralError}. */
|
|
562
|
+
export const formatPercentageLiteralError: TypeErrorFormatter<
|
|
563
|
+
PercentageLiteralError
|
|
564
|
+
> = (error) =>
|
|
565
|
+
`值 ${safelyStringifyUnknownValue(error.value)} 不是百分比字面值。請使用 "50%" 或 "12.5%" 這樣的值。`;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
assertThrowsInstanceOf,
|
|
13
13
|
assertTrue,
|
|
14
14
|
} from "../Assert.ts";
|
|
15
|
-
import { createBuffer, encodeNonNegativeInt } from "../
|
|
15
|
+
import { createBuffer, encodeNonNegativeInt } from "../Bytes.ts";
|
|
16
16
|
import { EncryptionKey } from "../Crypto.ts";
|
|
17
17
|
import { constFalse, constTrue } from "../Function.ts";
|
|
18
18
|
import { SqliteValue } from "../Sqlite.ts";
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
object,
|
|
36
36
|
type ObjectType,
|
|
37
37
|
type UnionType,
|
|
38
|
+
type withDefault,
|
|
38
39
|
} from "../Type.ts";
|
|
39
40
|
import type { CompileTimeError, Simplify } from "../Types.ts";
|
|
40
41
|
import type { AppOwner } from "./Owner.ts";
|
|
@@ -65,6 +66,16 @@ export type AnyStandardSchemaV1 = StandardSchemaV1<any, any>;
|
|
|
65
66
|
* Table schema defines columns that are required for table rows. For optional
|
|
66
67
|
* columns, use a schema whose output type includes `null`.
|
|
67
68
|
*
|
|
69
|
+
* Prefer applying defaults when reading or displaying data. A nullable column
|
|
70
|
+
* can preserve the distinction between "not specified" and an explicitly chosen
|
|
71
|
+
* value. For example, `null` can mean no notification preference, while an
|
|
72
|
+
* explicit false value means notifications were disabled.
|
|
73
|
+
*
|
|
74
|
+
* Use {@link withDefault} only when replacing absence is intentional. Storing
|
|
75
|
+
* defaulted values can add unnecessary data to database rows and erase that
|
|
76
|
+
* distinction. Store a value when it represents a user's decision or another
|
|
77
|
+
* fact your application needs to retain.
|
|
78
|
+
*
|
|
68
79
|
* ### Example
|
|
69
80
|
*
|
|
70
81
|
* ```ts
|
|
@@ -9,7 +9,7 @@ import type { NonEmptyReadonlyArray } from "../Array.ts";
|
|
|
9
9
|
import { firstInArray, isNonEmptyArray } from "../Array.ts";
|
|
10
10
|
import { assert, assertNonNullable } from "../Assert.ts";
|
|
11
11
|
import type { Brand } from "../Brand.ts";
|
|
12
|
-
import { concatBytes } from "../
|
|
12
|
+
import { concatBytes } from "../Bytes.ts";
|
|
13
13
|
import { decrement } from "../Number.ts";
|
|
14
14
|
import type { RandomDep } from "../Random.ts";
|
|
15
15
|
import { err, ok } from "../Result.ts";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { bytesToHex, hexToBytes } from "../
|
|
7
|
+
import { bytesToHex, hexToBytes } from "../Bytes.ts";
|
|
8
8
|
import type { RandomBytesDep } from "../Crypto.ts";
|
|
9
9
|
import { createEqObject, eqNumber, eqString } from "../Eq.ts";
|
|
10
10
|
import { increment } from "../Number.ts";
|