lakutata 2.0.29 → 2.0.31

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/README.md CHANGED
@@ -28,8 +28,8 @@ to freely encapsulate and call third-party modules using Lakutata's dependency i
28
28
 
29
29
  ## ✨ Getting started
30
30
 
31
- - 👉 To check out the **[guide](http://docs.lakutata.com)**, visit **[docs.lakutata.com](http://docs.lakutata.com)**.
32
- - 👉 To see usage **[examples](http://examples.lakutata.com)**, visit **[examples.lakutata.com](http://examples.lakutata.com)**.
31
+ - 👉 Check out the **[guide](https://github.com/lakutata/lakutata/blob/main/doc/en/Overview.md)**.
32
+ - 👉 查看 **[指南](https://github.com/lakutata/lakutata/blob/main/doc/zh/Overview.md)**。
33
33
 
34
34
  ## 🌎 License
35
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lakutata",
3
- "version": "2.0.29",
3
+ "version": "2.0.31",
4
4
  "description": "An IoC-based universal application framework.",
5
5
  "exports": {
6
6
  ".": {
@@ -4,9 +4,9 @@ Object.defineProperty(exports, Symbol.toStringTag, {
4
4
  value: "Module"
5
5
  });
6
6
 
7
- const e = require("../../../constants/DIMetadataKey.cjs");
7
+ const t = require("../../../constants/DIMetadataKey.cjs");
8
8
 
9
- const t = require("../../helpers/ObjectConstructor.cjs");
9
+ const e = require("../../helpers/ObjectConstructor.cjs");
10
10
 
11
11
  const r = require("../../helpers/ObjectParentConstructors.cjs");
12
12
 
@@ -19,37 +19,46 @@ require("../../helpers/As.cjs");
19
19
  require("../../helpers/ObjectParentConstructor.cjs");
20
20
 
21
21
  function c(c, a, n, o) {
22
- let s;
23
- if (Reflect.hasOwnMetadata(e.DI_TARGET_CONSTRUCTOR_INJECTS, t.ObjectConstructor(c))) {
24
- s = Reflect.getOwnMetadata(e.DI_TARGET_CONSTRUCTOR_INJECTS, t.ObjectConstructor(c));
22
+ let T;
23
+ if (Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e.ObjectConstructor(c))) {
24
+ T = Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e.ObjectConstructor(c));
25
25
  } else {
26
- s = new Map;
26
+ T = new Map;
27
27
  const a = [];
28
- r.ObjectParentConstructors(t.ObjectConstructor(c)).forEach((t => {
29
- if (Reflect.hasOwnMetadata(e.DI_TARGET_CONSTRUCTOR_INJECTS, t)) a.unshift(Reflect.getOwnMetadata(e.DI_TARGET_CONSTRUCTOR_INJECTS, t));
28
+ r.ObjectParentConstructors(e.ObjectConstructor(c)).forEach((e => {
29
+ if (Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e)) a.unshift(Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e));
30
30
  }));
31
- a.forEach((e => e.forEach(((e, t) => s.set(t, e)))));
31
+ a.forEach((t => t.forEach(((t, e) => T.set(e, t)))));
32
32
  }
33
- s.set(a, {
33
+ T.set(a, {
34
34
  name: n,
35
35
  transform: o
36
36
  });
37
- Reflect.defineMetadata(e.DI_TARGET_CONSTRUCTOR_INJECTS, s, t.ObjectConstructor(c));
37
+ Reflect.defineMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, T, e.ObjectConstructor(c));
38
38
  }
39
39
 
40
- function a(r) {
41
- const c = Reflect.getOwnMetadata(e.DI_TARGET_CONSTRUCTOR_INJECTS, t.ObjectConstructor(r));
42
- if (c) return c;
40
+ function a(c) {
41
+ const a = Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e.ObjectConstructor(c)) || new Map;
42
+ r.ObjectParentConstructors(e.ObjectConstructor(c)).forEach((e => {
43
+ if (Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e)) {
44
+ const r = Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_INJECTS, e);
45
+ r.forEach(((t, e) => {
46
+ if (a.has(e)) return;
47
+ a.set(e, t);
48
+ }));
49
+ }
50
+ }));
51
+ if (a) return a;
43
52
  return new Map;
44
53
  }
45
54
 
46
- function n(t) {
47
- if (!Reflect.hasOwnMetadata(e.DI_TARGET_CONSTRUCTOR_AUTOLOAD, t)) Reflect.defineMetadata(e.DI_TARGET_CONSTRUCTOR_AUTOLOAD, true, t);
48
- return t;
55
+ function n(e) {
56
+ if (!Reflect.hasOwnMetadata(t.DI_TARGET_CONSTRUCTOR_AUTOLOAD, e)) Reflect.defineMetadata(t.DI_TARGET_CONSTRUCTOR_AUTOLOAD, true, e);
57
+ return e;
49
58
  }
50
59
 
51
- function o(t) {
52
- return !!Reflect.getOwnMetadata(e.DI_TARGET_CONSTRUCTOR_AUTOLOAD, t);
60
+ function o(e) {
61
+ return !!Reflect.getOwnMetadata(t.DI_TARGET_CONSTRUCTOR_AUTOLOAD, e);
53
62
  }
54
63
 
55
64
  exports.GetObjectInjectItemsByPrototype = a;
@@ -12,7 +12,7 @@ import "../../helpers/As.mjs";
12
12
 
13
13
  import "../../helpers/ObjectParentConstructor.mjs";
14
14
 
15
- function n(e, n, o, s) {
15
+ function n(e, n, f, o) {
16
16
  let c;
17
17
  if (Reflect.hasOwnMetadata(t, a(e))) {
18
18
  c = Reflect.getOwnMetadata(t, a(e));
@@ -25,19 +25,28 @@ function n(e, n, o, s) {
25
25
  n.forEach((t => t.forEach(((t, e) => c.set(e, t)))));
26
26
  }
27
27
  c.set(n, {
28
- name: o,
29
- transform: s
28
+ name: f,
29
+ transform: o
30
30
  });
31
31
  Reflect.defineMetadata(t, c, a(e));
32
32
  }
33
33
 
34
- function o(e) {
35
- const r = Reflect.getOwnMetadata(t, a(e));
36
- if (r) return r;
34
+ function f(e) {
35
+ const n = Reflect.getOwnMetadata(t, a(e)) || new Map;
36
+ r(a(e)).forEach((e => {
37
+ if (Reflect.hasOwnMetadata(t, e)) {
38
+ const a = Reflect.getOwnMetadata(t, e);
39
+ a.forEach(((t, e) => {
40
+ if (n.has(e)) return;
41
+ n.set(e, t);
42
+ }));
43
+ }
44
+ }));
45
+ if (n) return n;
37
46
  return new Map;
38
47
  }
39
48
 
40
- function s(t) {
49
+ function o(t) {
41
50
  if (!Reflect.hasOwnMetadata(e, t)) Reflect.defineMetadata(e, true, t);
42
51
  return t;
43
52
  }
@@ -46,4 +55,4 @@ function c(t) {
46
55
  return !!Reflect.getOwnMetadata(e, t);
47
56
  }
48
57
 
49
- export { o as GetObjectInjectItemsByPrototype, c as GetObjectIsAutoload, s as MarkObjectAsAutoload, n as SetObjectInjectItem };
58
+ export { f as GetObjectInjectItemsByPrototype, c as GetObjectIsAutoload, o as MarkObjectAsAutoload, n as SetObjectInjectItem };
@@ -149,6 +149,9 @@ class Time extends Date {
149
149
  toISOString() {
150
150
  return this.#e.toISOString();
151
151
  }
152
+ toDate() {
153
+ return this.#e.toDate();
154
+ }
152
155
  isBefore(e, t) {
153
156
  return this.#e.isBefore(new Time(e).#e, t);
154
157
  }
@@ -143,6 +143,9 @@ class Time extends Date {
143
143
  toISOString() {
144
144
  return this.#e.toISOString();
145
145
  }
146
+ toDate() {
147
+ return this.#e.toDate();
148
+ }
146
149
  isBefore(e, t) {
147
150
  return this.#e.isBefore(new Time(e).#e, t);
148
151
  }
@@ -10649,7 +10649,7 @@ class ValidateMethods {
10649
10649
 
10650
10650
  const Kr = s.As(Xr.extend((e => ({
10651
10651
  type: "number",
10652
- base: e.number().integer(),
10652
+ base: e.number(),
10653
10653
  messages: {
10654
10654
  "number.int8": "{{#label}} must be a valid Int8 value (between -128 and 127)",
10655
10655
  "number.uint8": "{{#label}} must be a valid UInt8 value (between 0 and 255)",
@@ -10663,7 +10663,21 @@ const Kr = s.As(Xr.extend((e => ({
10663
10663
  rules: {
10664
10664
  int8: {
10665
10665
  method() {
10666
- return this.$_addRule({
10666
+ return this.$_addRule("integer").$_addRule(s.As({
10667
+ name: "min",
10668
+ method: "compare",
10669
+ args: {
10670
+ limit: -128
10671
+ },
10672
+ operator: ">="
10673
+ })).$_addRule(s.As({
10674
+ name: "max",
10675
+ method: "compare",
10676
+ args: {
10677
+ limit: 127
10678
+ },
10679
+ operator: "<="
10680
+ })).$_addRule({
10667
10681
  name: "int8"
10668
10682
  });
10669
10683
  },
@@ -10675,7 +10689,21 @@ const Kr = s.As(Xr.extend((e => ({
10675
10689
  },
10676
10690
  uint8: {
10677
10691
  method() {
10678
- return this.$_addRule({
10692
+ return this.$_addRule("integer").$_addRule(s.As({
10693
+ name: "min",
10694
+ method: "compare",
10695
+ args: {
10696
+ limit: 0
10697
+ },
10698
+ operator: ">="
10699
+ })).$_addRule(s.As({
10700
+ name: "max",
10701
+ method: "compare",
10702
+ args: {
10703
+ limit: 255
10704
+ },
10705
+ operator: "<="
10706
+ })).$_addRule({
10679
10707
  name: "uint8"
10680
10708
  });
10681
10709
  },
@@ -10687,7 +10715,21 @@ const Kr = s.As(Xr.extend((e => ({
10687
10715
  },
10688
10716
  int16: {
10689
10717
  method() {
10690
- return this.$_addRule({
10718
+ return this.$_addRule("integer").$_addRule(s.As({
10719
+ name: "min",
10720
+ method: "compare",
10721
+ args: {
10722
+ limit: -32768
10723
+ },
10724
+ operator: ">="
10725
+ })).$_addRule(s.As({
10726
+ name: "max",
10727
+ method: "compare",
10728
+ args: {
10729
+ limit: 32767
10730
+ },
10731
+ operator: "<="
10732
+ })).$_addRule({
10691
10733
  name: "int16"
10692
10734
  });
10693
10735
  },
@@ -10699,7 +10741,21 @@ const Kr = s.As(Xr.extend((e => ({
10699
10741
  },
10700
10742
  uint16: {
10701
10743
  method() {
10702
- return this.$_addRule({
10744
+ return this.$_addRule("integer").$_addRule(s.As({
10745
+ name: "min",
10746
+ method: "compare",
10747
+ args: {
10748
+ limit: 0
10749
+ },
10750
+ operator: ">="
10751
+ })).$_addRule(s.As({
10752
+ name: "max",
10753
+ method: "compare",
10754
+ args: {
10755
+ limit: 65535
10756
+ },
10757
+ operator: "<="
10758
+ })).$_addRule({
10703
10759
  name: "uint16"
10704
10760
  });
10705
10761
  },
@@ -10711,7 +10767,21 @@ const Kr = s.As(Xr.extend((e => ({
10711
10767
  },
10712
10768
  int32: {
10713
10769
  method() {
10714
- return this.$_addRule({
10770
+ return this.$_addRule("integer").$_addRule(s.As({
10771
+ name: "min",
10772
+ method: "compare",
10773
+ args: {
10774
+ limit: -2147483648
10775
+ },
10776
+ operator: ">="
10777
+ })).$_addRule(s.As({
10778
+ name: "max",
10779
+ method: "compare",
10780
+ args: {
10781
+ limit: 2147483647
10782
+ },
10783
+ operator: "<="
10784
+ })).$_addRule({
10715
10785
  name: "int32"
10716
10786
  });
10717
10787
  },
@@ -10723,7 +10793,21 @@ const Kr = s.As(Xr.extend((e => ({
10723
10793
  },
10724
10794
  uint32: {
10725
10795
  method() {
10726
- return this.$_addRule({
10796
+ return this.$_addRule("integer").$_addRule(s.As({
10797
+ name: "min",
10798
+ method: "compare",
10799
+ args: {
10800
+ limit: 0
10801
+ },
10802
+ operator: ">="
10803
+ })).$_addRule(s.As({
10804
+ name: "max",
10805
+ method: "compare",
10806
+ args: {
10807
+ limit: 4294967295
10808
+ },
10809
+ operator: "<="
10810
+ })).$_addRule({
10727
10811
  name: "uint32"
10728
10812
  });
10729
10813
  },
@@ -10735,7 +10819,21 @@ const Kr = s.As(Xr.extend((e => ({
10735
10819
  },
10736
10820
  int64: {
10737
10821
  method() {
10738
- return this.$_addRule({
10822
+ return this.$_addRule("integer").$_addRule(s.As({
10823
+ name: "min",
10824
+ method: "compare",
10825
+ args: {
10826
+ limit: -9007199254740991
10827
+ },
10828
+ operator: ">="
10829
+ })).$_addRule(s.As({
10830
+ name: "max",
10831
+ method: "compare",
10832
+ args: {
10833
+ limit: 9007199254740991
10834
+ },
10835
+ operator: "<="
10836
+ })).$_addRule({
10739
10837
  name: "int64"
10740
10838
  });
10741
10839
  },
@@ -10749,7 +10847,21 @@ const Kr = s.As(Xr.extend((e => ({
10749
10847
  },
10750
10848
  uint64: {
10751
10849
  method() {
10752
- return this.$_addRule({
10850
+ return this.$_addRule("integer").$_addRule(s.As({
10851
+ name: "min",
10852
+ method: "compare",
10853
+ args: {
10854
+ limit: 0
10855
+ },
10856
+ operator: ">="
10857
+ })).$_addRule(s.As({
10858
+ name: "max",
10859
+ method: "compare",
10860
+ args: {
10861
+ limit: 9007199254740991
10862
+ },
10863
+ operator: "<="
10864
+ })).$_addRule({
10753
10865
  name: "uint64"
10754
10866
  });
10755
10867
  },
@@ -10635,7 +10635,7 @@ class ValidateMethods {
10635
10635
 
10636
10636
  const Fr = s(Ur.extend((e => ({
10637
10637
  type: "number",
10638
- base: e.number().integer(),
10638
+ base: e.number(),
10639
10639
  messages: {
10640
10640
  "number.int8": "{{#label}} must be a valid Int8 value (between -128 and 127)",
10641
10641
  "number.uint8": "{{#label}} must be a valid UInt8 value (between 0 and 255)",
@@ -10649,7 +10649,21 @@ const Fr = s(Ur.extend((e => ({
10649
10649
  rules: {
10650
10650
  int8: {
10651
10651
  method() {
10652
- return this.$_addRule({
10652
+ return this.$_addRule("integer").$_addRule(s({
10653
+ name: "min",
10654
+ method: "compare",
10655
+ args: {
10656
+ limit: -128
10657
+ },
10658
+ operator: ">="
10659
+ })).$_addRule(s({
10660
+ name: "max",
10661
+ method: "compare",
10662
+ args: {
10663
+ limit: 127
10664
+ },
10665
+ operator: "<="
10666
+ })).$_addRule({
10653
10667
  name: "int8"
10654
10668
  });
10655
10669
  },
@@ -10661,7 +10675,21 @@ const Fr = s(Ur.extend((e => ({
10661
10675
  },
10662
10676
  uint8: {
10663
10677
  method() {
10664
- return this.$_addRule({
10678
+ return this.$_addRule("integer").$_addRule(s({
10679
+ name: "min",
10680
+ method: "compare",
10681
+ args: {
10682
+ limit: 0
10683
+ },
10684
+ operator: ">="
10685
+ })).$_addRule(s({
10686
+ name: "max",
10687
+ method: "compare",
10688
+ args: {
10689
+ limit: 255
10690
+ },
10691
+ operator: "<="
10692
+ })).$_addRule({
10665
10693
  name: "uint8"
10666
10694
  });
10667
10695
  },
@@ -10673,7 +10701,21 @@ const Fr = s(Ur.extend((e => ({
10673
10701
  },
10674
10702
  int16: {
10675
10703
  method() {
10676
- return this.$_addRule({
10704
+ return this.$_addRule("integer").$_addRule(s({
10705
+ name: "min",
10706
+ method: "compare",
10707
+ args: {
10708
+ limit: -32768
10709
+ },
10710
+ operator: ">="
10711
+ })).$_addRule(s({
10712
+ name: "max",
10713
+ method: "compare",
10714
+ args: {
10715
+ limit: 32767
10716
+ },
10717
+ operator: "<="
10718
+ })).$_addRule({
10677
10719
  name: "int16"
10678
10720
  });
10679
10721
  },
@@ -10685,7 +10727,21 @@ const Fr = s(Ur.extend((e => ({
10685
10727
  },
10686
10728
  uint16: {
10687
10729
  method() {
10688
- return this.$_addRule({
10730
+ return this.$_addRule("integer").$_addRule(s({
10731
+ name: "min",
10732
+ method: "compare",
10733
+ args: {
10734
+ limit: 0
10735
+ },
10736
+ operator: ">="
10737
+ })).$_addRule(s({
10738
+ name: "max",
10739
+ method: "compare",
10740
+ args: {
10741
+ limit: 65535
10742
+ },
10743
+ operator: "<="
10744
+ })).$_addRule({
10689
10745
  name: "uint16"
10690
10746
  });
10691
10747
  },
@@ -10697,7 +10753,21 @@ const Fr = s(Ur.extend((e => ({
10697
10753
  },
10698
10754
  int32: {
10699
10755
  method() {
10700
- return this.$_addRule({
10756
+ return this.$_addRule("integer").$_addRule(s({
10757
+ name: "min",
10758
+ method: "compare",
10759
+ args: {
10760
+ limit: -2147483648
10761
+ },
10762
+ operator: ">="
10763
+ })).$_addRule(s({
10764
+ name: "max",
10765
+ method: "compare",
10766
+ args: {
10767
+ limit: 2147483647
10768
+ },
10769
+ operator: "<="
10770
+ })).$_addRule({
10701
10771
  name: "int32"
10702
10772
  });
10703
10773
  },
@@ -10709,7 +10779,21 @@ const Fr = s(Ur.extend((e => ({
10709
10779
  },
10710
10780
  uint32: {
10711
10781
  method() {
10712
- return this.$_addRule({
10782
+ return this.$_addRule("integer").$_addRule(s({
10783
+ name: "min",
10784
+ method: "compare",
10785
+ args: {
10786
+ limit: 0
10787
+ },
10788
+ operator: ">="
10789
+ })).$_addRule(s({
10790
+ name: "max",
10791
+ method: "compare",
10792
+ args: {
10793
+ limit: 4294967295
10794
+ },
10795
+ operator: "<="
10796
+ })).$_addRule({
10713
10797
  name: "uint32"
10714
10798
  });
10715
10799
  },
@@ -10721,7 +10805,21 @@ const Fr = s(Ur.extend((e => ({
10721
10805
  },
10722
10806
  int64: {
10723
10807
  method() {
10724
- return this.$_addRule({
10808
+ return this.$_addRule("integer").$_addRule(s({
10809
+ name: "min",
10810
+ method: "compare",
10811
+ args: {
10812
+ limit: -9007199254740991
10813
+ },
10814
+ operator: ">="
10815
+ })).$_addRule(s({
10816
+ name: "max",
10817
+ method: "compare",
10818
+ args: {
10819
+ limit: 9007199254740991
10820
+ },
10821
+ operator: "<="
10822
+ })).$_addRule({
10725
10823
  name: "int64"
10726
10824
  });
10727
10825
  },
@@ -10735,7 +10833,21 @@ const Fr = s(Ur.extend((e => ({
10735
10833
  },
10736
10834
  uint64: {
10737
10835
  method() {
10738
- return this.$_addRule({
10836
+ return this.$_addRule("integer").$_addRule(s({
10837
+ name: "min",
10838
+ method: "compare",
10839
+ args: {
10840
+ limit: 0
10841
+ },
10842
+ operator: ">="
10843
+ })).$_addRule(s({
10844
+ name: "max",
10845
+ method: "compare",
10846
+ args: {
10847
+ limit: 9007199254740991
10848
+ },
10849
+ operator: "<="
10850
+ })).$_addRule({
10739
10851
  name: "uint64"
10740
10852
  });
10741
10853
  },