phecda-core 2.0.0-alpha.0 → 2.0.0-alpha.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/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { i as isArray, a as isBoolean, j as isCnName, l as isDate, k as isEnName, n as isHexColor, h as isIdCard, f as isLandline, g as isMailBox, e as isMobile, b as isNumber, d as isObject, o as isPostalCode, c as isString, m as isWechat, t as toNumber, p as toString } from './pipe-6da589ab.js';
2
+
1
3
  interface NameSpace {
2
4
  [name: string]: Phecda;
3
5
  }
@@ -77,7 +79,7 @@ declare function addDecoToClass<M extends new (...args: any) => any>(c: M, key:
77
79
 
78
80
  declare function Init(target: any, key: PropertyKey): void;
79
81
  declare function Bind(value: any): (target: any, k: PropertyKey) => void;
80
- declare function Rule(rule: RegExp | string | Function | number, info: string, meta?: any): (obj: any, key: PropertyKey) => void;
82
+ declare function Rule(rule: RegExp | string | Function | number, info: string | ((k: string) => string), meta?: any): (obj: any, key: PropertyKey) => void;
81
83
  declare function Ignore(target: any, key: PropertyKey): void;
82
84
  declare function Clear(target: any, key: PropertyKey): void;
83
85
  declare function Err<Fn extends (...args: any) => any>(cb: Fn): (target: any, key: PropertyKey) => void;
@@ -59,7 +59,22 @@ var Phecda = (() => {
59
59
  getTag: () => getTag,
60
60
  init: () => init,
61
61
  injectProperty: () => injectProperty,
62
+ isArray: () => isArray,
63
+ isBoolean: () => isBoolean,
64
+ isCnName: () => isCnName,
65
+ isDate: () => isDate,
66
+ isEnName: () => isEnName,
67
+ isHexColor: () => isHexColor,
68
+ isIdCard: () => isIdCard,
69
+ isLandline: () => isLandline,
70
+ isMailBox: () => isMailBox,
71
+ isMobile: () => isMobile,
72
+ isNumber: () => isNumber,
73
+ isObject: () => isObject,
62
74
  isPhecda: () => isPhecda,
75
+ isPostalCode: () => isPostalCode,
76
+ isString: () => isString,
77
+ isWechat: () => isWechat,
63
78
  plainToClass: () => plainToClass,
64
79
  regisHandler: () => regisHandler,
65
80
  regisInitEvent: () => regisInitEvent,
@@ -71,6 +86,8 @@ var Phecda = (() => {
71
86
  setState: () => setState,
72
87
  snapShot: () => snapShot,
73
88
  to: () => to,
89
+ toNumber: () => toNumber,
90
+ toString: () => toString,
74
91
  validate: () => validate
75
92
  });
76
93
 
@@ -412,7 +429,7 @@ var Phecda = (() => {
412
429
  for (const handler of handlers) {
413
430
  const rule = handler.rule;
414
431
  if (rule && !await validate(rule, data[item])) {
415
- err.push(handler.info || "");
432
+ err.push(typeof handler.info === "function" ? handler.info(item) : handler.info);
416
433
  if (!options.collectError)
417
434
  break;
418
435
  }
@@ -564,5 +581,82 @@ var Phecda = (() => {
564
581
  };
565
582
  }
566
583
  __name(Storage, "Storage");
584
+
585
+ // src/preset/rule.ts
586
+ function isArray(info) {
587
+ return Rule((param) => Array.isArray(param), info || ((k) => `'${k}' should be an array`));
588
+ }
589
+ __name(isArray, "isArray");
590
+ function isBoolean(info) {
591
+ return Rule((param) => [
592
+ true,
593
+ false
594
+ ].includes(param), info || ((k) => `'${k}' should be boolean`));
595
+ }
596
+ __name(isBoolean, "isBoolean");
597
+ function isNumber(info) {
598
+ return Rule((param) => typeof param === "number", info || ((k) => `'${k}' should be number`));
599
+ }
600
+ __name(isNumber, "isNumber");
601
+ function isString(info) {
602
+ return Rule((param) => typeof param === "string", info || ((k) => `'${k}' should be a string`));
603
+ }
604
+ __name(isString, "isString");
605
+ function isObject(info) {
606
+ return Rule((param) => {
607
+ return Object.prototype.toString.call(param) === "[object Object]";
608
+ }, info || ((k) => `'${k}' should be an object`));
609
+ }
610
+ __name(isObject, "isObject");
611
+ function isMobile(info) {
612
+ return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || ((k) => `'${k}' should be a mobile phone number`));
613
+ }
614
+ __name(isMobile, "isMobile");
615
+ function isLandline(info) {
616
+ return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || ((k) => `'${k}' should be a landline`));
617
+ }
618
+ __name(isLandline, "isLandline");
619
+ function isMailBox(info) {
620
+ return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || ((k) => `'${k}' should be a mailbox`));
621
+ }
622
+ __name(isMailBox, "isMailBox");
623
+ function isIdCard(info) {
624
+ return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || ((k) => `'${k}' should be an identity card number`));
625
+ }
626
+ __name(isIdCard, "isIdCard");
627
+ function isCnName(info) {
628
+ return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || ((k) => `'${k}' \u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57`));
629
+ }
630
+ __name(isCnName, "isCnName");
631
+ function isEnName(info) {
632
+ return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || ((k) => `'${k}' should be a valid en-name`));
633
+ }
634
+ __name(isEnName, "isEnName");
635
+ function isDate(info) {
636
+ return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || ((k) => `'${k}' should be a valid date`));
637
+ }
638
+ __name(isDate, "isDate");
639
+ function isWechat(info) {
640
+ return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || ((k) => `'${k}' should be a valid wechat`));
641
+ }
642
+ __name(isWechat, "isWechat");
643
+ function isHexColor(info) {
644
+ return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || ((k) => `'${k}' should be a valid hex-color`));
645
+ }
646
+ __name(isHexColor, "isHexColor");
647
+ function isPostalCode(info) {
648
+ return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || ((k) => `'${k}' should be a valid postal code`));
649
+ }
650
+ __name(isPostalCode, "isPostalCode");
651
+
652
+ // src/preset/pipe.ts
653
+ function toNumber() {
654
+ return Pipe(to((param) => Number(param)));
655
+ }
656
+ __name(toNumber, "toNumber");
657
+ function toString() {
658
+ return Pipe(to((param) => String(param)));
659
+ }
660
+ __name(toString, "toString");
567
661
  return __toCommonJS(src_exports);
568
662
  })();
package/dist/index.js CHANGED
@@ -58,7 +58,22 @@ __export(src_exports, {
58
58
  getTag: () => getTag,
59
59
  init: () => init,
60
60
  injectProperty: () => injectProperty,
61
+ isArray: () => isArray,
62
+ isBoolean: () => isBoolean,
63
+ isCnName: () => isCnName,
64
+ isDate: () => isDate,
65
+ isEnName: () => isEnName,
66
+ isHexColor: () => isHexColor,
67
+ isIdCard: () => isIdCard,
68
+ isLandline: () => isLandline,
69
+ isMailBox: () => isMailBox,
70
+ isMobile: () => isMobile,
71
+ isNumber: () => isNumber,
72
+ isObject: () => isObject,
61
73
  isPhecda: () => isPhecda,
74
+ isPostalCode: () => isPostalCode,
75
+ isString: () => isString,
76
+ isWechat: () => isWechat,
62
77
  plainToClass: () => plainToClass,
63
78
  regisHandler: () => regisHandler,
64
79
  regisInitEvent: () => regisInitEvent,
@@ -70,6 +85,8 @@ __export(src_exports, {
70
85
  setState: () => setState,
71
86
  snapShot: () => snapShot,
72
87
  to: () => to,
88
+ toNumber: () => toNumber,
89
+ toString: () => toString,
73
90
  validate: () => validate
74
91
  });
75
92
  module.exports = __toCommonJS(src_exports);
@@ -412,7 +429,7 @@ async function plainToClass(Model, input, options = {}) {
412
429
  for (const handler of handlers) {
413
430
  const rule = handler.rule;
414
431
  if (rule && !await validate(rule, data[item])) {
415
- err.push(handler.info || "");
432
+ err.push(typeof handler.info === "function" ? handler.info(item) : handler.info);
416
433
  if (!options.collectError)
417
434
  break;
418
435
  }
@@ -564,6 +581,83 @@ function Storage(storeKey) {
564
581
  };
565
582
  }
566
583
  __name(Storage, "Storage");
584
+
585
+ // src/preset/rule.ts
586
+ function isArray(info) {
587
+ return Rule((param) => Array.isArray(param), info || ((k) => `'${k}' should be an array`));
588
+ }
589
+ __name(isArray, "isArray");
590
+ function isBoolean(info) {
591
+ return Rule((param) => [
592
+ true,
593
+ false
594
+ ].includes(param), info || ((k) => `'${k}' should be boolean`));
595
+ }
596
+ __name(isBoolean, "isBoolean");
597
+ function isNumber(info) {
598
+ return Rule((param) => typeof param === "number", info || ((k) => `'${k}' should be number`));
599
+ }
600
+ __name(isNumber, "isNumber");
601
+ function isString(info) {
602
+ return Rule((param) => typeof param === "string", info || ((k) => `'${k}' should be a string`));
603
+ }
604
+ __name(isString, "isString");
605
+ function isObject(info) {
606
+ return Rule((param) => {
607
+ return Object.prototype.toString.call(param) === "[object Object]";
608
+ }, info || ((k) => `'${k}' should be an object`));
609
+ }
610
+ __name(isObject, "isObject");
611
+ function isMobile(info) {
612
+ return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || ((k) => `'${k}' should be a mobile phone number`));
613
+ }
614
+ __name(isMobile, "isMobile");
615
+ function isLandline(info) {
616
+ return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || ((k) => `'${k}' should be a landline`));
617
+ }
618
+ __name(isLandline, "isLandline");
619
+ function isMailBox(info) {
620
+ return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || ((k) => `'${k}' should be a mailbox`));
621
+ }
622
+ __name(isMailBox, "isMailBox");
623
+ function isIdCard(info) {
624
+ return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || ((k) => `'${k}' should be an identity card number`));
625
+ }
626
+ __name(isIdCard, "isIdCard");
627
+ function isCnName(info) {
628
+ return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || ((k) => `'${k}' \u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57`));
629
+ }
630
+ __name(isCnName, "isCnName");
631
+ function isEnName(info) {
632
+ return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || ((k) => `'${k}' should be a valid en-name`));
633
+ }
634
+ __name(isEnName, "isEnName");
635
+ function isDate(info) {
636
+ return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || ((k) => `'${k}' should be a valid date`));
637
+ }
638
+ __name(isDate, "isDate");
639
+ function isWechat(info) {
640
+ return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || ((k) => `'${k}' should be a valid wechat`));
641
+ }
642
+ __name(isWechat, "isWechat");
643
+ function isHexColor(info) {
644
+ return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || ((k) => `'${k}' should be a valid hex-color`));
645
+ }
646
+ __name(isHexColor, "isHexColor");
647
+ function isPostalCode(info) {
648
+ return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || ((k) => `'${k}' should be a valid postal code`));
649
+ }
650
+ __name(isPostalCode, "isPostalCode");
651
+
652
+ // src/preset/pipe.ts
653
+ function toNumber() {
654
+ return Pipe(to((param) => Number(param)));
655
+ }
656
+ __name(toNumber, "toNumber");
657
+ function toString() {
658
+ return Pipe(to((param) => String(param)));
659
+ }
660
+ __name(toString, "toString");
567
661
  // Annotate the CommonJS export names for ESM import in node:
568
662
  0 && (module.exports = {
569
663
  Assign,
@@ -603,7 +697,22 @@ __name(Storage, "Storage");
603
697
  getTag,
604
698
  init,
605
699
  injectProperty,
700
+ isArray,
701
+ isBoolean,
702
+ isCnName,
703
+ isDate,
704
+ isEnName,
705
+ isHexColor,
706
+ isIdCard,
707
+ isLandline,
708
+ isMailBox,
709
+ isMobile,
710
+ isNumber,
711
+ isObject,
606
712
  isPhecda,
713
+ isPostalCode,
714
+ isString,
715
+ isWechat,
607
716
  plainToClass,
608
717
  regisHandler,
609
718
  regisInitEvent,
@@ -615,5 +724,7 @@ __name(Storage, "Storage");
615
724
  setState,
616
725
  snapShot,
617
726
  to,
727
+ toNumber,
728
+ toString,
618
729
  validate
619
730
  });
package/dist/index.mjs CHANGED
@@ -339,7 +339,7 @@ async function plainToClass(Model, input, options = {}) {
339
339
  for (const handler of handlers) {
340
340
  const rule = handler.rule;
341
341
  if (rule && !await validate(rule, data[item])) {
342
- err.push(handler.info || "");
342
+ err.push(typeof handler.info === "function" ? handler.info(item) : handler.info);
343
343
  if (!options.collectError)
344
344
  break;
345
345
  }
@@ -491,6 +491,83 @@ function Storage(storeKey) {
491
491
  };
492
492
  }
493
493
  __name(Storage, "Storage");
494
+
495
+ // src/preset/rule.ts
496
+ function isArray(info) {
497
+ return Rule((param) => Array.isArray(param), info || ((k) => `'${k}' should be an array`));
498
+ }
499
+ __name(isArray, "isArray");
500
+ function isBoolean(info) {
501
+ return Rule((param) => [
502
+ true,
503
+ false
504
+ ].includes(param), info || ((k) => `'${k}' should be boolean`));
505
+ }
506
+ __name(isBoolean, "isBoolean");
507
+ function isNumber(info) {
508
+ return Rule((param) => typeof param === "number", info || ((k) => `'${k}' should be number`));
509
+ }
510
+ __name(isNumber, "isNumber");
511
+ function isString(info) {
512
+ return Rule((param) => typeof param === "string", info || ((k) => `'${k}' should be a string`));
513
+ }
514
+ __name(isString, "isString");
515
+ function isObject(info) {
516
+ return Rule((param) => {
517
+ return Object.prototype.toString.call(param) === "[object Object]";
518
+ }, info || ((k) => `'${k}' should be an object`));
519
+ }
520
+ __name(isObject, "isObject");
521
+ function isMobile(info) {
522
+ return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || ((k) => `'${k}' should be a mobile phone number`));
523
+ }
524
+ __name(isMobile, "isMobile");
525
+ function isLandline(info) {
526
+ return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || ((k) => `'${k}' should be a landline`));
527
+ }
528
+ __name(isLandline, "isLandline");
529
+ function isMailBox(info) {
530
+ return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || ((k) => `'${k}' should be a mailbox`));
531
+ }
532
+ __name(isMailBox, "isMailBox");
533
+ function isIdCard(info) {
534
+ return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || ((k) => `'${k}' should be an identity card number`));
535
+ }
536
+ __name(isIdCard, "isIdCard");
537
+ function isCnName(info) {
538
+ return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || ((k) => `'${k}' \u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57`));
539
+ }
540
+ __name(isCnName, "isCnName");
541
+ function isEnName(info) {
542
+ return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || ((k) => `'${k}' should be a valid en-name`));
543
+ }
544
+ __name(isEnName, "isEnName");
545
+ function isDate(info) {
546
+ return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || ((k) => `'${k}' should be a valid date`));
547
+ }
548
+ __name(isDate, "isDate");
549
+ function isWechat(info) {
550
+ return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || ((k) => `'${k}' should be a valid wechat`));
551
+ }
552
+ __name(isWechat, "isWechat");
553
+ function isHexColor(info) {
554
+ return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || ((k) => `'${k}' should be a valid hex-color`));
555
+ }
556
+ __name(isHexColor, "isHexColor");
557
+ function isPostalCode(info) {
558
+ return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || ((k) => `'${k}' should be a valid postal code`));
559
+ }
560
+ __name(isPostalCode, "isPostalCode");
561
+
562
+ // src/preset/pipe.ts
563
+ function toNumber() {
564
+ return Pipe(to((param) => Number(param)));
565
+ }
566
+ __name(toNumber, "toNumber");
567
+ function toString() {
568
+ return Pipe(to((param) => String(param)));
569
+ }
570
+ __name(toString, "toString");
494
571
  export {
495
572
  Assign,
496
573
  Bind,
@@ -529,7 +606,22 @@ export {
529
606
  getTag,
530
607
  init,
531
608
  injectProperty,
609
+ isArray,
610
+ isBoolean,
611
+ isCnName,
612
+ isDate,
613
+ isEnName,
614
+ isHexColor,
615
+ isIdCard,
616
+ isLandline,
617
+ isMailBox,
618
+ isMobile,
619
+ isNumber,
620
+ isObject,
532
621
  isPhecda,
622
+ isPostalCode,
623
+ isString,
624
+ isWechat,
533
625
  plainToClass,
534
626
  regisHandler,
535
627
  regisInitEvent,
@@ -541,5 +633,7 @@ export {
541
633
  setState,
542
634
  snapShot,
543
635
  to,
636
+ toNumber,
637
+ toString,
544
638
  validate
545
639
  };
@@ -0,0 +1,20 @@
1
+ declare function isArray(info?: string): (obj: any, key: PropertyKey) => void;
2
+ declare function isBoolean(info?: string): (obj: any, key: PropertyKey) => void;
3
+ declare function isNumber(info?: string): (obj: any, key: PropertyKey) => void;
4
+ declare function isString(info?: string): (obj: any, key: PropertyKey) => void;
5
+ declare function isObject(info?: string): (obj: any, key: PropertyKey) => void;
6
+ declare function isMobile(info?: string): (obj: any, key: PropertyKey) => void;
7
+ declare function isLandline(info?: string): (obj: any, key: PropertyKey) => void;
8
+ declare function isMailBox(info?: string): (obj: any, key: PropertyKey) => void;
9
+ declare function isIdCard(info?: string): (obj: any, key: PropertyKey) => void;
10
+ declare function isCnName(info?: string): (obj: any, key: PropertyKey) => void;
11
+ declare function isEnName(info?: string): (obj: any, key: PropertyKey) => void;
12
+ declare function isDate(info?: string): (obj: any, key: PropertyKey) => void;
13
+ declare function isWechat(info?: string): (obj: any, key: PropertyKey) => void;
14
+ declare function isHexColor(info?: string): (obj: any, key: PropertyKey) => void;
15
+ declare function isPostalCode(info?: string): (obj: any, key: PropertyKey) => void;
16
+
17
+ declare function toNumber(): (obj: any, key: PropertyKey) => void;
18
+ declare function toString(): (obj: any, key: PropertyKey) => void;
19
+
20
+ export { isBoolean as a, isNumber as b, isString as c, isObject as d, isMobile as e, isLandline as f, isMailBox as g, isIdCard as h, isArray as i, isCnName as j, isEnName as k, isDate as l, isWechat as m, isHexColor as n, isPostalCode as o, toString as p, toNumber as t };
@@ -1,20 +1 @@
1
- declare function isArray(info?: string): (obj: any, key: PropertyKey) => void;
2
- declare function isBoolean(info?: string): (obj: any, key: PropertyKey) => void;
3
- declare function isNumber(info?: string): (obj: any, key: PropertyKey) => void;
4
- declare function isString(info?: string): (obj: any, key: PropertyKey) => void;
5
- declare function isObject(info?: string): (obj: any, key: PropertyKey) => void;
6
- declare function isMobile(info?: string): (obj: any, key: PropertyKey) => void;
7
- declare function isLandline(info?: string): (obj: any, key: PropertyKey) => void;
8
- declare function isMailBox(info?: string): (obj: any, key: PropertyKey) => void;
9
- declare function isIdCard(info?: string): (obj: any, key: PropertyKey) => void;
10
- declare function isCnName(info?: string): (obj: any, key: PropertyKey) => void;
11
- declare function isEnName(info?: string): (obj: any, key: PropertyKey) => void;
12
- declare function isDate(info?: string): (obj: any, key: PropertyKey) => void;
13
- declare function isWechat(info?: string): (obj: any, key: PropertyKey) => void;
14
- declare function isHexColor(info?: string): (obj: any, key: PropertyKey) => void;
15
- declare function isPostalCode(info?: string): (obj: any, key: PropertyKey) => void;
16
-
17
- declare function toNumber(): (obj: any, key: PropertyKey) => void;
18
- declare function toString(): (obj: any, key: PropertyKey) => void;
19
-
20
- export { isArray, isBoolean, isCnName, isDate, isEnName, isHexColor, isIdCard, isLandline, isMailBox, isMobile, isNumber, isObject, isPostalCode, isString, isWechat, toNumber, toString };
1
+ export { i as isArray, a as isBoolean, j as isCnName, l as isDate, k as isEnName, n as isHexColor, h as isIdCard, f as isLandline, g as isMailBox, e as isMobile, b as isNumber, d as isObject, o as isPostalCode, c as isString, m as isWechat, t as toNumber, p as toString } from '../pipe-6da589ab.js';
@@ -107,68 +107,68 @@ var Phecda = (() => {
107
107
 
108
108
  // src/preset/rule.ts
109
109
  function isArray(info) {
110
- return Rule((param) => Array.isArray(param), info || "it should be an array");
110
+ return Rule((param) => Array.isArray(param), info || ((k) => `'${k}' should be an array`));
111
111
  }
112
112
  __name(isArray, "isArray");
113
113
  function isBoolean(info) {
114
114
  return Rule((param) => [
115
115
  true,
116
116
  false
117
- ].includes(param), info || "it should be true or false");
117
+ ].includes(param), info || ((k) => `'${k}' should be boolean`));
118
118
  }
119
119
  __name(isBoolean, "isBoolean");
120
120
  function isNumber(info) {
121
- return Rule((param) => typeof param === "number", info || "it should be true or false");
121
+ return Rule((param) => typeof param === "number", info || ((k) => `'${k}' should be number`));
122
122
  }
123
123
  __name(isNumber, "isNumber");
124
124
  function isString(info) {
125
- return Rule((param) => typeof param === "string", info || "it should be a string");
125
+ return Rule((param) => typeof param === "string", info || ((k) => `'${k}' should be a string`));
126
126
  }
127
127
  __name(isString, "isString");
128
128
  function isObject(info) {
129
129
  return Rule((param) => {
130
130
  return Object.prototype.toString.call(param) === "[object Object]";
131
- }, info || "it should be an object");
131
+ }, info || ((k) => `'${k}' should be an object`));
132
132
  }
133
133
  __name(isObject, "isObject");
134
134
  function isMobile(info) {
135
- return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || "it should be a mobile phone number");
135
+ return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || ((k) => `'${k}' should be a mobile phone number`));
136
136
  }
137
137
  __name(isMobile, "isMobile");
138
138
  function isLandline(info) {
139
- return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || "it should be a mobile phone number");
139
+ return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || ((k) => `'${k}' should be a landline`));
140
140
  }
141
141
  __name(isLandline, "isLandline");
142
142
  function isMailBox(info) {
143
- return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || "it should be a mailbox number");
143
+ return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || ((k) => `'${k}' should be a mailbox`));
144
144
  }
145
145
  __name(isMailBox, "isMailBox");
146
146
  function isIdCard(info) {
147
- return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || "it should be an identity card number");
147
+ return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || ((k) => `'${k}' should be an identity card number`));
148
148
  }
149
149
  __name(isIdCard, "isIdCard");
150
150
  function isCnName(info) {
151
- return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || "\u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57");
151
+ return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || ((k) => `'${k}' \u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57`));
152
152
  }
153
153
  __name(isCnName, "isCnName");
154
154
  function isEnName(info) {
155
- return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || "it should be a valid en-name");
155
+ return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || ((k) => `'${k}' should be a valid en-name`));
156
156
  }
157
157
  __name(isEnName, "isEnName");
158
158
  function isDate(info) {
159
- return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || "it should be a valid date");
159
+ return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || ((k) => `'${k}' should be a valid date`));
160
160
  }
161
161
  __name(isDate, "isDate");
162
162
  function isWechat(info) {
163
- return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || "it should be a valid date");
163
+ return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || ((k) => `'${k}' should be a valid wechat`));
164
164
  }
165
165
  __name(isWechat, "isWechat");
166
166
  function isHexColor(info) {
167
- return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || "it should be a valid hex-color");
167
+ return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || ((k) => `'${k}' should be a valid hex-color`));
168
168
  }
169
169
  __name(isHexColor, "isHexColor");
170
170
  function isPostalCode(info) {
171
- return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || "it should be a valid postal code");
171
+ return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || ((k) => `'${k}' should be a valid postal code`));
172
172
  }
173
173
  __name(isPostalCode, "isPostalCode");
174
174
 
@@ -107,68 +107,68 @@ __name(Pipe, "Pipe");
107
107
 
108
108
  // src/preset/rule.ts
109
109
  function isArray(info) {
110
- return Rule((param) => Array.isArray(param), info || "it should be an array");
110
+ return Rule((param) => Array.isArray(param), info || ((k) => `'${k}' should be an array`));
111
111
  }
112
112
  __name(isArray, "isArray");
113
113
  function isBoolean(info) {
114
114
  return Rule((param) => [
115
115
  true,
116
116
  false
117
- ].includes(param), info || "it should be true or false");
117
+ ].includes(param), info || ((k) => `'${k}' should be boolean`));
118
118
  }
119
119
  __name(isBoolean, "isBoolean");
120
120
  function isNumber(info) {
121
- return Rule((param) => typeof param === "number", info || "it should be true or false");
121
+ return Rule((param) => typeof param === "number", info || ((k) => `'${k}' should be number`));
122
122
  }
123
123
  __name(isNumber, "isNumber");
124
124
  function isString(info) {
125
- return Rule((param) => typeof param === "string", info || "it should be a string");
125
+ return Rule((param) => typeof param === "string", info || ((k) => `'${k}' should be a string`));
126
126
  }
127
127
  __name(isString, "isString");
128
128
  function isObject(info) {
129
129
  return Rule((param) => {
130
130
  return Object.prototype.toString.call(param) === "[object Object]";
131
- }, info || "it should be an object");
131
+ }, info || ((k) => `'${k}' should be an object`));
132
132
  }
133
133
  __name(isObject, "isObject");
134
134
  function isMobile(info) {
135
- return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || "it should be a mobile phone number");
135
+ return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || ((k) => `'${k}' should be a mobile phone number`));
136
136
  }
137
137
  __name(isMobile, "isMobile");
138
138
  function isLandline(info) {
139
- return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || "it should be a mobile phone number");
139
+ return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || ((k) => `'${k}' should be a landline`));
140
140
  }
141
141
  __name(isLandline, "isLandline");
142
142
  function isMailBox(info) {
143
- return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || "it should be a mailbox number");
143
+ return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || ((k) => `'${k}' should be a mailbox`));
144
144
  }
145
145
  __name(isMailBox, "isMailBox");
146
146
  function isIdCard(info) {
147
- return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || "it should be an identity card number");
147
+ return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || ((k) => `'${k}' should be an identity card number`));
148
148
  }
149
149
  __name(isIdCard, "isIdCard");
150
150
  function isCnName(info) {
151
- return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || "\u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57");
151
+ return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || ((k) => `'${k}' \u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57`));
152
152
  }
153
153
  __name(isCnName, "isCnName");
154
154
  function isEnName(info) {
155
- return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || "it should be a valid en-name");
155
+ return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || ((k) => `'${k}' should be a valid en-name`));
156
156
  }
157
157
  __name(isEnName, "isEnName");
158
158
  function isDate(info) {
159
- return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || "it should be a valid date");
159
+ return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || ((k) => `'${k}' should be a valid date`));
160
160
  }
161
161
  __name(isDate, "isDate");
162
162
  function isWechat(info) {
163
- return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || "it should be a valid date");
163
+ return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || ((k) => `'${k}' should be a valid wechat`));
164
164
  }
165
165
  __name(isWechat, "isWechat");
166
166
  function isHexColor(info) {
167
- return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || "it should be a valid hex-color");
167
+ return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || ((k) => `'${k}' should be a valid hex-color`));
168
168
  }
169
169
  __name(isHexColor, "isHexColor");
170
170
  function isPostalCode(info) {
171
- return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || "it should be a valid postal code");
171
+ return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || ((k) => `'${k}' should be a valid postal code`));
172
172
  }
173
173
  __name(isPostalCode, "isPostalCode");
174
174
 
@@ -67,68 +67,68 @@ __name(Pipe, "Pipe");
67
67
 
68
68
  // src/preset/rule.ts
69
69
  function isArray(info) {
70
- return Rule((param) => Array.isArray(param), info || "it should be an array");
70
+ return Rule((param) => Array.isArray(param), info || ((k) => `'${k}' should be an array`));
71
71
  }
72
72
  __name(isArray, "isArray");
73
73
  function isBoolean(info) {
74
74
  return Rule((param) => [
75
75
  true,
76
76
  false
77
- ].includes(param), info || "it should be true or false");
77
+ ].includes(param), info || ((k) => `'${k}' should be boolean`));
78
78
  }
79
79
  __name(isBoolean, "isBoolean");
80
80
  function isNumber(info) {
81
- return Rule((param) => typeof param === "number", info || "it should be true or false");
81
+ return Rule((param) => typeof param === "number", info || ((k) => `'${k}' should be number`));
82
82
  }
83
83
  __name(isNumber, "isNumber");
84
84
  function isString(info) {
85
- return Rule((param) => typeof param === "string", info || "it should be a string");
85
+ return Rule((param) => typeof param === "string", info || ((k) => `'${k}' should be a string`));
86
86
  }
87
87
  __name(isString, "isString");
88
88
  function isObject(info) {
89
89
  return Rule((param) => {
90
90
  return Object.prototype.toString.call(param) === "[object Object]";
91
- }, info || "it should be an object");
91
+ }, info || ((k) => `'${k}' should be an object`));
92
92
  }
93
93
  __name(isObject, "isObject");
94
94
  function isMobile(info) {
95
- return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || "it should be a mobile phone number");
95
+ return Rule(/^((\+|00)86)?1((3[\d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[\d])|(9[1,8,9]))\d{8}$/, info || ((k) => `'${k}' should be a mobile phone number`));
96
96
  }
97
97
  __name(isMobile, "isMobile");
98
98
  function isLandline(info) {
99
- return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || "it should be a mobile phone number");
99
+ return Rule(/\d{3}-\d{8}|\d{4}-\d{7}/, info || ((k) => `'${k}' should be a landline`));
100
100
  }
101
101
  __name(isLandline, "isLandline");
102
102
  function isMailBox(info) {
103
- return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || "it should be a mailbox number");
103
+ return Rule(/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, info || ((k) => `'${k}' should be a mailbox`));
104
104
  }
105
105
  __name(isMailBox, "isMailBox");
106
106
  function isIdCard(info) {
107
- return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || "it should be an identity card number");
107
+ return Rule(/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/, info || ((k) => `'${k}' should be an identity card number`));
108
108
  }
109
109
  __name(isIdCard, "isIdCard");
110
110
  function isCnName(info) {
111
- return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || "\u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57");
111
+ return Rule(/^([\u4E00-\u9FA5·]{2,16})$/, info || ((k) => `'${k}' \u9700\u8981\u662F\u4E00\u4E2A\u5408\u7406\u7684\u4E2D\u6587\u540D\u5B57`));
112
112
  }
113
113
  __name(isCnName, "isCnName");
114
114
  function isEnName(info) {
115
- return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || "it should be a valid en-name");
115
+ return Rule(/(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/, info || ((k) => `'${k}' should be a valid en-name`));
116
116
  }
117
117
  __name(isEnName, "isEnName");
118
118
  function isDate(info) {
119
- return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || "it should be a valid date");
119
+ return Rule(/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/, info || ((k) => `'${k}' should be a valid date`));
120
120
  }
121
121
  __name(isDate, "isDate");
122
122
  function isWechat(info) {
123
- return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || "it should be a valid date");
123
+ return Rule(/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/, info || ((k) => `'${k}' should be a valid wechat`));
124
124
  }
125
125
  __name(isWechat, "isWechat");
126
126
  function isHexColor(info) {
127
- return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || "it should be a valid hex-color");
127
+ return Rule(/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/, info || ((k) => `'${k}' should be a valid hex-color`));
128
128
  }
129
129
  __name(isHexColor, "isHexColor");
130
130
  function isPostalCode(info) {
131
- return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || "it should be a valid postal code");
131
+ return Rule(/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/, info || ((k) => `'${k}' should be a valid postal code`));
132
132
  }
133
133
  __name(isPostalCode, "isPostalCode");
134
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phecda-core",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "provide base function and abstract limit to other phecda module ",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",