@hy_ong/zod-kit 0.2.1 → 0.2.2
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/{chunk-TSHL7ZO2.js → chunk-2SWEVDFZ.js} +1 -1
- package/dist/{chunk-WWRFBLCR.cjs → chunk-32JI34CV.cjs} +3 -3
- package/dist/{chunk-PGSDXR2I.js → chunk-42C5OHRK.js} +1 -1
- package/dist/{chunk-B3U5G3AA.js → chunk-46VAH2BJ.js} +1 -1
- package/dist/{chunk-JZ2SHRGZ.js → chunk-5JGTDL3Y.js} +1 -1
- package/dist/{chunk-P2NONIMS.js → chunk-5LEXCVLX.js} +1 -1
- package/dist/{chunk-ZBOQCXD4.js → chunk-6AAP4LPF.js} +80 -0
- package/dist/{chunk-5GAZQDVS.cjs → chunk-B4EZYZOK.cjs} +13 -4
- package/dist/{chunk-EAU42EVH.js → chunk-COYKBWTI.js} +1 -1
- package/dist/{chunk-JBNCMS42.cjs → chunk-DFJZ3NS2.cjs} +3 -3
- package/dist/{chunk-MAQRXYE6.js → chunk-EDHT4LPO.js} +1 -1
- package/dist/{chunk-AANSHH2O.cjs → chunk-EGHL277K.cjs} +3 -3
- package/dist/{chunk-5ZEKWPSE.cjs → chunk-ERH4NIMU.cjs} +3 -3
- package/dist/{chunk-4LYZAO3P.js → chunk-FM3EZ72O.js} +1 -1
- package/dist/{chunk-VP5CCP5F.cjs → chunk-GJIRDBZJ.cjs} +3 -3
- package/dist/{chunk-KARFFIMP.js → chunk-H2XTEM4M.js} +1 -1
- package/dist/{chunk-LKPXHW5N.cjs → chunk-HMSM6FFA.cjs} +3 -3
- package/dist/{chunk-77KZUPPN.cjs → chunk-HTEHINI7.cjs} +3 -3
- package/dist/{chunk-OMFQ7Z63.cjs → chunk-JOLSGZGN.cjs} +3 -3
- package/dist/{chunk-MCDESS3T.js → chunk-JXY7APBU.js} +1 -1
- package/dist/{chunk-IJEEM3DI.js → chunk-K2UOY6TB.js} +1 -1
- package/dist/{chunk-P364KRO5.js → chunk-KFOHKTFD.js} +1 -1
- package/dist/{chunk-DRXPGQM6.cjs → chunk-L4HSIKTU.cjs} +3 -3
- package/dist/{chunk-36NWHESN.js → chunk-LH7ZB4BK.js} +1 -1
- package/dist/{chunk-I2RJMDXN.js → chunk-LL4ZWLGO.js} +1 -1
- package/dist/{chunk-CFFCBWYL.cjs → chunk-M6MTP3NY.cjs} +3 -3
- package/dist/{chunk-FC6VDOC7.js → chunk-MHJFYYGV.js} +11 -2
- package/dist/{chunk-6OGDPSWT.js → chunk-MINMXGW3.js} +1 -1
- package/dist/{chunk-5OGW2ERW.js → chunk-MM7IL2RG.js} +1 -1
- package/dist/{chunk-UFNVCUPQ.cjs → chunk-OPQJWHXN.cjs} +3 -3
- package/dist/{chunk-6X22I6NQ.cjs → chunk-ORFHDJII.cjs} +3 -3
- package/dist/{chunk-W2EWMV3A.cjs → chunk-ORVV4MCF.cjs} +3 -3
- package/dist/{chunk-OEK7QSQP.js → chunk-QICQ6YEY.js} +1 -1
- package/dist/{chunk-RKHX3DGH.js → chunk-RKUQREMW.js} +1 -1
- package/dist/{chunk-AWV2IT66.js → chunk-RO47DKQG.js} +1 -1
- package/dist/{chunk-VDOAPLA6.cjs → chunk-RRPXIRTQ.cjs} +3 -3
- package/dist/{chunk-YALLOVNO.cjs → chunk-RYFG2GKM.cjs} +3 -3
- package/dist/{chunk-OP4KV3BY.cjs → chunk-STNHTRG7.cjs} +3 -3
- package/dist/{chunk-YAU6JCYL.cjs → chunk-TFGS34VD.cjs} +3 -3
- package/dist/{chunk-PL2GERLG.cjs → chunk-TQXDUMML.cjs} +3 -3
- package/dist/{chunk-FVO4743A.cjs → chunk-UBK3VCVH.cjs} +3 -3
- package/dist/{chunk-YWV2BBXN.cjs → chunk-UCOXAZJF.cjs} +80 -0
- package/dist/{chunk-DPXRMSB2.js → chunk-UQZKFAFX.js} +1 -1
- package/dist/{chunk-AI72FMOF.cjs → chunk-VB2KV2ZM.cjs} +3 -3
- package/dist/{chunk-ZFQQXWNB.js → chunk-WABKPFPK.js} +1 -1
- package/dist/{chunk-LIQSVJLS.js → chunk-WDI4QJMQ.js} +1 -1
- package/dist/{chunk-5LS4DSRQ.cjs → chunk-YDH3L27K.cjs} +3 -3
- package/dist/{chunk-NKCYXBGX.js → chunk-YIM3D2AD.js} +1 -1
- package/dist/{chunk-MG25BEV4.cjs → chunk-YPSEIDUR.cjs} +3 -3
- package/dist/{chunk-R5G4V7C6.cjs → chunk-ZNJLWJX3.cjs} +3 -3
- package/dist/{chunk-G6DV7LX7.cjs → chunk-ZTFCJCPO.cjs} +3 -3
- package/dist/{chunk-VCRKYMJM.js → chunk-ZXUMK2RR.js} +1 -1
- package/dist/common/boolean.cjs +3 -3
- package/dist/common/boolean.js +2 -2
- package/dist/common/color.cjs +3 -3
- package/dist/common/color.js +2 -2
- package/dist/common/coordinate.cjs +3 -3
- package/dist/common/coordinate.js +2 -2
- package/dist/common/credit-card.cjs +3 -3
- package/dist/common/credit-card.js +2 -2
- package/dist/common/date.cjs +3 -3
- package/dist/common/date.js +2 -2
- package/dist/common/datetime.cjs +3 -3
- package/dist/common/datetime.js +2 -2
- package/dist/common/email.cjs +3 -3
- package/dist/common/email.js +2 -2
- package/dist/common/file.cjs +3 -3
- package/dist/common/file.js +2 -2
- package/dist/common/id.cjs +3 -3
- package/dist/common/id.d.cts +34 -8
- package/dist/common/id.d.ts +34 -8
- package/dist/common/id.js +2 -2
- package/dist/common/ip.cjs +3 -3
- package/dist/common/ip.js +2 -2
- package/dist/common/number.cjs +3 -3
- package/dist/common/number.js +2 -2
- package/dist/common/password.cjs +3 -3
- package/dist/common/password.js +2 -2
- package/dist/common/text.cjs +3 -3
- package/dist/common/text.js +2 -2
- package/dist/common/time.cjs +3 -3
- package/dist/common/time.js +2 -2
- package/dist/common/url.cjs +3 -3
- package/dist/common/url.js +2 -2
- package/dist/index.cjs +27 -27
- package/dist/index.js +26 -26
- package/dist/taiwan/bank-account.cjs +3 -3
- package/dist/taiwan/bank-account.js +2 -2
- package/dist/taiwan/business-id.cjs +3 -3
- package/dist/taiwan/business-id.js +2 -2
- package/dist/taiwan/fax.cjs +3 -3
- package/dist/taiwan/fax.js +2 -2
- package/dist/taiwan/invoice.cjs +3 -3
- package/dist/taiwan/invoice.js +2 -2
- package/dist/taiwan/license-plate.cjs +3 -3
- package/dist/taiwan/license-plate.js +2 -2
- package/dist/taiwan/mobile.cjs +3 -3
- package/dist/taiwan/mobile.js +2 -2
- package/dist/taiwan/national-id.cjs +3 -3
- package/dist/taiwan/national-id.js +2 -2
- package/dist/taiwan/passport.cjs +3 -3
- package/dist/taiwan/passport.js +2 -2
- package/dist/taiwan/postal-code.cjs +3 -3
- package/dist/taiwan/postal-code.js +2 -2
- package/dist/taiwan/tel.cjs +3 -3
- package/dist/taiwan/tel.js +2 -2
- package/package.json +5 -5
- package/src/i18n/locales/en-GB.json +8 -0
- package/src/i18n/locales/en-US.json +9 -1
- package/src/i18n/locales/id-ID.json +8 -0
- package/src/i18n/locales/ja-JP.json +8 -0
- package/src/i18n/locales/ko-KR.json +8 -0
- package/src/i18n/locales/ms-MY.json +8 -0
- package/src/i18n/locales/th-TH.json +8 -0
- package/src/i18n/locales/vi-VN.json +8 -0
- package/src/i18n/locales/zh-CN.json +8 -0
- package/src/i18n/locales/zh-TW.json +8 -0
- package/src/validators/common/id.ts +45 -3
- package/tests/common/id.test.ts +68 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/ip.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -58,14 +58,14 @@ function ip(required, options) {
|
|
|
58
58
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
59
59
|
const getMessage = (key, params) => {
|
|
60
60
|
if (i18n) {
|
|
61
|
-
const currentLocale =
|
|
61
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
62
62
|
const customMessages = i18n[currentLocale];
|
|
63
63
|
if (customMessages && customMessages[key]) {
|
|
64
64
|
const template = customMessages[key];
|
|
65
65
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.ip.${key}`, params);
|
|
69
69
|
};
|
|
70
70
|
const preprocessFn = (val) => {
|
|
71
71
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -83,6 +83,14 @@ var zh_TW_default = {
|
|
|
83
83
|
maxLength: "\u9577\u5EA6\u6700\u591A ${maxLength} \u5B57\u5143",
|
|
84
84
|
numeric: "\u5FC5\u9808\u70BA\u6578\u5B57 ID",
|
|
85
85
|
uuid: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID",
|
|
86
|
+
uuidv1: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v1",
|
|
87
|
+
uuidv2: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v2",
|
|
88
|
+
uuidv3: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v3",
|
|
89
|
+
uuidv4: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v4",
|
|
90
|
+
uuidv5: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v5",
|
|
91
|
+
uuidv6: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v6",
|
|
92
|
+
uuidv7: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v7",
|
|
93
|
+
uuidv8: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 UUID v8",
|
|
86
94
|
objectId: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 MongoDB ObjectId",
|
|
87
95
|
nanoid: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 Nano ID",
|
|
88
96
|
snowflake: "\u5FC5\u9808\u70BA\u6709\u6548\u7684 Snowflake ID",
|
|
@@ -332,6 +340,14 @@ var zh_CN_default = {
|
|
|
332
340
|
maxLength: "\u957F\u5EA6\u6700\u591A ${maxLength} \u4E2A\u5B57\u7B26",
|
|
333
341
|
numeric: "\u5FC5\u987B\u4E3A\u6570\u5B57 ID",
|
|
334
342
|
uuid: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID",
|
|
343
|
+
uuidv1: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v1",
|
|
344
|
+
uuidv2: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v2",
|
|
345
|
+
uuidv3: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v3",
|
|
346
|
+
uuidv4: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v4",
|
|
347
|
+
uuidv5: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v5",
|
|
348
|
+
uuidv6: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v6",
|
|
349
|
+
uuidv7: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v7",
|
|
350
|
+
uuidv8: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 UUID v8",
|
|
335
351
|
objectId: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 MongoDB ObjectId",
|
|
336
352
|
nanoid: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 Nano ID",
|
|
337
353
|
snowflake: "\u5FC5\u987B\u4E3A\u6709\u6548\u7684 Snowflake ID",
|
|
@@ -581,6 +597,14 @@ var en_US_default = {
|
|
|
581
597
|
maxLength: "Must be at most ${maxLength} characters",
|
|
582
598
|
numeric: "Must be a numeric ID",
|
|
583
599
|
uuid: "Must be a valid UUID",
|
|
600
|
+
uuidv1: "Must be a valid UUID v1",
|
|
601
|
+
uuidv2: "Must be a valid UUID v2",
|
|
602
|
+
uuidv3: "Must be a valid UUID v3",
|
|
603
|
+
uuidv4: "Must be a valid UUID v4",
|
|
604
|
+
uuidv5: "Must be a valid UUID v5",
|
|
605
|
+
uuidv6: "Must be a valid UUID v6",
|
|
606
|
+
uuidv7: "Must be a valid UUID v7",
|
|
607
|
+
uuidv8: "Must be a valid UUID v8",
|
|
584
608
|
objectId: "Must be a valid MongoDB ObjectId",
|
|
585
609
|
nanoid: "Must be a valid Nano ID",
|
|
586
610
|
snowflake: "Must be a valid Snowflake ID",
|
|
@@ -830,6 +854,14 @@ var en_GB_default = {
|
|
|
830
854
|
maxLength: "Must be at most ${maxLength} characters",
|
|
831
855
|
numeric: "Must be a numeric ID",
|
|
832
856
|
uuid: "Must be a valid UUID",
|
|
857
|
+
uuidv1: "Must be a valid UUID v1",
|
|
858
|
+
uuidv2: "Must be a valid UUID v2",
|
|
859
|
+
uuidv3: "Must be a valid UUID v3",
|
|
860
|
+
uuidv4: "Must be a valid UUID v4",
|
|
861
|
+
uuidv5: "Must be a valid UUID v5",
|
|
862
|
+
uuidv6: "Must be a valid UUID v6",
|
|
863
|
+
uuidv7: "Must be a valid UUID v7",
|
|
864
|
+
uuidv8: "Must be a valid UUID v8",
|
|
833
865
|
objectId: "Must be a valid MongoDB ObjectId",
|
|
834
866
|
nanoid: "Must be a valid Nano ID",
|
|
835
867
|
snowflake: "Must be a valid Snowflake ID",
|
|
@@ -1079,6 +1111,14 @@ var ja_JP_default = {
|
|
|
1079
1111
|
maxLength: "${maxLength}\u6587\u5B57\u4EE5\u4E0B\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
1080
1112
|
numeric: "\u6570\u5024ID\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1081
1113
|
uuid: "\u6709\u52B9\u306AUUID\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1114
|
+
uuidv1: "\u6709\u52B9\u306AUUID v1\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1115
|
+
uuidv2: "\u6709\u52B9\u306AUUID v2\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1116
|
+
uuidv3: "\u6709\u52B9\u306AUUID v3\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1117
|
+
uuidv4: "\u6709\u52B9\u306AUUID v4\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1118
|
+
uuidv5: "\u6709\u52B9\u306AUUID v5\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1119
|
+
uuidv6: "\u6709\u52B9\u306AUUID v6\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1120
|
+
uuidv7: "\u6709\u52B9\u306AUUID v7\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1121
|
+
uuidv8: "\u6709\u52B9\u306AUUID v8\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1082
1122
|
objectId: "\u6709\u52B9\u306AMongoDB ObjectId\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1083
1123
|
nanoid: "\u6709\u52B9\u306ANano ID\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
1084
1124
|
snowflake: "\u6709\u52B9\u306ASnowflake ID\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
@@ -1328,6 +1368,14 @@ var ko_KR_default = {
|
|
|
1328
1368
|
maxLength: "\uCD5C\uB300 ${maxLength}\uC790 \uC774\uD558\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
1329
1369
|
numeric: "\uC22B\uC790 ID\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
1330
1370
|
uuid: "\uC720\uD6A8\uD55C UUID\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
1371
|
+
uuidv1: "\uC720\uD6A8\uD55C UUID v1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1372
|
+
uuidv2: "\uC720\uD6A8\uD55C UUID v2\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1373
|
+
uuidv3: "\uC720\uD6A8\uD55C UUID v3\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1374
|
+
uuidv4: "\uC720\uD6A8\uD55C UUID v4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1375
|
+
uuidv5: "\uC720\uD6A8\uD55C UUID v5\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1376
|
+
uuidv6: "\uC720\uD6A8\uD55C UUID v6\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1377
|
+
uuidv7: "\uC720\uD6A8\uD55C UUID v7\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1378
|
+
uuidv8: "\uC720\uD6A8\uD55C UUID v8\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4",
|
|
1331
1379
|
objectId: "\uC720\uD6A8\uD55C MongoDB ObjectId\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
1332
1380
|
nanoid: "\uC720\uD6A8\uD55C Nano ID\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
1333
1381
|
snowflake: "\uC720\uD6A8\uD55C Snowflake ID\uC5EC\uC57C \uD569\uB2C8\uB2E4",
|
|
@@ -1577,6 +1625,14 @@ var ms_MY_default = {
|
|
|
1577
1625
|
maxLength: "Mesti tidak melebihi ${maxLength} aksara",
|
|
1578
1626
|
numeric: "Mesti ID numerik",
|
|
1579
1627
|
uuid: "Mesti UUID yang sah",
|
|
1628
|
+
uuidv1: "Mesti UUID v1 yang sah",
|
|
1629
|
+
uuidv2: "Mesti UUID v2 yang sah",
|
|
1630
|
+
uuidv3: "Mesti UUID v3 yang sah",
|
|
1631
|
+
uuidv4: "Mesti UUID v4 yang sah",
|
|
1632
|
+
uuidv5: "Mesti UUID v5 yang sah",
|
|
1633
|
+
uuidv6: "Mesti UUID v6 yang sah",
|
|
1634
|
+
uuidv7: "Mesti UUID v7 yang sah",
|
|
1635
|
+
uuidv8: "Mesti UUID v8 yang sah",
|
|
1580
1636
|
objectId: "Mesti MongoDB ObjectId yang sah",
|
|
1581
1637
|
nanoid: "Mesti Nano ID yang sah",
|
|
1582
1638
|
snowflake: "Mesti Snowflake ID yang sah",
|
|
@@ -1826,6 +1882,14 @@ var id_ID_default = {
|
|
|
1826
1882
|
maxLength: "Harus maksimal ${maxLength} karakter",
|
|
1827
1883
|
numeric: "Harus berupa ID numerik",
|
|
1828
1884
|
uuid: "Harus berupa UUID yang valid",
|
|
1885
|
+
uuidv1: "Harus berupa UUID v1 yang valid",
|
|
1886
|
+
uuidv2: "Harus berupa UUID v2 yang valid",
|
|
1887
|
+
uuidv3: "Harus berupa UUID v3 yang valid",
|
|
1888
|
+
uuidv4: "Harus berupa UUID v4 yang valid",
|
|
1889
|
+
uuidv5: "Harus berupa UUID v5 yang valid",
|
|
1890
|
+
uuidv6: "Harus berupa UUID v6 yang valid",
|
|
1891
|
+
uuidv7: "Harus berupa UUID v7 yang valid",
|
|
1892
|
+
uuidv8: "Harus berupa UUID v8 yang valid",
|
|
1829
1893
|
objectId: "Harus berupa MongoDB ObjectId yang valid",
|
|
1830
1894
|
nanoid: "Harus berupa Nano ID yang valid",
|
|
1831
1895
|
snowflake: "Harus berupa Snowflake ID yang valid",
|
|
@@ -2075,6 +2139,14 @@ var th_TH_default = {
|
|
|
2075
2139
|
maxLength: "\u0E15\u0E49\u0E2D\u0E07\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 ${maxLength} \u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",
|
|
2076
2140
|
numeric: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 ID \u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",
|
|
2077
2141
|
uuid: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2142
|
+
uuidv1: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v1 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2143
|
+
uuidv2: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v2 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2144
|
+
uuidv3: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v3 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2145
|
+
uuidv4: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v4 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2146
|
+
uuidv5: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v5 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2147
|
+
uuidv6: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v6 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2148
|
+
uuidv7: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v7 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2149
|
+
uuidv8: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 UUID v8 \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2078
2150
|
objectId: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 MongoDB ObjectId \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2079
2151
|
nanoid: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 Nano ID \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
2080
2152
|
snowflake: "\u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19 Snowflake ID \u0E17\u0E35\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
@@ -2324,6 +2396,14 @@ var vi_VN_default = {
|
|
|
2324
2396
|
maxLength: "Ph\u1EA3i c\xF3 t\u1ED1i \u0111a ${maxLength} k\xFD t\u1EF1",
|
|
2325
2397
|
numeric: "Ph\u1EA3i l\xE0 ID d\u1EA1ng s\u1ED1",
|
|
2326
2398
|
uuid: "Ph\u1EA3i l\xE0 UUID h\u1EE3p l\u1EC7",
|
|
2399
|
+
uuidv1: "Ph\u1EA3i l\xE0 UUID v1 h\u1EE3p l\u1EC7",
|
|
2400
|
+
uuidv2: "Ph\u1EA3i l\xE0 UUID v2 h\u1EE3p l\u1EC7",
|
|
2401
|
+
uuidv3: "Ph\u1EA3i l\xE0 UUID v3 h\u1EE3p l\u1EC7",
|
|
2402
|
+
uuidv4: "Ph\u1EA3i l\xE0 UUID v4 h\u1EE3p l\u1EC7",
|
|
2403
|
+
uuidv5: "Ph\u1EA3i l\xE0 UUID v5 h\u1EE3p l\u1EC7",
|
|
2404
|
+
uuidv6: "Ph\u1EA3i l\xE0 UUID v6 h\u1EE3p l\u1EC7",
|
|
2405
|
+
uuidv7: "Ph\u1EA3i l\xE0 UUID v7 h\u1EE3p l\u1EC7",
|
|
2406
|
+
uuidv8: "Ph\u1EA3i l\xE0 UUID v8 h\u1EE3p l\u1EC7",
|
|
2327
2407
|
objectId: "Ph\u1EA3i l\xE0 MongoDB ObjectId h\u1EE3p l\u1EC7",
|
|
2328
2408
|
nanoid: "Ph\u1EA3i l\xE0 Nano ID h\u1EE3p l\u1EC7",
|
|
2329
2409
|
snowflake: "Ph\u1EA3i l\xE0 Snowflake ID h\u1EE3p l\u1EC7",
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/id.ts
|
|
7
7
|
var _zod = require('zod');
|
|
8
|
+
var UUID_BASE = (version) => new RegExp(`^[0-9a-f]{8}-[0-9a-f]{4}-${version}[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`, "i");
|
|
8
9
|
var ID_PATTERNS = {
|
|
9
10
|
numeric: /^\d+$/,
|
|
10
|
-
uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[1-
|
|
11
|
+
uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,
|
|
12
|
+
uuidv1: UUID_BASE("1"),
|
|
13
|
+
uuidv2: UUID_BASE("2"),
|
|
14
|
+
uuidv3: UUID_BASE("3"),
|
|
15
|
+
uuidv4: UUID_BASE("4"),
|
|
16
|
+
uuidv5: UUID_BASE("5"),
|
|
17
|
+
uuidv6: UUID_BASE("6"),
|
|
18
|
+
uuidv7: UUID_BASE("7"),
|
|
19
|
+
uuidv8: UUID_BASE("8"),
|
|
11
20
|
objectId: /^[0-9a-f]{24}$/i,
|
|
12
21
|
nanoid: /^[A-Za-z0-9_-]{21}$/,
|
|
13
22
|
snowflake: /^\d{19}$/,
|
|
@@ -48,14 +57,14 @@ function id(required, options) {
|
|
|
48
57
|
const actualDefaultValue = defaultValue !== void 0 ? defaultValue : isRequired ? isNumericType ? NaN : "" : null;
|
|
49
58
|
const getMessage = (key, params) => {
|
|
50
59
|
if (i18n) {
|
|
51
|
-
const currentLocale =
|
|
60
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
52
61
|
const customMessages = i18n[currentLocale];
|
|
53
62
|
if (customMessages && customMessages[key]) {
|
|
54
63
|
const template = customMessages[key];
|
|
55
64
|
return template.replace(/\$\{(\w+)}/g, (_match, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _ => _[k]]), () => ( "")));
|
|
56
65
|
}
|
|
57
66
|
}
|
|
58
|
-
return
|
|
67
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.id.${key}`, params);
|
|
59
68
|
};
|
|
60
69
|
const preprocessNumericFn = (val) => {
|
|
61
70
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/url.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -32,14 +32,14 @@ function url(required, options) {
|
|
|
32
32
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
33
33
|
const getMessage = (key, params) => {
|
|
34
34
|
if (i18n) {
|
|
35
|
-
const currentLocale =
|
|
35
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
36
36
|
const customMessages = i18n[currentLocale];
|
|
37
37
|
if (customMessages && customMessages[key]) {
|
|
38
38
|
const template = customMessages[key];
|
|
39
39
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.url.${key}`, params);
|
|
43
43
|
};
|
|
44
44
|
const preprocessFn = (val) => {
|
|
45
45
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/number.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -10,14 +10,14 @@ function number(required, options) {
|
|
|
10
10
|
const isRequired = _nullishCoalesce(required, () => ( false));
|
|
11
11
|
const getMessage = (key, params) => {
|
|
12
12
|
if (i18n) {
|
|
13
|
-
const currentLocale =
|
|
13
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
14
14
|
const customMessages = i18n[currentLocale];
|
|
15
15
|
if (customMessages && customMessages[key]) {
|
|
16
16
|
const template = customMessages[key];
|
|
17
17
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.number.${key}`, params);
|
|
21
21
|
};
|
|
22
22
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( null));
|
|
23
23
|
const schema = _zod.z.preprocess(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/taiwan/mobile.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -15,14 +15,14 @@ function twMobile(required, options) {
|
|
|
15
15
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
16
16
|
const getMessage = (key, params) => {
|
|
17
17
|
if (i18n) {
|
|
18
|
-
const currentLocale =
|
|
18
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
19
19
|
const customMessages = i18n[currentLocale];
|
|
20
20
|
if (customMessages && customMessages[key]) {
|
|
21
21
|
const template = customMessages[key];
|
|
22
22
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `taiwan.mobile.${key}`, params);
|
|
26
26
|
};
|
|
27
27
|
const preprocessFn = (val) => {
|
|
28
28
|
if (val === null || val === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/taiwan/license-plate.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -45,14 +45,14 @@ function twLicensePlate(required, options) {
|
|
|
45
45
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
46
46
|
const getMessage = (key, params) => {
|
|
47
47
|
if (i18n) {
|
|
48
|
-
const currentLocale =
|
|
48
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
49
49
|
const customMessages = i18n[currentLocale];
|
|
50
50
|
if (customMessages && customMessages[key]) {
|
|
51
51
|
const template = customMessages[key];
|
|
52
52
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `taiwan.licensePlate.${key}`, params);
|
|
56
56
|
};
|
|
57
57
|
const preprocessFn = (val) => {
|
|
58
58
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/email.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -24,14 +24,14 @@ function email(required, options) {
|
|
|
24
24
|
const isRequired = _nullishCoalesce(required, () => ( false));
|
|
25
25
|
const getMessage = (key, params) => {
|
|
26
26
|
if (i18n) {
|
|
27
|
-
const currentLocale =
|
|
27
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
28
28
|
const customMessages = i18n[currentLocale];
|
|
29
29
|
if (customMessages && customMessages[key]) {
|
|
30
30
|
const template = customMessages[key];
|
|
31
31
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.email.${key}`, params);
|
|
35
35
|
};
|
|
36
36
|
const disposableDomains = ["10minutemail.com", "tempmail.org", "guerrillamail.com", "mailinator.com", "yopmail.com", "temp-mail.org", "throwaway.email", "getnada.com", "maildrop.cc"];
|
|
37
37
|
const freeEmailDomains = ["gmail.com", "yahoo.com", "hotmail.com", "outlook.com", "icloud.com", "aol.com", "protonmail.com", "zoho.com"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/file.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -28,14 +28,14 @@ function file(required, options) {
|
|
|
28
28
|
const isRequired = _nullishCoalesce(required, () => ( false));
|
|
29
29
|
const getMessage = (key, params) => {
|
|
30
30
|
if (i18n) {
|
|
31
|
-
const currentLocale =
|
|
31
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
32
32
|
const customMessages = i18n[currentLocale];
|
|
33
33
|
if (customMessages && customMessages[key]) {
|
|
34
34
|
const template = customMessages[key];
|
|
35
35
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
return
|
|
38
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.file.${key}`, params);
|
|
39
39
|
};
|
|
40
40
|
const imageTypes = ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp", "image/svg+xml", "image/bmp", "image/tiff"];
|
|
41
41
|
const documentTypes = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/taiwan/postal-code.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -603,14 +603,14 @@ function twPostalCode(required, options) {
|
|
|
603
603
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
604
604
|
const getMessage = (key, params) => {
|
|
605
605
|
if (i18n) {
|
|
606
|
-
const currentLocale =
|
|
606
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
607
607
|
const customMessages = i18n[currentLocale];
|
|
608
608
|
if (customMessages && customMessages[key]) {
|
|
609
609
|
const template = customMessages[key];
|
|
610
610
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
return
|
|
613
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `taiwan.postalCode.${key}`, params);
|
|
614
614
|
};
|
|
615
615
|
const preprocessFn = (val) => {
|
|
616
616
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/taiwan/bank-account.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -63,14 +63,14 @@ function twBankAccount(required, options) {
|
|
|
63
63
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
64
64
|
const getMessage = (key, params) => {
|
|
65
65
|
if (i18n) {
|
|
66
|
-
const currentLocale =
|
|
66
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
67
67
|
const customMessages = i18n[currentLocale];
|
|
68
68
|
if (customMessages && customMessages[key]) {
|
|
69
69
|
const template = customMessages[key];
|
|
70
70
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `taiwan.bankAccount.${key}`, params);
|
|
74
74
|
};
|
|
75
75
|
const preprocessFn = (val) => {
|
|
76
76
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkUCOXAZJFcjs = require('./chunk-UCOXAZJF.cjs');
|
|
5
5
|
|
|
6
6
|
// src/validators/common/credit-card.ts
|
|
7
7
|
var _zod = require('zod');
|
|
@@ -37,14 +37,14 @@ function creditCard(required, options) {
|
|
|
37
37
|
const actualDefaultValue = _nullishCoalesce(defaultValue, () => ( (isRequired ? "" : null)));
|
|
38
38
|
const getMessage = (key, params) => {
|
|
39
39
|
if (i18n) {
|
|
40
|
-
const currentLocale =
|
|
40
|
+
const currentLocale = _chunkUCOXAZJFcjs.getLocale.call(void 0, );
|
|
41
41
|
const customMessages = i18n[currentLocale];
|
|
42
42
|
if (customMessages && customMessages[key]) {
|
|
43
43
|
const template = customMessages[key];
|
|
44
44
|
return template.replace(/\$\{(\w+)}/g, (_, k) => _nullishCoalesce(_optionalChain([params, 'optionalAccess', _2 => _2[k]]), () => ( "")));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return _chunkUCOXAZJFcjs.t.call(void 0, `common.creditCard.${key}`, params);
|
|
48
48
|
};
|
|
49
49
|
const preprocessFn = (val) => {
|
|
50
50
|
if (val === "" || val === null || val === void 0) {
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getLocale,
|
|
3
3
|
t
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6AAP4LPF.js";
|
|
5
5
|
|
|
6
6
|
// src/validators/common/id.ts
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
var UUID_BASE = (version) => new RegExp(`^[0-9a-f]{8}-[0-9a-f]{4}-${version}[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$`, "i");
|
|
8
9
|
var ID_PATTERNS = {
|
|
9
10
|
numeric: /^\d+$/,
|
|
10
|
-
uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[1-
|
|
11
|
+
uuid: /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,
|
|
12
|
+
uuidv1: UUID_BASE("1"),
|
|
13
|
+
uuidv2: UUID_BASE("2"),
|
|
14
|
+
uuidv3: UUID_BASE("3"),
|
|
15
|
+
uuidv4: UUID_BASE("4"),
|
|
16
|
+
uuidv5: UUID_BASE("5"),
|
|
17
|
+
uuidv6: UUID_BASE("6"),
|
|
18
|
+
uuidv7: UUID_BASE("7"),
|
|
19
|
+
uuidv8: UUID_BASE("8"),
|
|
11
20
|
objectId: /^[0-9a-f]{24}$/i,
|
|
12
21
|
nanoid: /^[A-Za-z0-9_-]{21}$/,
|
|
13
22
|
snowflake: /^\d{19}$/,
|