@oxog/vld 2.1.0 → 2.2.5
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/CHANGELOG.md +87 -0
- package/README.md +1296 -1235
- package/dist/chunks/errors-core-Cqi4-9ew.js +1 -0
- package/dist/chunks/index-CkbfQQ4n.js +1 -0
- package/dist/chunks/index-yjpbvFgw.js +1 -0
- package/dist/chunks/ip-validation-g5LWgy9t.js +1 -0
- package/dist/chunks/security-Dy24T8N7.js +1 -0
- package/dist/cjs/chunks/errors-core-DKPohm9I.cjs +1 -0
- package/dist/cjs/chunks/index-BEV9nG0N.cjs +1 -0
- package/dist/cjs/chunks/index-ZjHAxYdA.cjs +1 -0
- package/dist/cjs/chunks/ip-validation-BZqPamPC.cjs +1 -0
- package/dist/cjs/chunks/security-aXZVI7qW.cjs +1 -0
- package/dist/cjs/cli/bin.cjs +1 -505
- package/dist/cjs/cli/index.cjs +1 -209
- package/dist/cjs/codecs/index.cjs +1 -45
- package/dist/cjs/coercion/index.cjs +1 -588
- package/dist/cjs/compat/emitter.cjs +1 -184
- package/dist/cjs/compat/result.cjs +1 -189
- package/dist/cjs/errors.cjs +1 -180
- package/dist/cjs/index.cjs +1 -1894
- package/dist/cjs/kernel.cjs +1 -415
- package/dist/cjs/locales/af.cjs +1 -108
- package/dist/cjs/locales/ar.cjs +1 -108
- package/dist/cjs/locales/bn.cjs +1 -108
- package/dist/cjs/locales/da.cjs +1 -108
- package/dist/cjs/locales/de.cjs +1 -108
- package/dist/cjs/locales/en.cjs +1 -108
- package/dist/cjs/locales/es-MX.cjs +1 -107
- package/dist/cjs/locales/es.cjs +1 -96
- package/dist/cjs/locales/fi.cjs +1 -108
- package/dist/cjs/locales/fr.cjs +1 -96
- package/dist/cjs/locales/hi.cjs +1 -108
- package/dist/cjs/locales/id.cjs +1 -108
- package/dist/cjs/locales/index.cjs +1 -43
- package/dist/cjs/locales/it.cjs +1 -108
- package/dist/cjs/locales/ja.cjs +1 -108
- package/dist/cjs/locales/ko.cjs +1 -108
- package/dist/cjs/locales/lazy.cjs +1 -188
- package/dist/cjs/locales/nl.cjs +1 -108
- package/dist/cjs/locales/no.cjs +1 -108
- package/dist/cjs/locales/pl.cjs +1 -108
- package/dist/cjs/locales/pt-BR.cjs +1 -108
- package/dist/cjs/locales/pt.cjs +1 -108
- package/dist/cjs/locales/ru.cjs +1 -108
- package/dist/cjs/locales/runtime.cjs +1 -51
- package/dist/cjs/locales/sv.cjs +1 -108
- package/dist/cjs/locales/sw.cjs +1 -108
- package/dist/cjs/locales/th.cjs +1 -108
- package/dist/cjs/locales/tr.cjs +1 -108
- package/dist/cjs/locales/vi.cjs +1 -108
- package/dist/cjs/locales/zh.cjs +1 -108
- package/dist/cjs/mini.cjs +1 -242
- package/dist/cjs/pigment.cjs +1 -207
- package/dist/cjs/plugins/index.cjs +1 -12
- package/dist/cjs/registry.cjs +1 -37
- package/dist/cjs/v3/index.cjs +1 -425
- package/dist/cjs/v4/core/index.cjs +1 -894
- package/dist/cjs/v4/index.cjs +1 -425
- package/dist/cjs/v4/locales/index.cjs +1 -130
- package/dist/cjs/v4/mini/index.cjs +1 -509
- package/dist/cjs/v4-mini/index.cjs +1 -532
- package/dist/cjs/validators/any.cjs +1 -40
- package/dist/cjs/validators/array.cjs +1 -283
- package/dist/cjs/validators/base.cjs +1 -887
- package/dist/cjs/validators/base64.cjs +1 -73
- package/dist/cjs/validators/bigint.cjs +1 -232
- package/dist/cjs/validators/boolean.cjs +1 -146
- package/dist/cjs/validators/codec.cjs +1 -205
- package/dist/cjs/validators/custom.cjs +1 -71
- package/dist/cjs/validators/date.cjs +1 -278
- package/dist/cjs/validators/discriminated-union.cjs +1 -130
- package/dist/cjs/validators/enum.cjs +1 -154
- package/dist/cjs/validators/file.cjs +1 -130
- package/dist/cjs/validators/function.cjs +1 -63
- package/dist/cjs/validators/hex.cjs +1 -70
- package/dist/cjs/validators/index.cjs +1 -123
- package/dist/cjs/validators/intersection.cjs +1 -120
- package/dist/cjs/validators/json.cjs +1 -70
- package/dist/cjs/validators/lazy.cjs +1 -53
- package/dist/cjs/validators/literal.cjs +1 -64
- package/dist/cjs/validators/map.cjs +1 -218
- package/dist/cjs/validators/nan.cjs +1 -41
- package/dist/cjs/validators/never.cjs +1 -36
- package/dist/cjs/validators/null.cjs +1 -43
- package/dist/cjs/validators/number.cjs +1 -427
- package/dist/cjs/validators/object.cjs +1 -868
- package/dist/cjs/validators/promise.cjs +1 -115
- package/dist/cjs/validators/record.cjs +1 -262
- package/dist/cjs/validators/set.cjs +1 -203
- package/dist/cjs/validators/string-bool.cjs +1 -124
- package/dist/cjs/validators/string-formats.cjs +1 -168
- package/dist/cjs/validators/string.cjs +1 -12
- package/dist/cjs/validators/symbol.cjs +1 -62
- package/dist/cjs/validators/template-literal.cjs +1 -108
- package/dist/cjs/validators/tuple.cjs +1 -187
- package/dist/cjs/validators/uint8array.cjs +1 -106
- package/dist/cjs/validators/undefined.cjs +1 -43
- package/dist/cjs/validators/union.cjs +1 -191
- package/dist/cjs/validators/unknown.cjs +1 -40
- package/dist/cjs/validators/void.cjs +1 -48
- package/dist/cjs/validators/xor.cjs +1 -69
- package/dist/cli/bin.js +1 -406
- package/dist/cli/index.js +1 -205
- package/dist/codecs/index.js +1 -11
- package/dist/coercion/index.js +1 -579
- package/dist/compat/emitter.js +1 -180
- package/dist/compat/result.js +1 -170
- package/dist/errors-core.d.ts +20 -1
- package/dist/errors.js +1 -171
- package/dist/index.d.ts +248 -357
- package/dist/index.js +1 -1534
- package/dist/kernel.js +1 -409
- package/dist/locales/af.js +1 -106
- package/dist/locales/ar.js +1 -106
- package/dist/locales/bn.js +1 -106
- package/dist/locales/da.js +1 -106
- package/dist/locales/de.js +1 -106
- package/dist/locales/en.js +1 -106
- package/dist/locales/es-MX.js +1 -105
- package/dist/locales/es.js +1 -94
- package/dist/locales/fi.js +1 -106
- package/dist/locales/fr.js +1 -94
- package/dist/locales/hi.js +1 -106
- package/dist/locales/id.js +1 -106
- package/dist/locales/index.js +1 -29
- package/dist/locales/it.js +1 -106
- package/dist/locales/ja.js +1 -106
- package/dist/locales/ko.js +1 -106
- package/dist/locales/lazy.js +1 -177
- package/dist/locales/nl.js +1 -106
- package/dist/locales/no.js +1 -106
- package/dist/locales/pl.js +1 -106
- package/dist/locales/pt-BR.js +1 -106
- package/dist/locales/pt.js +1 -106
- package/dist/locales/ru.js +1 -106
- package/dist/locales/runtime.js +1 -41
- package/dist/locales/sv.js +1 -106
- package/dist/locales/sw.js +1 -106
- package/dist/locales/th.js +1 -106
- package/dist/locales/tr.js +1 -106
- package/dist/locales/vi.js +1 -106
- package/dist/locales/zh.js +1 -106
- package/dist/mini.d.ts +3 -3
- package/dist/mini.js +1 -156
- package/dist/pigment.js +1 -180
- package/dist/plugins/index.js +1 -1
- package/dist/registry.js +1 -34
- package/dist/utils/json-schema.d.ts +10 -1
- package/dist/v3/index.js +1 -46
- package/dist/v4/core/index.d.ts +28 -16
- package/dist/v4/core/index.js +1 -277
- package/dist/v4/index.js +1 -50
- package/dist/v4/locales/index.d.ts +4 -0
- package/dist/v4/locales/index.js +1 -77
- package/dist/v4/mini/index.js +1 -47
- package/dist/v4-mini/index.d.ts +1 -1
- package/dist/v4-mini/index.js +1 -75
- package/dist/validators/any.js +1 -37
- package/dist/validators/array.d.ts +7 -0
- package/dist/validators/array.js +1 -279
- package/dist/validators/base.d.ts +63 -8
- package/dist/validators/base.js +1 -868
- package/dist/validators/base64.js +1 -68
- package/dist/validators/bigint.js +1 -228
- package/dist/validators/boolean.js +1 -142
- package/dist/validators/codec.js +1 -200
- package/dist/validators/custom.js +1 -67
- package/dist/validators/date.js +1 -274
- package/dist/validators/discriminated-union.d.ts +2 -2
- package/dist/validators/discriminated-union.js +1 -123
- package/dist/validators/enum.js +1 -150
- package/dist/validators/file.js +1 -125
- package/dist/validators/function.js +1 -58
- package/dist/validators/hex.js +1 -65
- package/dist/validators/index.d.ts +1 -1
- package/dist/validators/index.js +1 -35
- package/dist/validators/intersection.js +1 -116
- package/dist/validators/json.js +1 -66
- package/dist/validators/lazy.js +1 -50
- package/dist/validators/literal.d.ts +7 -3
- package/dist/validators/literal.js +1 -60
- package/dist/validators/map.js +1 -214
- package/dist/validators/nan.js +1 -38
- package/dist/validators/never.js +1 -32
- package/dist/validators/null.js +1 -40
- package/dist/validators/number.d.ts +20 -1
- package/dist/validators/number.js +1 -423
- package/dist/validators/object.d.ts +12 -2
- package/dist/validators/object.js +1 -864
- package/dist/validators/promise.js +1 -111
- package/dist/validators/record.d.ts +11 -8
- package/dist/validators/record.js +1 -258
- package/dist/validators/set.js +1 -199
- package/dist/validators/string-bool.js +1 -120
- package/dist/validators/string-formats.d.ts +58 -62
- package/dist/validators/string-formats.js +1 -135
- package/dist/validators/string.d.ts +47 -10
- package/dist/validators/string.js +1 -4
- package/dist/validators/symbol.js +1 -58
- package/dist/validators/template-literal.js +1 -103
- package/dist/validators/tuple.d.ts +17 -13
- package/dist/validators/tuple.js +1 -183
- package/dist/validators/uint8array.js +1 -101
- package/dist/validators/undefined.js +1 -40
- package/dist/validators/union.js +1 -187
- package/dist/validators/unknown.js +1 -37
- package/dist/validators/void.js +1 -44
- package/dist/validators/xor.d.ts +2 -2
- package/dist/validators/xor.js +1 -66
- package/package.json +239 -238
- package/dist/chunks/errors-core-BeiFUtZM.js +0 -81
- package/dist/chunks/index-0R2ntSud.js +0 -508
- package/dist/chunks/index-BvH403Yy.js +0 -88
- package/dist/chunks/security-B0Pd_vSY.js +0 -35
- package/dist/chunks/string-BJRQod3t.js +0 -530
- package/dist/cjs/chunks/errors-core-DWxLFs2f.cjs +0 -83
- package/dist/cjs/chunks/index-BkI37108.cjs +0 -538
- package/dist/cjs/chunks/index-Cc3bjUMX.cjs +0 -91
- package/dist/cjs/chunks/security-Dc3Jh13T.cjs +0 -37
- package/dist/cjs/chunks/string-BKZrc4hs.cjs +0 -533
package/dist/cjs/locales/tr.cjs
CHANGED
|
@@ -1,108 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const tr = {
|
|
4
|
-
// String validation messages
|
|
5
|
-
invalidString: 'Geçersiz metin',
|
|
6
|
-
stringMin: (min) => `Metin en az ${min} karakter olmalı`,
|
|
7
|
-
stringMax: (max) => `Metin en fazla ${max} karakter olmalı`,
|
|
8
|
-
stringLength: (length) => `Metin tam olarak ${length} karakter olmalı`,
|
|
9
|
-
stringEmail: 'Geçersiz e-posta adresi',
|
|
10
|
-
stringUrl: 'Geçersiz URL',
|
|
11
|
-
stringUuid: 'Geçersiz UUID',
|
|
12
|
-
stringRegex: 'Geçersiz format',
|
|
13
|
-
stringStartsWith: (prefix) => `Metin "${prefix}" ile başlamalı`,
|
|
14
|
-
stringEndsWith: (suffix) => `Metin "${suffix}" ile bitmeli`,
|
|
15
|
-
stringIncludes: (substring) => `Metin "${substring}" içermeli`,
|
|
16
|
-
stringIp: 'Geçersiz IP adresi',
|
|
17
|
-
stringIpv4: 'Geçersiz IPv4 adresi',
|
|
18
|
-
stringIpv6: 'Geçersiz IPv6 adresi',
|
|
19
|
-
stringEmpty: 'Metin boş olmamalı',
|
|
20
|
-
// Number validation messages
|
|
21
|
-
invalidNumber: 'Geçersiz sayı',
|
|
22
|
-
numberMin: (min) => `Sayı en az ${min} olmalı`,
|
|
23
|
-
numberMax: (max) => `Sayı en fazla ${max} olmalı`,
|
|
24
|
-
numberInt: 'Sayı tam sayı olmalı',
|
|
25
|
-
numberPositive: 'Sayı pozitif olmalı',
|
|
26
|
-
numberNegative: 'Sayı negatif olmalı',
|
|
27
|
-
numberNonnegative: 'Sayı negatif olmamalı',
|
|
28
|
-
numberNonpositive: 'Sayı pozitif olmamalı',
|
|
29
|
-
numberFinite: 'Sayı sonlu olmalı',
|
|
30
|
-
numberSafe: 'Sayı güvenli tam sayı olmalı',
|
|
31
|
-
numberMultipleOf: (value) => `Sayı ${value}'nin katı olmalı`,
|
|
32
|
-
// Boolean validation messages
|
|
33
|
-
invalidBoolean: 'Geçersiz boolean',
|
|
34
|
-
// Date validation messages
|
|
35
|
-
invalidDate: 'Geçersiz tarih',
|
|
36
|
-
dateMin: (date) => `Tarih ${date.toISOString()} sonrasında olmalı`,
|
|
37
|
-
dateMax: (date) => `Tarih ${date.toISOString()} öncesinde olmalı`,
|
|
38
|
-
// Object validation messages
|
|
39
|
-
invalidObject: 'Geçersiz nesne',
|
|
40
|
-
unexpectedKeys: (keys) => `Beklenmeyen anahtarlar: ${keys.join(', ')}`,
|
|
41
|
-
// Array validation messages
|
|
42
|
-
invalidArray: 'Geçersiz dizi',
|
|
43
|
-
arrayMin: (min) => `Dizi en az ${min} eleman içermeli`,
|
|
44
|
-
arrayMax: (max) => `Dizi en fazla ${max} eleman içermeli`,
|
|
45
|
-
arrayLength: (length) => `Dizi tam olarak ${length} eleman içermeli`,
|
|
46
|
-
arrayEmpty: 'Dizi boş olmamalı',
|
|
47
|
-
arrayItem: (index, error) => `${index} indeksindeki eleman geçersiz: ${error}`,
|
|
48
|
-
// Object field validation
|
|
49
|
-
objectField: (field, error) => `"${field}" alanı geçersiz: ${error}`,
|
|
50
|
-
// Union validation messages
|
|
51
|
-
unionNoMatch: (errors) => `Hiçbir union üyesi eşleşmedi: ${errors.join(', ')}`,
|
|
52
|
-
// Intersection validation messages
|
|
53
|
-
intersectionError: (error) => `Intersection doğrulaması başarısız: ${error}`,
|
|
54
|
-
// Literal validation messages
|
|
55
|
-
literalExpected: (expected, received) => `${expected} beklendi, ${received} alındı`,
|
|
56
|
-
// Enum validation messages
|
|
57
|
-
enumExpected: (values, received) => `[${values.join(', ')}] değerlerinden biri beklendi, ${received} alındı`,
|
|
58
|
-
// Special type validation messages
|
|
59
|
-
expectedUndefined: 'Undefined beklendi',
|
|
60
|
-
neverType: 'Never tipi parse edilemez',
|
|
61
|
-
// New advanced type validation messages
|
|
62
|
-
invalidBigint: 'Geçersiz bigint',
|
|
63
|
-
invalidSymbol: 'Geçersiz symbol',
|
|
64
|
-
invalidTuple: 'Geçersiz tuple',
|
|
65
|
-
tupleLength: (expected, received) => `Tuple tam olarak ${expected} elemana sahip olmalı, ${received} aldı`,
|
|
66
|
-
invalidRecord: 'Geçersiz record',
|
|
67
|
-
invalidSet: 'Geçersiz set',
|
|
68
|
-
invalidMap: 'Geçersiz map',
|
|
69
|
-
// Transformation and refinement messages
|
|
70
|
-
transformError: (error) => `Dönüştürme başarısız: ${error}`,
|
|
71
|
-
refinementError: (error) => `Doğrulama başarısız: ${error}`,
|
|
72
|
-
customValidationError: (error) => `Özel doğrulama başarısız: ${error}`,
|
|
73
|
-
// Coercion messages
|
|
74
|
-
coercionFailed: (type, value) => `${JSON.stringify(value)} değeri ${type} tipine dönüştürülemez`,
|
|
75
|
-
// Codec messages
|
|
76
|
-
codecDecodeFailed: 'Failed to decode value',
|
|
77
|
-
codecEncodeFailed: 'Failed to encode value',
|
|
78
|
-
codecAsyncNotSupported: 'Async codec operations require using parseAsync/encodeAsync methods',
|
|
79
|
-
// Base64/Hex messages
|
|
80
|
-
invalidBase64: 'Invalid base64 string',
|
|
81
|
-
invalidHex: 'Invalid hexadecimal string',
|
|
82
|
-
// Uint8Array messages
|
|
83
|
-
expectedUint8Array: 'Expected Uint8Array',
|
|
84
|
-
uint8ArrayMinLength: (min) => `Uint8Array must have at least ${min} bytes`,
|
|
85
|
-
uint8ArrayMaxLength: (max) => `Uint8Array must have at most ${max} bytes`,
|
|
86
|
-
uint8ArrayExactLength: (length) => `Uint8Array must have exactly ${length} bytes`,
|
|
87
|
-
// Generic type error messages
|
|
88
|
-
expectedString: 'Expected string',
|
|
89
|
-
stringExpected: (received, expected) => `Beklenen: ${expected}, alınan: ${received}`,
|
|
90
|
-
stringBoolExpected: (validValues, received) => `Geçersiz boolean string. Şunlardan biri olmalı: ${validValues}, alınan: "${received}"`,
|
|
91
|
-
invalidJson: 'Geçersiz JSON',
|
|
92
|
-
stringPatternInvalid: 'Dize gerekli kalıpla eşleşmiyor',
|
|
93
|
-
// File validation messages
|
|
94
|
-
invalidFile: 'Expected a File object',
|
|
95
|
-
fileNotSupported: 'File API not supported in this environment',
|
|
96
|
-
fileMinSize: (min) => `File size must be at least ${min} bytes`,
|
|
97
|
-
fileMaxSize: (max) => `File size must not exceed ${max} bytes`,
|
|
98
|
-
fileMimeType: (allowed) => `Invalid file type. Expected: ${allowed.join(", ")}`,
|
|
99
|
-
// Function validation messages
|
|
100
|
-
invalidFunction: 'Bir fonksiyon bekleniyor',
|
|
101
|
-
// CIDR validation messages
|
|
102
|
-
stringCidrv4: 'Geçersiz IPv4 CIDR bloğu',
|
|
103
|
-
stringCidrv6: 'Geçersiz IPv6 CIDR bloğu',
|
|
104
|
-
// Safe extend validation messages
|
|
105
|
-
safeExtendOverlap: (keys) => `Mevcut anahtarlar üzerine yazılamaz: ${keys.join(', ')}. Üzerine yazmak istiyorsanız extend() kullanın.`
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
exports.tr = tr;
|
|
1
|
+
"use strict";const e={invalidString:"Geçersiz metin",stringMin:e=>`Metin en az ${e} karakter olmalı`,stringMax:e=>`Metin en fazla ${e} karakter olmalı`,stringLength:e=>`Metin tam olarak ${e} karakter olmalı`,stringEmail:"Geçersiz e-posta adresi",stringUrl:"Geçersiz URL",stringUuid:"Geçersiz UUID",stringRegex:"Geçersiz format",stringStartsWith:e=>`Metin "${e}" ile başlamalı`,stringEndsWith:e=>`Metin "${e}" ile bitmeli`,stringIncludes:e=>`Metin "${e}" içermeli`,stringIp:"Geçersiz IP adresi",stringIpv4:"Geçersiz IPv4 adresi",stringIpv6:"Geçersiz IPv6 adresi",stringEmpty:"Metin boş olmamalı",invalidNumber:"Geçersiz sayı",numberMin:e=>`Sayı en az ${e} olmalı`,numberMax:e=>`Sayı en fazla ${e} olmalı`,numberInt:"Sayı tam sayı olmalı",numberPositive:"Sayı pozitif olmalı",numberNegative:"Sayı negatif olmalı",numberNonnegative:"Sayı negatif olmamalı",numberNonpositive:"Sayı pozitif olmamalı",numberFinite:"Sayı sonlu olmalı",numberSafe:"Sayı güvenli tam sayı olmalı",numberMultipleOf:e=>`Sayı ${e}'nin katı olmalı`,invalidBoolean:"Geçersiz boolean",invalidDate:"Geçersiz tarih",dateMin:e=>`Tarih ${e.toISOString()} sonrasında olmalı`,dateMax:e=>`Tarih ${e.toISOString()} öncesinde olmalı`,invalidObject:"Geçersiz nesne",unexpectedKeys:e=>`Beklenmeyen anahtarlar: ${e.join(", ")}`,invalidArray:"Geçersiz dizi",arrayMin:e=>`Dizi en az ${e} eleman içermeli`,arrayMax:e=>`Dizi en fazla ${e} eleman içermeli`,arrayLength:e=>`Dizi tam olarak ${e} eleman içermeli`,arrayEmpty:"Dizi boş olmamalı",arrayItem:(e,i)=>`${e} indeksindeki eleman geçersiz: ${i}`,objectField:(e,i)=>`"${e}" alanı geçersiz: ${i}`,unionNoMatch:e=>`Hiçbir union üyesi eşleşmedi: ${e.join(", ")}`,intersectionError:e=>`Intersection doğrulaması başarısız: ${e}`,literalExpected:(e,i)=>`${e} beklendi, ${i} alındı`,enumExpected:(e,i)=>`[${e.join(", ")}] değerlerinden biri beklendi, ${i} alındı`,expectedUndefined:"Undefined beklendi",neverType:"Never tipi parse edilemez",invalidBigint:"Geçersiz bigint",invalidSymbol:"Geçersiz symbol",invalidTuple:"Geçersiz tuple",tupleLength:(e,i)=>`Tuple tam olarak ${e} elemana sahip olmalı, ${i} aldı`,invalidRecord:"Geçersiz record",invalidSet:"Geçersiz set",invalidMap:"Geçersiz map",transformError:e=>`Dönüştürme başarısız: ${e}`,refinementError:e=>`Doğrulama başarısız: ${e}`,customValidationError:e=>`Özel doğrulama başarısız: ${e}`,coercionFailed:(e,i)=>`${JSON.stringify(i)} değeri ${e} tipine dönüştürülemez`,codecDecodeFailed:"Failed to decode value",codecEncodeFailed:"Failed to encode value",codecAsyncNotSupported:"Async codec operations require using parseAsync/encodeAsync methods",invalidBase64:"Invalid base64 string",invalidHex:"Invalid hexadecimal string",expectedUint8Array:"Expected Uint8Array",uint8ArrayMinLength:e=>`Uint8Array must have at least ${e} bytes`,uint8ArrayMaxLength:e=>`Uint8Array must have at most ${e} bytes`,uint8ArrayExactLength:e=>`Uint8Array must have exactly ${e} bytes`,expectedString:"Expected string",stringExpected:(e,i)=>`Beklenen: ${i}, alınan: ${e}`,stringBoolExpected:(e,i)=>`Geçersiz boolean string. Şunlardan biri olmalı: ${e}, alınan: "${i}"`,invalidJson:"Geçersiz JSON",stringPatternInvalid:"Dize gerekli kalıpla eşleşmiyor",invalidFile:"Expected a File object",fileNotSupported:"File API not supported in this environment",fileMinSize:e=>`File size must be at least ${e} bytes`,fileMaxSize:e=>`File size must not exceed ${e} bytes`,fileMimeType:e=>`Invalid file type. Expected: ${e.join(", ")}`,invalidFunction:"Bir fonksiyon bekleniyor",stringCidrv4:"Geçersiz IPv4 CIDR bloğu",stringCidrv6:"Geçersiz IPv6 CIDR bloğu",safeExtendOverlap:e=>`Mevcut anahtarlar üzerine yazılamaz: ${e.join(", ")}. Üzerine yazmak istiyorsanız extend() kullanın.`};exports.tr=e;
|
package/dist/cjs/locales/vi.cjs
CHANGED
|
@@ -1,108 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const vi = {
|
|
4
|
-
// String validation messages
|
|
5
|
-
invalidString: 'Chuỗi không hợp lệ',
|
|
6
|
-
stringMin: (min) => `Chuỗi phải có ít nhất ${min} ký tự`,
|
|
7
|
-
stringMax: (max) => `Chuỗi không được quá ${max} ký tự`,
|
|
8
|
-
stringLength: (length) => `Chuỗi phải có chính xác ${length} ký tự`,
|
|
9
|
-
stringEmail: 'Địa chỉ email không hợp lệ',
|
|
10
|
-
stringUrl: 'URL không hợp lệ',
|
|
11
|
-
stringUuid: 'UUID không hợp lệ',
|
|
12
|
-
stringRegex: 'Định dạng không hợp lệ',
|
|
13
|
-
stringStartsWith: (prefix) => `Chuỗi phải bắt đầu bằng "${prefix}"`,
|
|
14
|
-
stringEndsWith: (suffix) => `Chuỗi phải kết thúc bằng "${suffix}"`,
|
|
15
|
-
stringIncludes: (substring) => `Chuỗi phải chứa "${substring}"`,
|
|
16
|
-
stringIp: 'Địa chỉ IP không hợp lệ',
|
|
17
|
-
stringIpv4: 'Địa chỉ IPv4 không hợp lệ',
|
|
18
|
-
stringIpv6: 'Địa chỉ IPv6 không hợp lệ',
|
|
19
|
-
stringEmpty: 'Chuỗi không được để trống',
|
|
20
|
-
// Number validation messages
|
|
21
|
-
invalidNumber: 'Số không hợp lệ',
|
|
22
|
-
numberMin: (min) => `Số phải ít nhất là ${min}`,
|
|
23
|
-
numberMax: (max) => `Số không được vượt quá ${max}`,
|
|
24
|
-
numberInt: 'Số phải là số nguyên',
|
|
25
|
-
numberPositive: 'Số phải là số dương',
|
|
26
|
-
numberNegative: 'Số phải là số âm',
|
|
27
|
-
numberNonnegative: 'Số không được là số âm',
|
|
28
|
-
numberNonpositive: 'Số không được là số dương',
|
|
29
|
-
numberFinite: 'Số phải là số hữu hạn',
|
|
30
|
-
numberSafe: 'Số phải là số nguyên an toàn',
|
|
31
|
-
numberMultipleOf: (value) => `Số phải là bội số của ${value}`,
|
|
32
|
-
// Boolean validation messages
|
|
33
|
-
invalidBoolean: 'Giá trị boolean không hợp lệ',
|
|
34
|
-
// Date validation messages
|
|
35
|
-
invalidDate: 'Ngày không hợp lệ',
|
|
36
|
-
dateMin: (date) => `Ngày phải sau ${date.toISOString()}`,
|
|
37
|
-
dateMax: (date) => `Ngày phải trước ${date.toISOString()}`,
|
|
38
|
-
// Object validation messages
|
|
39
|
-
invalidObject: 'Đối tượng không hợp lệ',
|
|
40
|
-
unexpectedKeys: (keys) => `Khóa không mong muốn: ${keys.join(', ')}`,
|
|
41
|
-
// Array validation messages
|
|
42
|
-
invalidArray: 'Mảng không hợp lệ',
|
|
43
|
-
arrayMin: (min) => `Mảng phải có ít nhất ${min} phần tử`,
|
|
44
|
-
arrayMax: (max) => `Mảng không được quá ${max} phần tử`,
|
|
45
|
-
arrayLength: (length) => `Mảng phải có chính xác ${length} phần tử`,
|
|
46
|
-
arrayEmpty: 'Mảng không được để trống',
|
|
47
|
-
arrayItem: (index, error) => `Phần tử không hợp lệ tại vị trí ${index}: ${error}`,
|
|
48
|
-
// Object field validation
|
|
49
|
-
objectField: (field, error) => `Trường "${field}" không hợp lệ: ${error}`,
|
|
50
|
-
// Union validation messages
|
|
51
|
-
unionNoMatch: (errors) => `Không có thành viên union nào khớp: ${errors.join(', ')}`,
|
|
52
|
-
// Intersection validation messages
|
|
53
|
-
intersectionError: (error) => `Xác thực intersection thất bại: ${error}`,
|
|
54
|
-
// Literal validation messages
|
|
55
|
-
literalExpected: (expected, received) => `Mong đợi ${expected}, nhận được ${received}`,
|
|
56
|
-
// Enum validation messages
|
|
57
|
-
enumExpected: (values, received) => `Mong đợi một trong [${values.join(', ')}], nhận được ${received}`,
|
|
58
|
-
// Special type validation messages
|
|
59
|
-
expectedUndefined: 'Mong đợi undefined',
|
|
60
|
-
neverType: 'Không thể phân tích kiểu never',
|
|
61
|
-
// New advanced type validation messages
|
|
62
|
-
invalidBigint: 'Bigint không hợp lệ',
|
|
63
|
-
invalidSymbol: 'Ký hiệu không hợp lệ',
|
|
64
|
-
invalidTuple: 'Tuple không hợp lệ',
|
|
65
|
-
tupleLength: (expected, received) => `Tuple phải có chính xác ${expected} phần tử, nhận được ${received}`,
|
|
66
|
-
invalidRecord: 'Record không hợp lệ',
|
|
67
|
-
invalidSet: 'Set không hợp lệ',
|
|
68
|
-
invalidMap: 'Map không hợp lệ',
|
|
69
|
-
// Transformation and refinement messages
|
|
70
|
-
transformError: (error) => `Biến đổi thất bại: ${error}`,
|
|
71
|
-
refinementError: (error) => `Tinh chế thất bại: ${error}`,
|
|
72
|
-
customValidationError: (error) => `Xác thực tùy chỉnh thất bại: ${error}`,
|
|
73
|
-
// Coercion messages
|
|
74
|
-
coercionFailed: (type, value) => `Không thể ép kiểu ${JSON.stringify(value)} thành ${type}`,
|
|
75
|
-
// Codec messages
|
|
76
|
-
codecDecodeFailed: 'Failed to decode value',
|
|
77
|
-
codecEncodeFailed: 'Failed to encode value',
|
|
78
|
-
codecAsyncNotSupported: 'Async codec operations require using parseAsync/encodeAsync methods',
|
|
79
|
-
// Base64/Hex messages
|
|
80
|
-
invalidBase64: 'Invalid base64 string',
|
|
81
|
-
invalidHex: 'Invalid hexadecimal string',
|
|
82
|
-
// Uint8Array messages
|
|
83
|
-
expectedUint8Array: 'Expected Uint8Array',
|
|
84
|
-
uint8ArrayMinLength: (min) => `Uint8Array must have at least ${min} bytes`,
|
|
85
|
-
uint8ArrayMaxLength: (max) => `Uint8Array must have at most ${max} bytes`,
|
|
86
|
-
uint8ArrayExactLength: (length) => `Uint8Array must have exactly ${length} bytes`,
|
|
87
|
-
// Generic type error messages
|
|
88
|
-
expectedString: 'Expected string',
|
|
89
|
-
stringExpected: (received, expected) => `Mong đợi ${expected}, nhận được ${received}`,
|
|
90
|
-
stringBoolExpected: (validValues, received) => `Chuỗi boolean không hợp lệ. Mong đợi một trong các: ${validValues}, nhận được: "${received}"`,
|
|
91
|
-
invalidJson: 'JSON không hợp lệ',
|
|
92
|
-
stringPatternInvalid: 'Chuỗi không khớp với mẫu bắt buộc',
|
|
93
|
-
// File validation messages
|
|
94
|
-
invalidFile: 'Expected a File object',
|
|
95
|
-
fileNotSupported: 'File API not supported in this environment',
|
|
96
|
-
fileMinSize: (min) => `File size must be at least ${min} bytes`,
|
|
97
|
-
fileMaxSize: (max) => `File size must not exceed ${max} bytes`,
|
|
98
|
-
fileMimeType: (allowed) => `Invalid file type. Expected: ${allowed.join(", ")}`,
|
|
99
|
-
// Function validation messages
|
|
100
|
-
invalidFunction: 'Mong đợi một hàm',
|
|
101
|
-
// CIDR validation messages
|
|
102
|
-
stringCidrv4: 'Khối CIDR IPv4 không hợp lệ',
|
|
103
|
-
stringCidrv6: 'Khối CIDR IPv6 không hợp lệ',
|
|
104
|
-
// Safe extend validation messages
|
|
105
|
-
safeExtendOverlap: (keys) => `Không thể ghi đè các khóa hiện có: ${keys.join(', ')}. Sử dụng extend() để ghi đè.`
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
exports.vi = vi;
|
|
1
|
+
"use strict";const n={invalidString:"Chuỗi không hợp lệ",stringMin:n=>`Chuỗi phải có ít nhất ${n} ký tự`,stringMax:n=>`Chuỗi không được quá ${n} ký tự`,stringLength:n=>`Chuỗi phải có chính xác ${n} ký tự`,stringEmail:"Địa chỉ email không hợp lệ",stringUrl:"URL không hợp lệ",stringUuid:"UUID không hợp lệ",stringRegex:"Định dạng không hợp lệ",stringStartsWith:n=>`Chuỗi phải bắt đầu bằng "${n}"`,stringEndsWith:n=>`Chuỗi phải kết thúc bằng "${n}"`,stringIncludes:n=>`Chuỗi phải chứa "${n}"`,stringIp:"Địa chỉ IP không hợp lệ",stringIpv4:"Địa chỉ IPv4 không hợp lệ",stringIpv6:"Địa chỉ IPv6 không hợp lệ",stringEmpty:"Chuỗi không được để trống",invalidNumber:"Số không hợp lệ",numberMin:n=>`Số phải ít nhất là ${n}`,numberMax:n=>`Số không được vượt quá ${n}`,numberInt:"Số phải là số nguyên",numberPositive:"Số phải là số dương",numberNegative:"Số phải là số âm",numberNonnegative:"Số không được là số âm",numberNonpositive:"Số không được là số dương",numberFinite:"Số phải là số hữu hạn",numberSafe:"Số phải là số nguyên an toàn",numberMultipleOf:n=>`Số phải là bội số của ${n}`,invalidBoolean:"Giá trị boolean không hợp lệ",invalidDate:"Ngày không hợp lệ",dateMin:n=>`Ngày phải sau ${n.toISOString()}`,dateMax:n=>`Ngày phải trước ${n.toISOString()}`,invalidObject:"Đối tượng không hợp lệ",unexpectedKeys:n=>`Khóa không mong muốn: ${n.join(", ")}`,invalidArray:"Mảng không hợp lệ",arrayMin:n=>`Mảng phải có ít nhất ${n} phần tử`,arrayMax:n=>`Mảng không được quá ${n} phần tử`,arrayLength:n=>`Mảng phải có chính xác ${n} phần tử`,arrayEmpty:"Mảng không được để trống",arrayItem:(n,i)=>`Phần tử không hợp lệ tại vị trí ${n}: ${i}`,objectField:(n,i)=>`Trường "${n}" không hợp lệ: ${i}`,unionNoMatch:n=>`Không có thành viên union nào khớp: ${n.join(", ")}`,intersectionError:n=>`Xác thực intersection thất bại: ${n}`,literalExpected:(n,i)=>`Mong đợi ${n}, nhận được ${i}`,enumExpected:(n,i)=>`Mong đợi một trong [${n.join(", ")}], nhận được ${i}`,expectedUndefined:"Mong đợi undefined",neverType:"Không thể phân tích kiểu never",invalidBigint:"Bigint không hợp lệ",invalidSymbol:"Ký hiệu không hợp lệ",invalidTuple:"Tuple không hợp lệ",tupleLength:(n,i)=>`Tuple phải có chính xác ${n} phần tử, nhận được ${i}`,invalidRecord:"Record không hợp lệ",invalidSet:"Set không hợp lệ",invalidMap:"Map không hợp lệ",transformError:n=>`Biến đổi thất bại: ${n}`,refinementError:n=>`Tinh chế thất bại: ${n}`,customValidationError:n=>`Xác thực tùy chỉnh thất bại: ${n}`,coercionFailed:(n,i)=>`Không thể ép kiểu ${JSON.stringify(i)} thành ${n}`,codecDecodeFailed:"Failed to decode value",codecEncodeFailed:"Failed to encode value",codecAsyncNotSupported:"Async codec operations require using parseAsync/encodeAsync methods",invalidBase64:"Invalid base64 string",invalidHex:"Invalid hexadecimal string",expectedUint8Array:"Expected Uint8Array",uint8ArrayMinLength:n=>`Uint8Array must have at least ${n} bytes`,uint8ArrayMaxLength:n=>`Uint8Array must have at most ${n} bytes`,uint8ArrayExactLength:n=>`Uint8Array must have exactly ${n} bytes`,expectedString:"Expected string",stringExpected:(n,i)=>`Mong đợi ${i}, nhận được ${n}`,stringBoolExpected:(n,i)=>`Chuỗi boolean không hợp lệ. Mong đợi một trong các: ${n}, nhận được: "${i}"`,invalidJson:"JSON không hợp lệ",stringPatternInvalid:"Chuỗi không khớp với mẫu bắt buộc",invalidFile:"Expected a File object",fileNotSupported:"File API not supported in this environment",fileMinSize:n=>`File size must be at least ${n} bytes`,fileMaxSize:n=>`File size must not exceed ${n} bytes`,fileMimeType:n=>`Invalid file type. Expected: ${n.join(", ")}`,invalidFunction:"Mong đợi một hàm",stringCidrv4:"Khối CIDR IPv4 không hợp lệ",stringCidrv6:"Khối CIDR IPv6 không hợp lệ",safeExtendOverlap:n=>`Không thể ghi đè các khóa hiện có: ${n.join(", ")}. Sử dụng extend() để ghi đè.`};exports.vi=n;
|
package/dist/cjs/locales/zh.cjs
CHANGED
|
@@ -1,108 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const zh = {
|
|
4
|
-
// String validation messages
|
|
5
|
-
invalidString: '无效字符串',
|
|
6
|
-
stringMin: (min) => `字符串必须至少${min}个字符`,
|
|
7
|
-
stringMax: (max) => `字符串不能超过${max}个字符`,
|
|
8
|
-
stringLength: (length) => `字符串必须正好${length}个字符`,
|
|
9
|
-
stringEmail: '无效邮箱地址',
|
|
10
|
-
stringUrl: '无效URL',
|
|
11
|
-
stringUuid: '无效UUID',
|
|
12
|
-
stringRegex: '无效格式',
|
|
13
|
-
stringStartsWith: (prefix) => `字符串必须以"${prefix}"开头`,
|
|
14
|
-
stringEndsWith: (suffix) => `字符串必须以"${suffix}"结尾`,
|
|
15
|
-
stringIncludes: (substring) => `字符串必须包含"${substring}"`,
|
|
16
|
-
stringIp: '无效IP地址',
|
|
17
|
-
stringIpv4: '无效IPv4地址',
|
|
18
|
-
stringIpv6: '无效IPv6地址',
|
|
19
|
-
stringEmpty: '字符串不能为空',
|
|
20
|
-
// Number validation messages
|
|
21
|
-
invalidNumber: '无效数字',
|
|
22
|
-
numberMin: (min) => `数字必须至少为${min}`,
|
|
23
|
-
numberMax: (max) => `数字不能大于${max}`,
|
|
24
|
-
numberInt: '数字必须是整数',
|
|
25
|
-
numberPositive: '数字必须是正数',
|
|
26
|
-
numberNegative: '数字必须是负数',
|
|
27
|
-
numberNonnegative: '数字不能是负数',
|
|
28
|
-
numberNonpositive: '数字不能是正数',
|
|
29
|
-
numberFinite: '数字必须是有限的',
|
|
30
|
-
numberSafe: '数字必须是安全整数',
|
|
31
|
-
numberMultipleOf: (value) => `数字必须是${value}的倍数`,
|
|
32
|
-
// Boolean validation messages
|
|
33
|
-
invalidBoolean: '无效布尔值',
|
|
34
|
-
// Date validation messages
|
|
35
|
-
invalidDate: '无效日期',
|
|
36
|
-
dateMin: (date) => `日期必须在${date.toISOString()}之后`,
|
|
37
|
-
dateMax: (date) => `日期必须在${date.toISOString()}之前`,
|
|
38
|
-
// Object validation messages
|
|
39
|
-
invalidObject: '无效对象',
|
|
40
|
-
unexpectedKeys: (keys) => `意外的键: ${keys.join(', ')}`,
|
|
41
|
-
// Array validation messages
|
|
42
|
-
invalidArray: '无效数组',
|
|
43
|
-
arrayMin: (min) => `数组必须至少有${min}个元素`,
|
|
44
|
-
arrayMax: (max) => `数组不能超过${max}个元素`,
|
|
45
|
-
arrayLength: (length) => `数组必须正好有${length}个元素`,
|
|
46
|
-
arrayEmpty: '数组不能为空',
|
|
47
|
-
arrayItem: (index, error) => `索引${index}处的无效元素: ${error}`,
|
|
48
|
-
// Object field validation
|
|
49
|
-
objectField: (field, error) => `无效字段"${field}": ${error}`,
|
|
50
|
-
// Union validation messages
|
|
51
|
-
unionNoMatch: (errors) => `没有匹配的联合成员: ${errors.join(', ')}`,
|
|
52
|
-
// Intersection validation messages
|
|
53
|
-
intersectionError: (error) => `交集验证失败: ${error}`,
|
|
54
|
-
// Literal validation messages
|
|
55
|
-
literalExpected: (expected, received) => `期望${expected},得到${received}`,
|
|
56
|
-
// Enum validation messages
|
|
57
|
-
enumExpected: (values, received) => `期望[${values.join(', ')}]中的一个,得到${received}`,
|
|
58
|
-
// Special type validation messages
|
|
59
|
-
expectedUndefined: '期望undefined',
|
|
60
|
-
neverType: 'never类型无法解析',
|
|
61
|
-
// New advanced type validation messages
|
|
62
|
-
invalidBigint: '无效bigint',
|
|
63
|
-
invalidSymbol: '无效符号',
|
|
64
|
-
invalidTuple: '无效元组',
|
|
65
|
-
tupleLength: (expected, received) => `元组必须正好有${expected}个元素,得到${received}个`,
|
|
66
|
-
invalidRecord: '无效记录',
|
|
67
|
-
invalidSet: '无效Set',
|
|
68
|
-
invalidMap: '无效Map',
|
|
69
|
-
// Transformation and refinement messages
|
|
70
|
-
transformError: (error) => `转换失败: ${error}`,
|
|
71
|
-
refinementError: (error) => `细化失败: ${error}`,
|
|
72
|
-
customValidationError: (error) => `自定义验证失败: ${error}`,
|
|
73
|
-
// Coercion messages
|
|
74
|
-
coercionFailed: (type, value) => `无法将${JSON.stringify(value)}强制转换为${type}`,
|
|
75
|
-
// Codec messages
|
|
76
|
-
codecDecodeFailed: 'Failed to decode value',
|
|
77
|
-
codecEncodeFailed: 'Failed to encode value',
|
|
78
|
-
codecAsyncNotSupported: 'Async codec operations require using parseAsync/encodeAsync methods',
|
|
79
|
-
// Base64/Hex messages
|
|
80
|
-
invalidBase64: 'Invalid base64 string',
|
|
81
|
-
invalidHex: 'Invalid hexadecimal string',
|
|
82
|
-
// Uint8Array messages
|
|
83
|
-
expectedUint8Array: 'Expected Uint8Array',
|
|
84
|
-
uint8ArrayMinLength: (min) => `Uint8Array must have at least ${min} bytes`,
|
|
85
|
-
uint8ArrayMaxLength: (max) => `Uint8Array must have at most ${max} bytes`,
|
|
86
|
-
uint8ArrayExactLength: (length) => `Uint8Array must have exactly ${length} bytes`,
|
|
87
|
-
// Generic type error messages
|
|
88
|
-
expectedString: 'Expected string',
|
|
89
|
-
stringExpected: (received, expected) => `期望${expected},得到${received}`,
|
|
90
|
-
stringBoolExpected: (validValues, received) => `无效的布尔字符串。期望以下之一: ${validValues},得到: "${received}"`,
|
|
91
|
-
invalidJson: '无效的JSON',
|
|
92
|
-
stringPatternInvalid: '字符串与所需模式不匹配',
|
|
93
|
-
// File validation messages
|
|
94
|
-
invalidFile: 'Expected a File object',
|
|
95
|
-
fileNotSupported: 'File API not supported in this environment',
|
|
96
|
-
fileMinSize: (min) => `File size must be at least ${min} bytes`,
|
|
97
|
-
fileMaxSize: (max) => `File size must not exceed ${max} bytes`,
|
|
98
|
-
fileMimeType: (allowed) => `Invalid file type. Expected: ${allowed.join(", ")}`,
|
|
99
|
-
// Function validation messages
|
|
100
|
-
invalidFunction: '期望一个函数',
|
|
101
|
-
// CIDR validation messages
|
|
102
|
-
stringCidrv4: '无效的IPv4 CIDR块',
|
|
103
|
-
stringCidrv6: '无效的IPv6 CIDR块',
|
|
104
|
-
// Safe extend validation messages
|
|
105
|
-
safeExtendOverlap: (keys) => `无法覆盖现有键: ${keys.join(', ')}。如果要覆盖请使用extend()。`
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
exports.zh = zh;
|
|
1
|
+
"use strict";const e={invalidString:"无效字符串",stringMin:e=>`字符串必须至少${e}个字符`,stringMax:e=>`字符串不能超过${e}个字符`,stringLength:e=>`字符串必须正好${e}个字符`,stringEmail:"无效邮箱地址",stringUrl:"无效URL",stringUuid:"无效UUID",stringRegex:"无效格式",stringStartsWith:e=>`字符串必须以"${e}"开头`,stringEndsWith:e=>`字符串必须以"${e}"结尾`,stringIncludes:e=>`字符串必须包含"${e}"`,stringIp:"无效IP地址",stringIpv4:"无效IPv4地址",stringIpv6:"无效IPv6地址",stringEmpty:"字符串不能为空",invalidNumber:"无效数字",numberMin:e=>`数字必须至少为${e}`,numberMax:e=>`数字不能大于${e}`,numberInt:"数字必须是整数",numberPositive:"数字必须是正数",numberNegative:"数字必须是负数",numberNonnegative:"数字不能是负数",numberNonpositive:"数字不能是正数",numberFinite:"数字必须是有限的",numberSafe:"数字必须是安全整数",numberMultipleOf:e=>`数字必须是${e}的倍数`,invalidBoolean:"无效布尔值",invalidDate:"无效日期",dateMin:e=>`日期必须在${e.toISOString()}之后`,dateMax:e=>`日期必须在${e.toISOString()}之前`,invalidObject:"无效对象",unexpectedKeys:e=>`意外的键: ${e.join(", ")}`,invalidArray:"无效数组",arrayMin:e=>`数组必须至少有${e}个元素`,arrayMax:e=>`数组不能超过${e}个元素`,arrayLength:e=>`数组必须正好有${e}个元素`,arrayEmpty:"数组不能为空",arrayItem:(e,i)=>`索引${e}处的无效元素: ${i}`,objectField:(e,i)=>`无效字段"${e}": ${i}`,unionNoMatch:e=>`没有匹配的联合成员: ${e.join(", ")}`,intersectionError:e=>`交集验证失败: ${e}`,literalExpected:(e,i)=>`期望${e},得到${i}`,enumExpected:(e,i)=>`期望[${e.join(", ")}]中的一个,得到${i}`,expectedUndefined:"期望undefined",neverType:"never类型无法解析",invalidBigint:"无效bigint",invalidSymbol:"无效符号",invalidTuple:"无效元组",tupleLength:(e,i)=>`元组必须正好有${e}个元素,得到${i}个`,invalidRecord:"无效记录",invalidSet:"无效Set",invalidMap:"无效Map",transformError:e=>`转换失败: ${e}`,refinementError:e=>`细化失败: ${e}`,customValidationError:e=>`自定义验证失败: ${e}`,coercionFailed:(e,i)=>`无法将${JSON.stringify(i)}强制转换为${e}`,codecDecodeFailed:"Failed to decode value",codecEncodeFailed:"Failed to encode value",codecAsyncNotSupported:"Async codec operations require using parseAsync/encodeAsync methods",invalidBase64:"Invalid base64 string",invalidHex:"Invalid hexadecimal string",expectedUint8Array:"Expected Uint8Array",uint8ArrayMinLength:e=>`Uint8Array must have at least ${e} bytes`,uint8ArrayMaxLength:e=>`Uint8Array must have at most ${e} bytes`,uint8ArrayExactLength:e=>`Uint8Array must have exactly ${e} bytes`,expectedString:"Expected string",stringExpected:(e,i)=>`期望${i},得到${e}`,stringBoolExpected:(e,i)=>`无效的布尔字符串。期望以下之一: ${e},得到: "${i}"`,invalidJson:"无效的JSON",stringPatternInvalid:"字符串与所需模式不匹配",invalidFile:"Expected a File object",fileNotSupported:"File API not supported in this environment",fileMinSize:e=>`File size must be at least ${e} bytes`,fileMaxSize:e=>`File size must not exceed ${e} bytes`,fileMimeType:e=>`Invalid file type. Expected: ${e.join(", ")}`,invalidFunction:"期望一个函数",stringCidrv4:"无效的IPv4 CIDR块",stringCidrv6:"无效的IPv6 CIDR块",safeExtendOverlap:e=>`无法覆盖现有键: ${e.join(", ")}。如果要覆盖请使用extend()。`};exports.zh=e;
|
package/dist/cjs/mini.cjs
CHANGED
|
@@ -1,242 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var validators_base = require('./validators/base.cjs');
|
|
4
|
-
var validators_string = require('./chunks/string-BKZrc4hs.cjs');
|
|
5
|
-
var validators_number = require('./validators/number.cjs');
|
|
6
|
-
var validators_boolean = require('./validators/boolean.cjs');
|
|
7
|
-
var validators_date = require('./validators/date.cjs');
|
|
8
|
-
var validators_bigint = require('./validators/bigint.cjs');
|
|
9
|
-
var validators_symbol = require('./validators/symbol.cjs');
|
|
10
|
-
var validators_stringBool = require('./validators/string-bool.cjs');
|
|
11
|
-
var validators_array = require('./validators/array.cjs');
|
|
12
|
-
var validators_object = require('./validators/object.cjs');
|
|
13
|
-
var validators_tuple = require('./validators/tuple.cjs');
|
|
14
|
-
var validators_record = require('./validators/record.cjs');
|
|
15
|
-
var validators_set = require('./validators/set.cjs');
|
|
16
|
-
var validators_map = require('./validators/map.cjs');
|
|
17
|
-
var validators_union = require('./validators/union.cjs');
|
|
18
|
-
var validators_intersection = require('./validators/intersection.cjs');
|
|
19
|
-
var validators_literal = require('./validators/literal.cjs');
|
|
20
|
-
var validators_enum = require('./validators/enum.cjs');
|
|
21
|
-
var validators_any = require('./validators/any.cjs');
|
|
22
|
-
var validators_unknown = require('./validators/unknown.cjs');
|
|
23
|
-
var validators_void = require('./validators/void.cjs');
|
|
24
|
-
var validators_never = require('./validators/never.cjs');
|
|
25
|
-
var validators_null = require('./validators/null.cjs');
|
|
26
|
-
var validators_undefined = require('./validators/undefined.cjs');
|
|
27
|
-
var validators_nan = require('./validators/nan.cjs');
|
|
28
|
-
var validators_lazy = require('./validators/lazy.cjs');
|
|
29
|
-
var validators_discriminatedUnion = require('./validators/discriminated-union.cjs');
|
|
30
|
-
var validators_xor = require('./validators/xor.cjs');
|
|
31
|
-
var validators_json = require('./validators/json.cjs');
|
|
32
|
-
var coercion_index = require('./coercion/index.cjs');
|
|
33
|
-
require('./registry.cjs');
|
|
34
|
-
require('./locales/runtime.cjs');
|
|
35
|
-
require('./locales/en.cjs');
|
|
36
|
-
require('./chunks/errors-core-DWxLFs2f.cjs');
|
|
37
|
-
require('./chunks/security-Dc3Jh13T.cjs');
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* VLD Mini - Tree-Shakable Functional API
|
|
41
|
-
*
|
|
42
|
-
* This module provides a functional, tree-shakable alternative to the main `v` object.
|
|
43
|
-
* Use this when bundle size is critical.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* import { string, number, object, optional } from '@oxog/vld/mini';
|
|
48
|
-
*
|
|
49
|
-
* const schema = object({
|
|
50
|
-
* name: string().min(1),
|
|
51
|
-
* age: optional(number().int())
|
|
52
|
-
* });
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
// ============================================
|
|
56
|
-
// Base Types & Classes
|
|
57
|
-
// ============================================
|
|
58
|
-
// --- Primitive Validators ---
|
|
59
|
-
/** Create a string validator */
|
|
60
|
-
const string = () => validators_string.VldString.create();
|
|
61
|
-
/** Create a number validator */
|
|
62
|
-
const number = () => validators_number.VldNumber.create();
|
|
63
|
-
/** Create an integer validator */
|
|
64
|
-
const int = () => validators_number.VldNumber.create().int();
|
|
65
|
-
/** Create an int32 validator (-2147483648 to 2147483647) */
|
|
66
|
-
const int32 = () => validators_number.VldNumber.create().int().min(-2147483648).max(2147483647);
|
|
67
|
-
/** Create a boolean validator */
|
|
68
|
-
const boolean = () => validators_boolean.VldBoolean.create();
|
|
69
|
-
/** Create a date validator */
|
|
70
|
-
const date = () => validators_date.VldDate.create();
|
|
71
|
-
/** Create a bigint validator */
|
|
72
|
-
const bigint = () => validators_bigint.VldBigInt.create();
|
|
73
|
-
/** Create a symbol validator */
|
|
74
|
-
const symbol = () => validators_symbol.VldSymbol.create();
|
|
75
|
-
/** Create a string-to-boolean validator */
|
|
76
|
-
const stringbool = (options) => validators_stringBool.VldStringBool.create(options);
|
|
77
|
-
// --- Complex Validators ---
|
|
78
|
-
/** Create an array validator */
|
|
79
|
-
const array = (item) => validators_array.VldArray.create(item);
|
|
80
|
-
/** Create an object validator */
|
|
81
|
-
const object = (shape) => validators_object.VldObject.create(shape);
|
|
82
|
-
/** Create a strict object validator (no extra keys allowed) */
|
|
83
|
-
const strictObject = (shape) => validators_object.VldObject.create(shape).strict();
|
|
84
|
-
/** Create a loose object validator (extra keys passed through) */
|
|
85
|
-
const looseObject = (shape) => validators_object.VldObject.create(shape).passthrough();
|
|
86
|
-
/** Create a tuple validator */
|
|
87
|
-
const tuple = (...items) => validators_tuple.VldTuple.create(...items);
|
|
88
|
-
/** Create a record validator */
|
|
89
|
-
const record = (value) => validators_record.VldRecord.create(value);
|
|
90
|
-
/** Create a partial record validator */
|
|
91
|
-
const partialRecord = (value) => validators_record.VldRecord.create(value).partial();
|
|
92
|
-
/** Create a loose record validator */
|
|
93
|
-
const looseRecord = (value) => validators_record.VldRecord.create(value).loose();
|
|
94
|
-
/** Create a set validator */
|
|
95
|
-
const set = (item) => validators_set.VldSet.create(item);
|
|
96
|
-
/** Create a map validator */
|
|
97
|
-
const map = (key, value) => validators_map.VldMap.create(key, value);
|
|
98
|
-
// --- Union & Intersection ---
|
|
99
|
-
/** Create a union validator (value must match one of the validators) */
|
|
100
|
-
const union = (...validators) => validators_union.VldUnion.create(...validators);
|
|
101
|
-
/** Create an intersection validator (value must match both validators) */
|
|
102
|
-
const intersection = (first, second) => validators_intersection.VldIntersection.create(first, second);
|
|
103
|
-
/** Create a discriminated union validator */
|
|
104
|
-
const discriminatedUnion = (discriminator, ...options) => validators_discriminatedUnion.VldDiscriminatedUnion.create(discriminator, [...options]);
|
|
105
|
-
/** Create an XOR validator (value must match exactly one of the validators) */
|
|
106
|
-
const xor = (...options) => validators_xor.VldXor.create([...options]);
|
|
107
|
-
// --- Literal & Enum ---
|
|
108
|
-
/** Create a literal validator */
|
|
109
|
-
const literal = (value) => validators_literal.VldLiteral.create(value);
|
|
110
|
-
/** Create an enum validator */
|
|
111
|
-
const enumValidator = (...values) => validators_enum.VldEnum.create(values);
|
|
112
|
-
// --- Special Validators ---
|
|
113
|
-
/** Create a validator that accepts any value */
|
|
114
|
-
const any = () => validators_any.VldAny.create();
|
|
115
|
-
/** Create a validator that accepts unknown values */
|
|
116
|
-
const unknown = () => validators_unknown.VldUnknown.create();
|
|
117
|
-
/** Create a void validator */
|
|
118
|
-
const voidValidator = () => validators_void.VldVoid.create();
|
|
119
|
-
/** Create a never validator (always fails) */
|
|
120
|
-
const never = () => validators_never.VldNever.create();
|
|
121
|
-
/** Create a null validator */
|
|
122
|
-
const nullValidator = () => validators_null.VldNull.create();
|
|
123
|
-
/** Create an undefined validator */
|
|
124
|
-
const undefinedValidator = () => validators_undefined.VldUndefined.create();
|
|
125
|
-
/** Create a NaN validator */
|
|
126
|
-
const nan = () => validators_nan.VldNan.create();
|
|
127
|
-
// --- Utility Validators ---
|
|
128
|
-
/** Create a lazy validator for recursive schemas */
|
|
129
|
-
const lazy = (schemaGetter) => validators_lazy.VldLazy.create(schemaGetter);
|
|
130
|
-
/** Create a JSON validator */
|
|
131
|
-
const json = (schema) => validators_json.VldJson.create(schema);
|
|
132
|
-
// ============================================
|
|
133
|
-
// Utility Functions (Wrappers)
|
|
134
|
-
// ============================================
|
|
135
|
-
/** Make a validator optional (allows undefined) */
|
|
136
|
-
const optional = (validator) => validators_base.VldOptional.create(validator);
|
|
137
|
-
/** Make a validator nullable (allows null) */
|
|
138
|
-
const nullable = (validator) => validators_base.VldNullable.create(validator);
|
|
139
|
-
/** Make a validator nullish (allows null or undefined) */
|
|
140
|
-
const nullish = (validator) => validators_base.VldNullish.create(validator);
|
|
141
|
-
/** Preprocess input before validation */
|
|
142
|
-
const preprocess = (preprocessor, schema) => validators_base.VldPreprocess.create(preprocessor, schema);
|
|
143
|
-
/** Coercion validators - convert values to target type before validation */
|
|
144
|
-
const coerce = {
|
|
145
|
-
/** Coerce to string */
|
|
146
|
-
string: () => coercion_index.VldCoerceString.create(),
|
|
147
|
-
/** Coerce to number */
|
|
148
|
-
number: () => coercion_index.VldCoerceNumber.create(),
|
|
149
|
-
/** Coerce to boolean */
|
|
150
|
-
boolean: () => coercion_index.VldCoerceBoolean.create(),
|
|
151
|
-
/** Coerce to date */
|
|
152
|
-
date: () => coercion_index.VldCoerceDate.create(),
|
|
153
|
-
/** Coerce to bigint */
|
|
154
|
-
bigint: () => coercion_index.VldCoerceBigInt.create(),
|
|
155
|
-
};
|
|
156
|
-
// ============================================
|
|
157
|
-
// NEVER Constant (for transforms)
|
|
158
|
-
// ============================================
|
|
159
|
-
/** NEVER constant for use in transforms - Zod 4 API parity */
|
|
160
|
-
const NEVER = validators_never.VldNever.create();
|
|
161
|
-
|
|
162
|
-
exports.VldBase = validators_base.VldBase;
|
|
163
|
-
exports.VldBrand = validators_base.VldBrand;
|
|
164
|
-
exports.VldCatch = validators_base.VldCatch;
|
|
165
|
-
exports.VldDefault = validators_base.VldDefault;
|
|
166
|
-
exports.VldNullable = validators_base.VldNullable;
|
|
167
|
-
exports.VldNullish = validators_base.VldNullish;
|
|
168
|
-
exports.VldOptional = validators_base.VldOptional;
|
|
169
|
-
exports.VldPipe = validators_base.VldPipe;
|
|
170
|
-
exports.VldPreprocess = validators_base.VldPreprocess;
|
|
171
|
-
exports.VldReadonly = validators_base.VldReadonly;
|
|
172
|
-
exports.VldRefine = validators_base.VldRefine;
|
|
173
|
-
exports.VldSuperRefine = validators_base.VldSuperRefine;
|
|
174
|
-
exports.VldTransform = validators_base.VldTransform;
|
|
175
|
-
exports.VldString = validators_string.VldString;
|
|
176
|
-
exports.VldNumber = validators_number.VldNumber;
|
|
177
|
-
exports.VldBoolean = validators_boolean.VldBoolean;
|
|
178
|
-
exports.VldDate = validators_date.VldDate;
|
|
179
|
-
exports.VldBigInt = validators_bigint.VldBigInt;
|
|
180
|
-
exports.VldSymbol = validators_symbol.VldSymbol;
|
|
181
|
-
exports.VldStringBool = validators_stringBool.VldStringBool;
|
|
182
|
-
exports.VldArray = validators_array.VldArray;
|
|
183
|
-
exports.VldObject = validators_object.VldObject;
|
|
184
|
-
exports.VldTuple = validators_tuple.VldTuple;
|
|
185
|
-
exports.VldRecord = validators_record.VldRecord;
|
|
186
|
-
exports.VldSet = validators_set.VldSet;
|
|
187
|
-
exports.VldMap = validators_map.VldMap;
|
|
188
|
-
exports.VldUnion = validators_union.VldUnion;
|
|
189
|
-
exports.VldIntersection = validators_intersection.VldIntersection;
|
|
190
|
-
exports.VldLiteral = validators_literal.VldLiteral;
|
|
191
|
-
exports.VldEnum = validators_enum.VldEnum;
|
|
192
|
-
exports.VldAny = validators_any.VldAny;
|
|
193
|
-
exports.VldUnknown = validators_unknown.VldUnknown;
|
|
194
|
-
exports.VldVoid = validators_void.VldVoid;
|
|
195
|
-
exports.VldNever = validators_never.VldNever;
|
|
196
|
-
exports.VldNull = validators_null.VldNull;
|
|
197
|
-
exports.VldUndefined = validators_undefined.VldUndefined;
|
|
198
|
-
exports.VldNan = validators_nan.VldNan;
|
|
199
|
-
exports.VldLazy = validators_lazy.VldLazy;
|
|
200
|
-
exports.VldDiscriminatedUnion = validators_discriminatedUnion.VldDiscriminatedUnion;
|
|
201
|
-
exports.VldXor = validators_xor.VldXor;
|
|
202
|
-
exports.VldJson = validators_json.VldJson;
|
|
203
|
-
exports.NEVER = NEVER;
|
|
204
|
-
exports.any = any;
|
|
205
|
-
exports.array = array;
|
|
206
|
-
exports.bigint = bigint;
|
|
207
|
-
exports.boolean = boolean;
|
|
208
|
-
exports.coerce = coerce;
|
|
209
|
-
exports.date = date;
|
|
210
|
-
exports.discriminatedUnion = discriminatedUnion;
|
|
211
|
-
exports.enumValidator = enumValidator;
|
|
212
|
-
exports.int = int;
|
|
213
|
-
exports.int32 = int32;
|
|
214
|
-
exports.intersection = intersection;
|
|
215
|
-
exports.json = json;
|
|
216
|
-
exports.lazy = lazy;
|
|
217
|
-
exports.literal = literal;
|
|
218
|
-
exports.looseObject = looseObject;
|
|
219
|
-
exports.looseRecord = looseRecord;
|
|
220
|
-
exports.map = map;
|
|
221
|
-
exports.nan = nan;
|
|
222
|
-
exports.never = never;
|
|
223
|
-
exports.nullValidator = nullValidator;
|
|
224
|
-
exports.nullable = nullable;
|
|
225
|
-
exports.nullish = nullish;
|
|
226
|
-
exports.number = number;
|
|
227
|
-
exports.object = object;
|
|
228
|
-
exports.optional = optional;
|
|
229
|
-
exports.partialRecord = partialRecord;
|
|
230
|
-
exports.preprocess = preprocess;
|
|
231
|
-
exports.record = record;
|
|
232
|
-
exports.set = set;
|
|
233
|
-
exports.strictObject = strictObject;
|
|
234
|
-
exports.string = string;
|
|
235
|
-
exports.stringbool = stringbool;
|
|
236
|
-
exports.symbol = symbol;
|
|
237
|
-
exports.tuple = tuple;
|
|
238
|
-
exports.undefinedValidator = undefinedValidator;
|
|
239
|
-
exports.union = union;
|
|
240
|
-
exports.unknown = unknown;
|
|
241
|
-
exports.voidValidator = voidValidator;
|
|
242
|
-
exports.xor = xor;
|
|
1
|
+
"use strict";var e=require("./validators/base.cjs"),r=require("./validators/string.cjs"),t=require("./validators/number.cjs"),l=require("./validators/boolean.cjs"),o=require("./validators/date.cjs"),s=require("./validators/bigint.cjs"),d=require("./validators/symbol.cjs"),a=require("./validators/string-bool.cjs"),i=require("./validators/array.cjs"),n=require("./validators/object.cjs"),c=require("./validators/tuple.cjs"),V=require("./validators/record.cjs"),p=require("./validators/set.cjs"),u=require("./validators/map.cjs"),x=require("./validators/union.cjs"),j=require("./validators/intersection.cjs"),v=require("./validators/literal.cjs"),b=require("./validators/enum.cjs"),q=require("./validators/any.cjs"),m=require("./validators/unknown.cjs"),y=require("./validators/void.cjs"),N=require("./validators/never.cjs"),g=require("./validators/null.cjs"),B=require("./validators/undefined.cjs"),S=require("./validators/nan.cjs"),R=require("./validators/lazy.cjs"),f=require("./validators/discriminated-union.cjs"),U=require("./validators/xor.cjs"),h=require("./validators/json.cjs"),O=require("./coercion/index.cjs");require("./registry.cjs"),require("./locales/runtime.cjs"),require("./locales/en.cjs"),require("./chunks/ip-validation-BZqPamPC.cjs"),require("./chunks/errors-core-DKPohm9I.cjs"),require("./chunks/security-aXZVI7qW.cjs");const D={string:()=>O.VldCoerceString.create(),number:()=>O.VldCoerceNumber.create(),boolean:()=>O.VldCoerceBoolean.create(),date:()=>O.VldCoerceDate.create(),bigint:()=>O.VldCoerceBigInt.create()},k=N.VldNever.create();exports.VldBase=e.VldBase,exports.VldBrand=e.VldBrand,exports.VldCatch=e.VldCatch,exports.VldDefault=e.VldDefault,exports.VldNullable=e.VldNullable,exports.VldNullish=e.VldNullish,exports.VldOptional=e.VldOptional,exports.VldPipe=e.VldPipe,exports.VldPreprocess=e.VldPreprocess,exports.VldReadonly=e.VldReadonly,exports.VldRefine=e.VldRefine,exports.VldSuperRefine=e.VldSuperRefine,exports.VldTransform=e.VldTransform,exports.VldString=r.VldString,exports.VldNumber=t.VldNumber,exports.VldBoolean=l.VldBoolean,exports.VldDate=o.VldDate,exports.VldBigInt=s.VldBigInt,exports.VldSymbol=d.VldSymbol,exports.VldStringBool=a.VldStringBool,exports.VldArray=i.VldArray,exports.VldObject=n.VldObject,exports.VldTuple=c.VldTuple,exports.VldRecord=V.VldRecord,exports.VldSet=p.VldSet,exports.VldMap=u.VldMap,exports.VldUnion=x.VldUnion,exports.VldIntersection=j.VldIntersection,exports.VldLiteral=v.VldLiteral,exports.VldEnum=b.VldEnum,exports.VldAny=q.VldAny,exports.VldUnknown=m.VldUnknown,exports.VldVoid=y.VldVoid,exports.VldNever=N.VldNever,exports.VldNull=g.VldNull,exports.VldUndefined=B.VldUndefined,exports.VldNan=S.VldNan,exports.VldLazy=R.VldLazy,exports.VldDiscriminatedUnion=f.VldDiscriminatedUnion,exports.VldXor=U.VldXor,exports.VldJson=h.VldJson,exports.NEVER=k,exports.any=()=>q.VldAny.create(),exports.array=e=>i.VldArray.create(e),exports.bigint=()=>s.VldBigInt.create(),exports.boolean=()=>l.VldBoolean.create(),exports.coerce=D,exports.date=()=>o.VldDate.create(),exports.discriminatedUnion=(e,...r)=>f.VldDiscriminatedUnion.create(e,[...r]),exports.enumValidator=(...e)=>b.VldEnum.create(e),exports.int=()=>t.VldNumber.create().int(),exports.int32=()=>t.VldNumber.create().int().min(-2147483648).max(2147483647),exports.intersection=(e,r)=>j.VldIntersection.create(e,r),exports.json=e=>h.VldJson.create(e),exports.lazy=e=>R.VldLazy.create(e),exports.literal=e=>v.VldLiteral.create(e),exports.looseObject=e=>n.VldObject.create(e).passthrough(),exports.looseRecord=e=>V.VldRecord.create(e).loose(),exports.map=(e,r)=>u.VldMap.create(e,r),exports.nan=()=>S.VldNan.create(),exports.never=()=>N.VldNever.create(),exports.nullValidator=()=>g.VldNull.create(),exports.nullable=r=>e.VldNullable.create(r),exports.nullish=r=>e.VldNullish.create(r),exports.number=()=>t.VldNumber.create(),exports.object=e=>n.VldObject.create(e),exports.optional=r=>e.VldOptional.create(r),exports.partialRecord=e=>V.VldRecord.create(e).partial(),exports.preprocess=(r,t)=>e.VldPreprocess.create(r,t),exports.record=e=>V.VldRecord.create(e),exports.set=e=>p.VldSet.create(e),exports.strictObject=e=>n.VldObject.create(e).strict(),exports.string=()=>r.VldString.create(),exports.stringbool=e=>a.VldStringBool.create(e),exports.symbol=()=>d.VldSymbol.create(),exports.tuple=(...e)=>c.VldTuple.create(...e),exports.undefinedValidator=()=>B.VldUndefined.create(),exports.union=(...e)=>x.VldUnion.create(...e),exports.unknown=()=>m.VldUnknown.create(),exports.voidValidator=()=>y.VldVoid.create(),exports.xor=(...e)=>U.VldXor.create([...e]);
|