manner.js 1.0.16 → 1.0.18

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.
Files changed (40) hide show
  1. package/client/class/ClientFetch.js +1 -1
  2. package/coverage/clover.xml +132 -67
  3. package/coverage/coverage-final.json +6 -4
  4. package/coverage/lcov-report/class/Blocks.js.html +17 -8
  5. package/coverage/lcov-report/class/MultiFetch.js.html +5 -2
  6. package/coverage/lcov-report/class/index.html +15 -15
  7. package/coverage/lcov-report/client/class/ClientFetch.js.html +379 -0
  8. package/coverage/lcov-report/client/class/index.html +116 -0
  9. package/coverage/lcov-report/index.html +41 -26
  10. package/coverage/lcov-report/lib/byteArray.js.html +1 -1
  11. package/coverage/lcov-report/lib/errorHandle.js.html +124 -0
  12. package/coverage/lcov-report/lib/formatHttpDate.js.html +1 -1
  13. package/coverage/lcov-report/lib/formatHttpKey.js.html +1 -1
  14. package/coverage/lcov-report/lib/getOwnIpAddresses.js.html +1 -1
  15. package/coverage/lcov-report/lib/index.html +23 -8
  16. package/coverage/lcov-report/lib/isIntranetIpv4Address.js.html +9 -9
  17. package/coverage/lcov-report/lib/isIpv6Address.js.html +4 -4
  18. package/coverage/lcov-report/lib/nonZeroByteArray.js.html +1 -1
  19. package/coverage/lcov-report/lib/parseHttpDate.js.html +1 -1
  20. package/coverage/lcov-report/lib/wrapIpv6.js.html +1 -1
  21. package/coverage/lcov-report/server/class/Blocks.js.html +403 -0
  22. package/coverage/lcov-report/server/class/MultiFetch.js.html +262 -0
  23. package/coverage/lcov-report/server/class/index.html +131 -0
  24. package/coverage/lcov-report/server/lib/byteArray.js.html +154 -0
  25. package/coverage/lcov-report/server/lib/errorHandle.js.html +124 -0
  26. package/coverage/lcov-report/server/lib/formatHttpDate.js.html +103 -0
  27. package/coverage/lcov-report/server/lib/formatHttpKey.js.html +100 -0
  28. package/coverage/lcov-report/server/lib/getOwnIpAddresses.js.html +220 -0
  29. package/coverage/lcov-report/server/lib/index.html +251 -0
  30. package/coverage/lcov-report/server/lib/isIntranetIpv4Address.js.html +196 -0
  31. package/coverage/lcov-report/server/lib/isIpv6Address.js.html +148 -0
  32. package/coverage/lcov-report/server/lib/nonZeroByteArray.js.html +157 -0
  33. package/coverage/lcov-report/server/lib/parseHttpDate.js.html +238 -0
  34. package/coverage/lcov-report/server/lib/wrapIpv6.js.html +94 -0
  35. package/coverage/lcov.info +226 -107
  36. package/package.json +1 -1
  37. package/server/class/Blocks.js +1 -1
  38. package/server/class/MultiFetch.js +1 -1
  39. package/server/index.js +1 -1
  40. package/server/lib/errorHandle.js +1 -0
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;class ClientFetch{constructor(){this.filters={}}addFilter(e,r){if(!(Number.isInteger(e)&&0<=e))throw new Error("[Error] The parameter status code should be a positive integer type.");if("function"!=typeof r)throw new Error("[Error] The parameter callback should be4 of function type.");var t=this.filters;if(void 0!==t[e])throw new Error("[Error] The current status code has been bound.");t[e]=r}async fetch(e,r){var t,e=await fetch(e,r);if(e.ok)return e;throw r=e.status,t=this.filters,await t[r](e),new Error("[Error] Receive an exception from the server.")}}var _default=exports.default=ClientFetch;
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;class ClientFetch{constructor(){this.filters={},this.hasTimeout=!0}setHasTimeout(r){if("boolean"!=typeof hashTimeout)throw new Error("[Error] The parameter has a timeout and needs to be a boolean type.");this.hasTimeout=r}isNewed(){let r=!1;return r=Array.isArray(this.abortControllers)&&Number.isInteger(this.idx)?!0:r}addFilter(r,e){if(!(Number.isInteger(r)&&0<=r))throw new Error("[Error] The parameter status code should be a positive integer type.");if("function"!=typeof e)throw new Error("[Error] The parameter callback should be4 of function type.");var t=this.filters;if(void 0!==t[r])throw new Error("[Error] The current status code has been bound.");t[r]=e}new(){this.idx=0,this.abortControllers=[]}renew(){var r=this.abortControllers;r.forEach(r=>{void 0!==r&&r.abort()}),this.idx=0,this.abortControllers=[]}async fetch(r,e){var{}=e,t=new AbortController;this.abortControllers[idx](t),this.idx+=1;let o;var i=this.hasTimeout;if(!0===i)try{o=await fetch(r,{signal:AbortSignal.any([AbortSignal.timeout(1e4),t.singal,...ownSignals]),...e})}catch(r){var i=r.name;"AbortError"===i&&(t=this.filters,await t[512](o))}else o=await fetch(r,{...e,headers:{"Has-Timeout":"false"}});if(o.ok)return this.abortControllers[idx]=void 0,o;throw i=o.status,t=this.filters,await t[i](o),new Error("[Error] Receive an exception from the server.")}}var _default=exports.default=ClientFetch;
@@ -1,11 +1,64 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <coverage generated="1751180313905" clover="3.2.0">
3
- <project timestamp="1751180313905" name="All files">
4
- <metrics statements="220" coveredstatements="168" conditionals="109" coveredconditionals="65" methods="25" coveredmethods="23" elements="354" coveredelements="256" complexity="0" loc="220" ncloc="220" packages="2" files="11" classes="11"/>
5
- <package name="class">
6
- <metrics statements="87" coveredstatements="62" conditionals="47" coveredconditionals="23" methods="12" coveredmethods="10"/>
2
+ <coverage generated="1751944998332" clover="3.2.0">
3
+ <project timestamp="1751944998332" name="All files">
4
+ <metrics statements="276" coveredstatements="175" conditionals="134" coveredconditionals="67" methods="35" coveredmethods="25" elements="445" coveredelements="267" complexity="0" loc="276" ncloc="276" packages="3" files="13" classes="13"/>
5
+ <package name="client.class">
6
+ <metrics statements="47" coveredstatements="0" conditionals="21" coveredconditionals="0" methods="8" coveredmethods="0"/>
7
+ <file name="ClientFetch.js" path="/Users/eric/Manner.js/manner.js/src/client/class/ClientFetch.js">
8
+ <metrics statements="47" coveredstatements="0" conditionals="21" coveredconditionals="0" methods="8" coveredmethods="0"/>
9
+ <line num="3" count="0" type="stmt"/>
10
+ <line num="4" count="0" type="stmt"/>
11
+ <line num="8" count="0" type="cond" truecount="0" falsecount="2"/>
12
+ <line num="9" count="0" type="stmt"/>
13
+ <line num="11" count="0" type="stmt"/>
14
+ <line num="15" count="0" type="stmt"/>
15
+ <line num="16" count="0" type="cond" truecount="0" falsecount="4"/>
16
+ <line num="17" count="0" type="stmt"/>
17
+ <line num="19" count="0" type="stmt"/>
18
+ <line num="23" count="0" type="cond" truecount="0" falsecount="4"/>
19
+ <line num="24" count="0" type="stmt"/>
20
+ <line num="26" count="0" type="cond" truecount="0" falsecount="2"/>
21
+ <line num="27" count="0" type="stmt"/>
22
+ <line num="29" count="0" type="stmt"/>
23
+ <line num="30" count="0" type="cond" truecount="0" falsecount="2"/>
24
+ <line num="31" count="0" type="stmt"/>
25
+ <line num="33" count="0" type="stmt"/>
26
+ <line num="37" count="0" type="stmt"/>
27
+ <line num="38" count="0" type="stmt"/>
28
+ <line num="42" count="0" type="stmt"/>
29
+ <line num="43" count="0" type="stmt"/>
30
+ <line num="44" count="0" type="cond" truecount="0" falsecount="2"/>
31
+ <line num="45" count="0" type="stmt"/>
32
+ <line num="48" count="0" type="stmt"/>
33
+ <line num="49" count="0" type="stmt"/>
34
+ <line num="53" count="0" type="stmt"/>
35
+ <line num="54" count="0" type="stmt"/>
36
+ <line num="55" count="0" type="stmt"/>
37
+ <line num="56" count="0" type="stmt"/>
38
+ <line num="58" count="0" type="stmt"/>
39
+ <line num="59" count="0" type="cond" truecount="0" falsecount="2"/>
40
+ <line num="60" count="0" type="stmt"/>
41
+ <line num="61" count="0" type="stmt"/>
42
+ <line num="70" count="0" type="stmt"/>
43
+ <line num="71" count="0" type="cond" truecount="0" falsecount="1"/>
44
+ <line num="73" count="0" type="stmt"/>
45
+ <line num="74" count="0" type="stmt"/>
46
+ <line num="75" count="0" type="stmt"/>
47
+ <line num="77" count="0" type="stmt"/>
48
+ <line num="81" count="0" type="stmt"/>
49
+ <line num="86" count="0" type="cond" truecount="0" falsecount="2"/>
50
+ <line num="87" count="0" type="stmt"/>
51
+ <line num="88" count="0" type="stmt"/>
52
+ <line num="90" count="0" type="stmt"/>
53
+ <line num="91" count="0" type="stmt"/>
54
+ <line num="92" count="0" type="stmt"/>
55
+ <line num="93" count="0" type="stmt"/>
56
+ </file>
57
+ </package>
58
+ <package name="server.class">
59
+ <metrics statements="89" coveredstatements="63" conditionals="49" coveredconditionals="24" methods="12" coveredmethods="10"/>
7
60
  <file name="Blocks.js" path="/Users/eric/Manner.js/manner.js/src/server/class/Blocks.js">
8
- <metrics statements="57" coveredstatements="45" conditionals="26" coveredconditionals="14" methods="9" coveredmethods="7"/>
61
+ <metrics statements="59" coveredstatements="46" conditionals="28" coveredconditionals="15" methods="9" coveredmethods="7"/>
9
62
  <line num="5" count="13" type="stmt"/>
10
63
  <line num="6" count="13" type="stmt"/>
11
64
  <line num="11" count="2" type="stmt"/>
@@ -17,89 +70,91 @@
17
70
  <line num="20" count="0" type="stmt"/>
18
71
  <line num="22" count="2" type="cond" truecount="1" falsecount="1"/>
19
72
  <line num="23" count="0" type="stmt"/>
20
- <line num="28" count="0" type="stmt"/>
21
- <line num="32" count="0" type="cond" truecount="0" falsecount="2"/>
22
- <line num="33" count="0" type="stmt"/>
73
+ <line num="25" count="2" type="cond" truecount="1" falsecount="1"/>
74
+ <line num="26" count="0" type="stmt"/>
75
+ <line num="31" count="0" type="stmt"/>
23
76
  <line num="35" count="0" type="cond" truecount="0" falsecount="2"/>
24
77
  <line num="36" count="0" type="stmt"/>
25
- <line num="38" count="0" type="stmt"/>
26
- <line num="43" count="3" type="cond" truecount="2" falsecount="0"/>
27
- <line num="44" count="2" type="stmt"/>
28
- <line num="45" count="1" type="cond" truecount="1" falsecount="1"/>
29
- <line num="46" count="1" type="stmt"/>
30
- <line num="48" count="0" type="stmt"/>
31
- <line num="50" count="3" type="stmt"/>
32
- <line num="51" count="3" type="cond" truecount="1" falsecount="1"/>
33
- <line num="52" count="3" type="stmt"/>
78
+ <line num="38" count="0" type="cond" truecount="0" falsecount="2"/>
79
+ <line num="39" count="0" type="stmt"/>
80
+ <line num="41" count="0" type="stmt"/>
81
+ <line num="46" count="3" type="cond" truecount="2" falsecount="0"/>
82
+ <line num="47" count="2" type="stmt"/>
83
+ <line num="48" count="1" type="cond" truecount="1" falsecount="1"/>
84
+ <line num="49" count="1" type="stmt"/>
85
+ <line num="51" count="0" type="stmt"/>
34
86
  <line num="53" count="3" type="stmt"/>
35
87
  <line num="54" count="3" type="cond" truecount="1" falsecount="1"/>
36
88
  <line num="55" count="3" type="stmt"/>
37
89
  <line num="56" count="3" type="stmt"/>
38
- <line num="62" count="14" type="stmt"/>
39
- <line num="63" count="14" type="stmt"/>
40
- <line num="64" count="14" type="cond" truecount="2" falsecount="0"/>
41
- <line num="65" count="4" type="stmt"/>
42
- <line num="66" count="4" type="stmt"/>
43
- <line num="67" count="4" type="stmt"/>
90
+ <line num="57" count="3" type="cond" truecount="1" falsecount="1"/>
91
+ <line num="58" count="3" type="stmt"/>
92
+ <line num="59" count="3" type="stmt"/>
93
+ <line num="65" count="14" type="stmt"/>
94
+ <line num="66" count="14" type="stmt"/>
95
+ <line num="67" count="14" type="cond" truecount="2" falsecount="0"/>
44
96
  <line num="68" count="4" type="stmt"/>
45
97
  <line num="69" count="4" type="stmt"/>
46
- <line num="71" count="10" type="stmt"/>
47
- <line num="72" count="10" type="stmt"/>
48
- <line num="73" count="10" type="cond" truecount="1" falsecount="1"/>
98
+ <line num="70" count="4" type="stmt"/>
99
+ <line num="71" count="4" type="stmt"/>
100
+ <line num="72" count="4" type="stmt"/>
49
101
  <line num="74" count="10" type="stmt"/>
50
102
  <line num="75" count="10" type="stmt"/>
51
- <line num="76" count="10" type="stmt"/>
103
+ <line num="76" count="10" type="cond" truecount="1" falsecount="1"/>
52
104
  <line num="77" count="10" type="stmt"/>
53
105
  <line num="78" count="10" type="stmt"/>
54
- <line num="80" count="0" type="stmt"/>
55
- <line num="81" count="0" type="stmt"/>
56
- <line num="84" count="14" type="stmt"/>
57
- <line num="88" count="14" type="cond" truecount="1" falsecount="1"/>
58
- <line num="89" count="14" type="stmt"/>
59
- <line num="90" count="14" type="cond" truecount="2" falsecount="0"/>
60
- <line num="91" count="7" type="stmt"/>
61
- <line num="92" count="7" type="stmt"/>
62
- <line num="93" count="7" type="cond" truecount="1" falsecount="1"/>
106
+ <line num="79" count="10" type="stmt"/>
107
+ <line num="80" count="10" type="stmt"/>
108
+ <line num="81" count="10" type="stmt"/>
109
+ <line num="83" count="0" type="stmt"/>
110
+ <line num="84" count="0" type="stmt"/>
111
+ <line num="87" count="14" type="stmt"/>
112
+ <line num="91" count="14" type="cond" truecount="1" falsecount="1"/>
113
+ <line num="92" count="14" type="stmt"/>
114
+ <line num="93" count="14" type="cond" truecount="2" falsecount="0"/>
63
115
  <line num="94" count="7" type="stmt"/>
64
116
  <line num="95" count="7" type="stmt"/>
65
- <line num="97" count="0" type="stmt"/>
117
+ <line num="96" count="7" type="cond" truecount="1" falsecount="1"/>
118
+ <line num="97" count="7" type="stmt"/>
119
+ <line num="98" count="7" type="stmt"/>
120
+ <line num="100" count="0" type="stmt"/>
66
121
  </file>
67
122
  <file name="MultiFetch.js" path="/Users/eric/Manner.js/manner.js/src/server/class/MultiFetch.js">
68
123
  <metrics statements="30" coveredstatements="17" conditionals="21" coveredconditionals="9" methods="3" coveredmethods="3"/>
69
- <line num="8" count="1" type="stmt"/>
70
124
  <line num="9" count="1" type="stmt"/>
71
125
  <line num="10" count="1" type="stmt"/>
72
- <line num="11" count="1" type="cond" truecount="1" falsecount="1"/>
73
- <line num="12" count="0" type="stmt"/>
74
- <line num="17" count="1" type="cond" truecount="1" falsecount="1"/>
75
- <line num="18" count="0" type="stmt"/>
126
+ <line num="11" count="1" type="stmt"/>
127
+ <line num="12" count="1" type="cond" truecount="1" falsecount="1"/>
128
+ <line num="13" count="0" type="stmt"/>
129
+ <line num="18" count="1" type="cond" truecount="1" falsecount="1"/>
76
130
  <line num="19" count="0" type="stmt"/>
77
- <line num="20" count="0" type="cond" truecount="0" falsecount="2"/>
78
- <line num="21" count="0" type="stmt"/>
79
- <line num="24" count="1" type="cond" truecount="1" falsecount="1"/>
80
- <line num="25" count="0" type="cond" truecount="0" falsecount="2"/>
81
- <line num="26" count="0" type="stmt"/>
82
- <line num="28" count="0" type="cond" truecount="0" falsecount="2"/>
83
- <line num="29" count="0" type="stmt"/>
84
- <line num="35" count="20" type="cond" truecount="1" falsecount="1"/>
85
- <line num="36" count="0" type="stmt"/>
86
- <line num="38" count="20" type="cond" truecount="1" falsecount="1"/>
87
- <line num="39" count="0" type="stmt"/>
88
- <line num="41" count="20" type="stmt"/>
89
- <line num="42" count="20" type="cond" truecount="2" falsecount="0"/>
90
- <line num="43" count="16" type="stmt"/>
91
- <line num="45" count="4" type="stmt"/>
92
- <line num="47" count="20" type="stmt"/>
131
+ <line num="20" count="0" type="stmt"/>
132
+ <line num="21" count="0" type="cond" truecount="0" falsecount="2"/>
133
+ <line num="22" count="0" type="stmt"/>
134
+ <line num="25" count="1" type="cond" truecount="1" falsecount="1"/>
135
+ <line num="26" count="0" type="cond" truecount="0" falsecount="2"/>
136
+ <line num="27" count="0" type="stmt"/>
137
+ <line num="29" count="0" type="cond" truecount="0" falsecount="2"/>
138
+ <line num="30" count="0" type="stmt"/>
139
+ <line num="36" count="20" type="cond" truecount="1" falsecount="1"/>
140
+ <line num="37" count="0" type="stmt"/>
141
+ <line num="39" count="20" type="cond" truecount="1" falsecount="1"/>
142
+ <line num="40" count="0" type="stmt"/>
143
+ <line num="42" count="20" type="stmt"/>
144
+ <line num="43" count="20" type="cond" truecount="2" falsecount="0"/>
145
+ <line num="44" count="16" type="stmt"/>
146
+ <line num="46" count="4" type="stmt"/>
93
147
  <line num="48" count="20" type="stmt"/>
94
- <line num="49" count="20" type="cond" truecount="1" falsecount="1"/>
95
- <line num="50" count="0" type="stmt"/>
148
+ <line num="49" count="20" type="stmt"/>
149
+ <line num="50" count="20" type="cond" truecount="1" falsecount="1"/>
96
150
  <line num="51" count="0" type="stmt"/>
97
- <line num="53" count="20" type="stmt"/>
151
+ <line num="52" count="0" type="stmt"/>
98
152
  <line num="54" count="20" type="stmt"/>
153
+ <line num="55" count="20" type="stmt"/>
99
154
  </file>
100
155
  </package>
101
- <package name="lib">
102
- <metrics statements="133" coveredstatements="106" conditionals="62" coveredconditionals="42" methods="13" coveredmethods="13"/>
156
+ <package name="server.lib">
157
+ <metrics statements="140" coveredstatements="112" conditionals="64" coveredconditionals="43" methods="15" coveredmethods="15"/>
103
158
  <file name="byteArray.js" path="/Users/eric/Manner.js/manner.js/src/server/lib/byteArray.js">
104
159
  <metrics statements="14" coveredstatements="14" conditionals="2" coveredconditionals="1" methods="2" coveredmethods="2"/>
105
160
  <line num="1" count="1" type="stmt"/>
@@ -117,6 +172,16 @@
117
172
  <line num="20" count="4" type="stmt"/>
118
173
  <line num="22" count="1" type="stmt"/>
119
174
  </file>
175
+ <file name="errorHandle.js" path="/Users/eric/Manner.js/manner.js/src/server/lib/errorHandle.js">
176
+ <metrics statements="7" coveredstatements="6" conditionals="2" coveredconditionals="1" methods="2" coveredmethods="2"/>
177
+ <line num="2" count="2" type="cond" truecount="1" falsecount="1"/>
178
+ <line num="3" count="0" type="stmt"/>
179
+ <line num="5" count="2" type="stmt"/>
180
+ <line num="6" count="2" type="stmt"/>
181
+ <line num="7" count="2" type="stmt"/>
182
+ <line num="9" count="1" type="stmt"/>
183
+ <line num="10" count="1" type="stmt"/>
184
+ </file>
120
185
  <file name="formatHttpDate.js" path="/Users/eric/Manner.js/manner.js/src/server/lib/formatHttpDate.js">
121
186
  <metrics statements="4" coveredstatements="4" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
122
187
  <line num="2" count="1" type="stmt"/>
@@ -189,11 +254,11 @@
189
254
  <line num="2" count="3" type="stmt"/>
190
255
  <line num="3" count="3" type="stmt"/>
191
256
  <line num="4" count="3" type="stmt"/>
192
- <line num="5" count="99" type="stmt"/>
193
- <line num="6" count="99" type="cond" truecount="3" falsecount="0"/>
257
+ <line num="5" count="98" type="stmt"/>
258
+ <line num="6" count="98" type="cond" truecount="3" falsecount="0"/>
194
259
  <line num="9" count="22" type="stmt"/>
195
260
  <line num="10" count="22" type="stmt"/>
196
- <line num="12" count="77" type="cond" truecount="5" falsecount="1"/>
261
+ <line num="12" count="76" type="cond" truecount="5" falsecount="1"/>
197
262
  <line num="13" count="0" type="stmt"/>
198
263
  <line num="17" count="3" type="cond" truecount="2" falsecount="0"/>
199
264
  <line num="18" count="1" type="stmt"/>