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.
- package/client/class/ClientFetch.js +1 -1
- package/coverage/clover.xml +132 -67
- package/coverage/coverage-final.json +6 -4
- package/coverage/lcov-report/class/Blocks.js.html +17 -8
- package/coverage/lcov-report/class/MultiFetch.js.html +5 -2
- package/coverage/lcov-report/class/index.html +15 -15
- package/coverage/lcov-report/client/class/ClientFetch.js.html +379 -0
- package/coverage/lcov-report/client/class/index.html +116 -0
- package/coverage/lcov-report/index.html +41 -26
- package/coverage/lcov-report/lib/byteArray.js.html +1 -1
- package/coverage/lcov-report/lib/errorHandle.js.html +124 -0
- package/coverage/lcov-report/lib/formatHttpDate.js.html +1 -1
- package/coverage/lcov-report/lib/formatHttpKey.js.html +1 -1
- package/coverage/lcov-report/lib/getOwnIpAddresses.js.html +1 -1
- package/coverage/lcov-report/lib/index.html +23 -8
- package/coverage/lcov-report/lib/isIntranetIpv4Address.js.html +9 -9
- package/coverage/lcov-report/lib/isIpv6Address.js.html +4 -4
- package/coverage/lcov-report/lib/nonZeroByteArray.js.html +1 -1
- package/coverage/lcov-report/lib/parseHttpDate.js.html +1 -1
- package/coverage/lcov-report/lib/wrapIpv6.js.html +1 -1
- package/coverage/lcov-report/server/class/Blocks.js.html +403 -0
- package/coverage/lcov-report/server/class/MultiFetch.js.html +262 -0
- package/coverage/lcov-report/server/class/index.html +131 -0
- package/coverage/lcov-report/server/lib/byteArray.js.html +154 -0
- package/coverage/lcov-report/server/lib/errorHandle.js.html +124 -0
- package/coverage/lcov-report/server/lib/formatHttpDate.js.html +103 -0
- package/coverage/lcov-report/server/lib/formatHttpKey.js.html +100 -0
- package/coverage/lcov-report/server/lib/getOwnIpAddresses.js.html +220 -0
- package/coverage/lcov-report/server/lib/index.html +251 -0
- package/coverage/lcov-report/server/lib/isIntranetIpv4Address.js.html +196 -0
- package/coverage/lcov-report/server/lib/isIpv6Address.js.html +148 -0
- package/coverage/lcov-report/server/lib/nonZeroByteArray.js.html +157 -0
- package/coverage/lcov-report/server/lib/parseHttpDate.js.html +238 -0
- package/coverage/lcov-report/server/lib/wrapIpv6.js.html +94 -0
- package/coverage/lcov.info +226 -107
- package/package.json +1 -1
- package/server/class/Blocks.js +1 -1
- package/server/class/MultiFetch.js +1 -1
- package/server/index.js +1 -1
- package/server/lib/errorHandle.js +1 -0
package/coverage/lcov.info
CHANGED
|
@@ -1,14 +1,107 @@
|
|
|
1
1
|
TN:
|
|
2
|
+
SF:src/client/class/ClientFetch.js
|
|
3
|
+
FN:2,(anonymous_0)
|
|
4
|
+
FN:7,(anonymous_1)
|
|
5
|
+
FN:14,(anonymous_2)
|
|
6
|
+
FN:22,(anonymous_3)
|
|
7
|
+
FN:36,(anonymous_4)
|
|
8
|
+
FN:41,(anonymous_5)
|
|
9
|
+
FN:43,(anonymous_6)
|
|
10
|
+
FN:52,(anonymous_7)
|
|
11
|
+
FNF:8
|
|
12
|
+
FNH:0
|
|
13
|
+
FNDA:0,(anonymous_0)
|
|
14
|
+
FNDA:0,(anonymous_1)
|
|
15
|
+
FNDA:0,(anonymous_2)
|
|
16
|
+
FNDA:0,(anonymous_3)
|
|
17
|
+
FNDA:0,(anonymous_4)
|
|
18
|
+
FNDA:0,(anonymous_5)
|
|
19
|
+
FNDA:0,(anonymous_6)
|
|
20
|
+
FNDA:0,(anonymous_7)
|
|
21
|
+
DA:3,0
|
|
22
|
+
DA:4,0
|
|
23
|
+
DA:8,0
|
|
24
|
+
DA:9,0
|
|
25
|
+
DA:11,0
|
|
26
|
+
DA:15,0
|
|
27
|
+
DA:16,0
|
|
28
|
+
DA:17,0
|
|
29
|
+
DA:19,0
|
|
30
|
+
DA:23,0
|
|
31
|
+
DA:24,0
|
|
32
|
+
DA:26,0
|
|
33
|
+
DA:27,0
|
|
34
|
+
DA:29,0
|
|
35
|
+
DA:30,0
|
|
36
|
+
DA:31,0
|
|
37
|
+
DA:33,0
|
|
38
|
+
DA:37,0
|
|
39
|
+
DA:38,0
|
|
40
|
+
DA:42,0
|
|
41
|
+
DA:43,0
|
|
42
|
+
DA:44,0
|
|
43
|
+
DA:45,0
|
|
44
|
+
DA:48,0
|
|
45
|
+
DA:49,0
|
|
46
|
+
DA:53,0
|
|
47
|
+
DA:54,0
|
|
48
|
+
DA:55,0
|
|
49
|
+
DA:56,0
|
|
50
|
+
DA:58,0
|
|
51
|
+
DA:59,0
|
|
52
|
+
DA:60,0
|
|
53
|
+
DA:61,0
|
|
54
|
+
DA:70,0
|
|
55
|
+
DA:71,0
|
|
56
|
+
DA:73,0
|
|
57
|
+
DA:74,0
|
|
58
|
+
DA:75,0
|
|
59
|
+
DA:77,0
|
|
60
|
+
DA:81,0
|
|
61
|
+
DA:86,0
|
|
62
|
+
DA:87,0
|
|
63
|
+
DA:88,0
|
|
64
|
+
DA:90,0
|
|
65
|
+
DA:91,0
|
|
66
|
+
DA:92,0
|
|
67
|
+
DA:93,0
|
|
68
|
+
LF:47
|
|
69
|
+
LH:0
|
|
70
|
+
BRDA:8,0,0,0
|
|
71
|
+
BRDA:8,0,1,0
|
|
72
|
+
BRDA:16,1,0,0
|
|
73
|
+
BRDA:16,1,1,0
|
|
74
|
+
BRDA:16,2,0,0
|
|
75
|
+
BRDA:16,2,1,0
|
|
76
|
+
BRDA:23,3,0,0
|
|
77
|
+
BRDA:23,3,1,0
|
|
78
|
+
BRDA:23,4,0,0
|
|
79
|
+
BRDA:23,4,1,0
|
|
80
|
+
BRDA:26,5,0,0
|
|
81
|
+
BRDA:26,5,1,0
|
|
82
|
+
BRDA:30,6,0,0
|
|
83
|
+
BRDA:30,6,1,0
|
|
84
|
+
BRDA:44,7,0,0
|
|
85
|
+
BRDA:44,7,1,0
|
|
86
|
+
BRDA:59,8,0,0
|
|
87
|
+
BRDA:59,8,1,0
|
|
88
|
+
BRDA:71,9,0,0
|
|
89
|
+
BRDA:86,10,0,0
|
|
90
|
+
BRDA:86,10,1,0
|
|
91
|
+
BRF:21
|
|
92
|
+
BRH:0
|
|
93
|
+
end_of_record
|
|
94
|
+
TN:
|
|
2
95
|
SF:src/server/class/Blocks.js
|
|
3
96
|
FN:4,getIntervalFromTime
|
|
4
97
|
FN:10,(anonymous_1)
|
|
5
98
|
FN:18,(anonymous_2)
|
|
6
|
-
FN:
|
|
7
|
-
FN:
|
|
8
|
-
FN:
|
|
9
|
-
FN:
|
|
10
|
-
FN:
|
|
11
|
-
FN:
|
|
99
|
+
FN:30,(anonymous_3)
|
|
100
|
+
FN:34,(anonymous_4)
|
|
101
|
+
FN:44,(anonymous_5)
|
|
102
|
+
FN:64,(anonymous_6)
|
|
103
|
+
FN:72,(anonymous_7)
|
|
104
|
+
FN:90,(anonymous_8)
|
|
12
105
|
FNF:9
|
|
13
106
|
FNH:7
|
|
14
107
|
FNDA:13,getIntervalFromTime
|
|
@@ -31,146 +124,150 @@ DA:19,2
|
|
|
31
124
|
DA:20,0
|
|
32
125
|
DA:22,2
|
|
33
126
|
DA:23,0
|
|
34
|
-
DA:
|
|
35
|
-
DA:
|
|
36
|
-
DA:
|
|
127
|
+
DA:25,2
|
|
128
|
+
DA:26,0
|
|
129
|
+
DA:31,0
|
|
37
130
|
DA:35,0
|
|
38
131
|
DA:36,0
|
|
39
132
|
DA:38,0
|
|
40
|
-
DA:
|
|
41
|
-
DA:
|
|
42
|
-
DA:
|
|
43
|
-
DA:
|
|
44
|
-
DA:48,
|
|
45
|
-
DA:
|
|
46
|
-
DA:51,
|
|
47
|
-
DA:52,3
|
|
133
|
+
DA:39,0
|
|
134
|
+
DA:41,0
|
|
135
|
+
DA:46,3
|
|
136
|
+
DA:47,2
|
|
137
|
+
DA:48,1
|
|
138
|
+
DA:49,1
|
|
139
|
+
DA:51,0
|
|
48
140
|
DA:53,3
|
|
49
141
|
DA:54,3
|
|
50
142
|
DA:55,3
|
|
51
143
|
DA:56,3
|
|
52
|
-
DA:
|
|
53
|
-
DA:
|
|
54
|
-
DA:
|
|
55
|
-
DA:65,
|
|
56
|
-
DA:66,
|
|
57
|
-
DA:67,
|
|
144
|
+
DA:57,3
|
|
145
|
+
DA:58,3
|
|
146
|
+
DA:59,3
|
|
147
|
+
DA:65,14
|
|
148
|
+
DA:66,14
|
|
149
|
+
DA:67,14
|
|
58
150
|
DA:68,4
|
|
59
151
|
DA:69,4
|
|
60
|
-
DA:
|
|
61
|
-
DA:
|
|
62
|
-
DA:
|
|
152
|
+
DA:70,4
|
|
153
|
+
DA:71,4
|
|
154
|
+
DA:72,4
|
|
63
155
|
DA:74,10
|
|
64
156
|
DA:75,10
|
|
65
157
|
DA:76,10
|
|
66
158
|
DA:77,10
|
|
67
159
|
DA:78,10
|
|
68
|
-
DA:
|
|
69
|
-
DA:
|
|
70
|
-
DA:
|
|
71
|
-
DA:
|
|
72
|
-
DA:
|
|
73
|
-
DA:
|
|
74
|
-
DA:91,
|
|
75
|
-
DA:92,
|
|
76
|
-
DA:93,
|
|
160
|
+
DA:79,10
|
|
161
|
+
DA:80,10
|
|
162
|
+
DA:81,10
|
|
163
|
+
DA:83,0
|
|
164
|
+
DA:84,0
|
|
165
|
+
DA:87,14
|
|
166
|
+
DA:91,14
|
|
167
|
+
DA:92,14
|
|
168
|
+
DA:93,14
|
|
77
169
|
DA:94,7
|
|
78
170
|
DA:95,7
|
|
79
|
-
DA:
|
|
80
|
-
|
|
81
|
-
|
|
171
|
+
DA:96,7
|
|
172
|
+
DA:97,7
|
|
173
|
+
DA:98,7
|
|
174
|
+
DA:100,0
|
|
175
|
+
LF:59
|
|
176
|
+
LH:46
|
|
82
177
|
BRDA:19,0,0,0
|
|
83
178
|
BRDA:19,0,1,2
|
|
84
179
|
BRDA:22,1,0,0
|
|
85
180
|
BRDA:22,1,1,2
|
|
86
|
-
BRDA:
|
|
87
|
-
BRDA:
|
|
181
|
+
BRDA:25,2,0,0
|
|
182
|
+
BRDA:25,2,1,2
|
|
88
183
|
BRDA:35,3,0,0
|
|
89
184
|
BRDA:35,3,1,0
|
|
90
|
-
BRDA:
|
|
91
|
-
BRDA:
|
|
92
|
-
BRDA:
|
|
93
|
-
BRDA:
|
|
94
|
-
BRDA:
|
|
95
|
-
BRDA:
|
|
185
|
+
BRDA:38,4,0,0
|
|
186
|
+
BRDA:38,4,1,0
|
|
187
|
+
BRDA:46,5,0,2
|
|
188
|
+
BRDA:46,5,1,1
|
|
189
|
+
BRDA:48,6,0,1
|
|
190
|
+
BRDA:48,6,1,0
|
|
96
191
|
BRDA:54,7,0,3
|
|
97
192
|
BRDA:54,7,1,0
|
|
98
|
-
BRDA:
|
|
99
|
-
BRDA:
|
|
100
|
-
BRDA:
|
|
101
|
-
BRDA:
|
|
102
|
-
BRDA:
|
|
103
|
-
BRDA:
|
|
104
|
-
BRDA:
|
|
105
|
-
BRDA:
|
|
193
|
+
BRDA:57,8,0,3
|
|
194
|
+
BRDA:57,8,1,0
|
|
195
|
+
BRDA:67,9,0,4
|
|
196
|
+
BRDA:67,9,1,10
|
|
197
|
+
BRDA:76,10,0,10
|
|
198
|
+
BRDA:76,10,1,0
|
|
199
|
+
BRDA:91,11,0,14
|
|
200
|
+
BRDA:91,11,1,0
|
|
106
201
|
BRDA:93,12,0,7
|
|
107
|
-
BRDA:93,12,1,
|
|
108
|
-
|
|
109
|
-
|
|
202
|
+
BRDA:93,12,1,7
|
|
203
|
+
BRDA:96,13,0,7
|
|
204
|
+
BRDA:96,13,1,0
|
|
205
|
+
BRF:28
|
|
206
|
+
BRH:15
|
|
110
207
|
end_of_record
|
|
111
208
|
TN:
|
|
112
209
|
SF:src/server/class/MultiFetch.js
|
|
113
|
-
FN:
|
|
114
|
-
FN:
|
|
115
|
-
FN:
|
|
210
|
+
FN:8,(anonymous_0)
|
|
211
|
+
FN:17,(anonymous_1)
|
|
212
|
+
FN:35,(anonymous_2)
|
|
116
213
|
FNF:3
|
|
117
214
|
FNH:3
|
|
118
215
|
FNDA:1,(anonymous_0)
|
|
119
216
|
FNDA:1,(anonymous_1)
|
|
120
217
|
FNDA:20,(anonymous_2)
|
|
121
|
-
DA:8,1
|
|
122
218
|
DA:9,1
|
|
123
219
|
DA:10,1
|
|
124
220
|
DA:11,1
|
|
125
|
-
DA:12,
|
|
126
|
-
DA:
|
|
127
|
-
DA:18,
|
|
221
|
+
DA:12,1
|
|
222
|
+
DA:13,0
|
|
223
|
+
DA:18,1
|
|
128
224
|
DA:19,0
|
|
129
225
|
DA:20,0
|
|
130
226
|
DA:21,0
|
|
131
|
-
DA:
|
|
132
|
-
DA:25,
|
|
227
|
+
DA:22,0
|
|
228
|
+
DA:25,1
|
|
133
229
|
DA:26,0
|
|
134
|
-
DA:
|
|
230
|
+
DA:27,0
|
|
135
231
|
DA:29,0
|
|
136
|
-
DA:
|
|
137
|
-
DA:36,
|
|
138
|
-
DA:
|
|
139
|
-
DA:39,
|
|
140
|
-
DA:
|
|
232
|
+
DA:30,0
|
|
233
|
+
DA:36,20
|
|
234
|
+
DA:37,0
|
|
235
|
+
DA:39,20
|
|
236
|
+
DA:40,0
|
|
141
237
|
DA:42,20
|
|
142
|
-
DA:43,
|
|
143
|
-
DA:
|
|
144
|
-
DA:
|
|
238
|
+
DA:43,20
|
|
239
|
+
DA:44,16
|
|
240
|
+
DA:46,4
|
|
145
241
|
DA:48,20
|
|
146
242
|
DA:49,20
|
|
147
|
-
DA:50,
|
|
243
|
+
DA:50,20
|
|
148
244
|
DA:51,0
|
|
149
|
-
DA:
|
|
245
|
+
DA:52,0
|
|
150
246
|
DA:54,20
|
|
247
|
+
DA:55,20
|
|
151
248
|
LF:30
|
|
152
249
|
LH:17
|
|
153
|
-
BRDA:
|
|
154
|
-
BRDA:
|
|
155
|
-
BRDA:
|
|
156
|
-
BRDA:
|
|
157
|
-
BRDA:
|
|
158
|
-
BRDA:
|
|
159
|
-
BRDA:
|
|
160
|
-
BRDA:
|
|
161
|
-
BRDA:
|
|
162
|
-
BRDA:
|
|
163
|
-
BRDA:
|
|
164
|
-
BRDA:
|
|
165
|
-
BRDA:
|
|
166
|
-
BRDA:
|
|
167
|
-
BRDA:
|
|
168
|
-
BRDA:
|
|
169
|
-
BRDA:
|
|
170
|
-
BRDA:
|
|
171
|
-
BRDA:
|
|
172
|
-
BRDA:
|
|
173
|
-
BRDA:
|
|
250
|
+
BRDA:12,0,0,0
|
|
251
|
+
BRDA:12,0,1,1
|
|
252
|
+
BRDA:18,1,0,0
|
|
253
|
+
BRDA:18,1,1,1
|
|
254
|
+
BRDA:21,2,0,0
|
|
255
|
+
BRDA:21,2,1,0
|
|
256
|
+
BRDA:25,3,0,0
|
|
257
|
+
BRDA:25,3,1,1
|
|
258
|
+
BRDA:26,4,0,0
|
|
259
|
+
BRDA:26,4,1,0
|
|
260
|
+
BRDA:29,5,0,0
|
|
261
|
+
BRDA:29,5,1,0
|
|
262
|
+
BRDA:35,6,0,20
|
|
263
|
+
BRDA:36,7,0,0
|
|
264
|
+
BRDA:36,7,1,20
|
|
265
|
+
BRDA:39,8,0,0
|
|
266
|
+
BRDA:39,8,1,20
|
|
267
|
+
BRDA:43,9,0,16
|
|
268
|
+
BRDA:43,9,1,4
|
|
269
|
+
BRDA:50,10,0,0
|
|
270
|
+
BRDA:50,10,1,20
|
|
174
271
|
BRF:21
|
|
175
272
|
BRH:9
|
|
176
273
|
end_of_record
|
|
@@ -204,6 +301,28 @@ BRF:2
|
|
|
204
301
|
BRH:1
|
|
205
302
|
end_of_record
|
|
206
303
|
TN:
|
|
304
|
+
SF:src/server/lib/errorHandle.js
|
|
305
|
+
FN:1,errorHandle
|
|
306
|
+
FN:5,(anonymous_1)
|
|
307
|
+
FNF:2
|
|
308
|
+
FNH:2
|
|
309
|
+
FNDA:2,errorHandle
|
|
310
|
+
FNDA:2,(anonymous_1)
|
|
311
|
+
DA:2,2
|
|
312
|
+
DA:3,0
|
|
313
|
+
DA:5,2
|
|
314
|
+
DA:6,2
|
|
315
|
+
DA:7,2
|
|
316
|
+
DA:9,1
|
|
317
|
+
DA:10,1
|
|
318
|
+
LF:7
|
|
319
|
+
LH:6
|
|
320
|
+
BRDA:2,0,0,0
|
|
321
|
+
BRDA:2,0,1,2
|
|
322
|
+
BRF:2
|
|
323
|
+
BRH:1
|
|
324
|
+
end_of_record
|
|
325
|
+
TN:
|
|
207
326
|
SF:src/server/lib/formatHttpDate.js
|
|
208
327
|
FN:1,formatHttpDate
|
|
209
328
|
FNF:1
|
|
@@ -350,11 +469,11 @@ FNDA:3,isIpv6Address
|
|
|
350
469
|
DA:2,3
|
|
351
470
|
DA:3,3
|
|
352
471
|
DA:4,3
|
|
353
|
-
DA:5,
|
|
354
|
-
DA:6,
|
|
472
|
+
DA:5,98
|
|
473
|
+
DA:6,98
|
|
355
474
|
DA:9,22
|
|
356
475
|
DA:10,22
|
|
357
|
-
DA:12,
|
|
476
|
+
DA:12,76
|
|
358
477
|
DA:13,0
|
|
359
478
|
DA:17,3
|
|
360
479
|
DA:18,1
|
|
@@ -363,13 +482,13 @@ LF:12
|
|
|
363
482
|
LH:11
|
|
364
483
|
BRDA:6,0,0,3
|
|
365
484
|
BRDA:6,0,1,22
|
|
366
|
-
BRDA:6,0,2,
|
|
485
|
+
BRDA:6,0,2,76
|
|
367
486
|
BRDA:12,1,0,0
|
|
368
|
-
BRDA:12,1,1,
|
|
369
|
-
BRDA:12,2,0,
|
|
370
|
-
BRDA:12,2,1,
|
|
371
|
-
BRDA:12,2,2,
|
|
372
|
-
BRDA:12,2,3,
|
|
487
|
+
BRDA:12,1,1,76
|
|
488
|
+
BRDA:12,2,0,76
|
|
489
|
+
BRDA:12,2,1,76
|
|
490
|
+
BRDA:12,2,2,16
|
|
491
|
+
BRDA:12,2,3,16
|
|
373
492
|
BRDA:17,3,0,1
|
|
374
493
|
BRDA:17,3,1,2
|
|
375
494
|
BRF:11
|
package/package.json
CHANGED
package/server/class/Blocks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _net=_interopRequireDefault(require("net")),_advising=require("advising.js");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getIntervalFromTime(e){var
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _net=_interopRequireDefault(require("net")),_advising=require("advising.js");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getIntervalFromTime(e){var r=(new Date).getTime();return Math.floor(r-e)}class Blocks{constructor(e){this.dealParams(e),this.interval=e,this.count=0,this.ipv4Blocks=new _advising.Ipv4Router({debug:!1,hideError:!0}),this.ipv6Blocks=new _advising.Ipv6Router({debug:!1,hideError:!0})}dealParams(e){if(!Number.isInteger(e))throw new Error("[Error] The interval parameter should be of integer type.");if(e<=0)throw new Error("[Error] The interval should be a positive integer otherwise it has no meaning.");if(!Number.isInteger(e/500))throw new Error("[Error] The parameter interval should be divisible by 500 milliseconds.")}getCount(){return this.count}setInterval(e){if(!Number.isInteger(e))throw new Error("[Error] The interval parameter should be of integer type.");if(e<=0)throw new Error("[Error] The interval should be a positive integer otherwise it has no meaning.");this.interval=e}cleanIpAddress(e,r){let t;if(_net.default.isIPv4(e))t=this.ipv4Blocks;else{if(!_net.default.isIPv6(e))throw new Error("[Error] The Ip type is not expected");t=this.ipv6Blocks}var i=t.gain(e);void 0!==i&&(i=i.time,r<=getIntervalFromTime(i))&&(t.ruin(e),this.count=0)}examineIpAddress(e,r){let t=!0;var i,n=r.gain(e);return void 0===n?(i=(new Date).getTime(),i=(r.attach(e,{time:i,count:1}),this.count=1,this).interval,setTimeout(()=>this.cleanIpAddress(e,this.interval),i)):(i=n.time,getIntervalFromTime(i)<this.interval?(n=n.count,r.revise(e,{time:i,count:n+=1}),this.count=n,t=!1):(r.ruin(e),this.count=0)),t}examine(e){if(void 0!==e){var r,{}=this;if(_net.default.isIPv4(e))return r=this.ipv4Blocks,this.examineIpAddress(e,r);if(_net.default.isIPv6(e))return r=this.ipv6Blocks,this.examineIpAddress(e,r);throw new Error("[Error] The Ip type is not expected.")}}}var _default=exports.default=Blocks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _https=_interopRequireDefault(require("https")),_net=_interopRequireDefault(require("net")),_nodeFetch=_interopRequireDefault(require("node-fetch")),_advising=require("advising.js");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class MultiFetch{constructor(e,r){this.index=-1,this.dealParams(e,r),this.bases=e,void 0!==r&&(this.interval=r)}dealParams(e,r){if(!Array.isArray(e))throw new Error("[Error] The bases parameter bases should be a array type.");if(void 0!==r){if(!Number.isInteger(r))throw new Error("[Error] The interval parameter should be of integer type.");if(r<=0)throw new Error("[Error] The interval should be a positive integer otherwise it has no meaning.")}}async fetch(e,r,t=0){if("string"!=typeof e)throw new Error("[Error] The path parameter path should be of string type.");if("object"!=typeof r)throw new Error("[Error] The options parameter should be a object type.");var i=this.bases,a=(this.index<i.length-1?this.index+=1:this.index=0,this).index,i=i[a],a=(i.startsWith("https")&&(a=new _https.default.Agent({rejectUnauthorized:!1}),r.agent=a),i+e);return(0,_nodeFetch.default)(a,r)}}var _default=exports.default=MultiFetch;
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _https=_interopRequireDefault(require("https")),_http=_interopRequireDefault(require("http")),_net=_interopRequireDefault(require("net")),_nodeFetch=_interopRequireDefault(require("node-fetch")),_advising=require("advising.js");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class MultiFetch{constructor(e,r){this.index=-1,this.dealParams(e,r),this.bases=e,void 0!==r&&(this.interval=r)}dealParams(e,r){if(!Array.isArray(e))throw new Error("[Error] The bases parameter bases should be a array type.");if(void 0!==r){if(!Number.isInteger(r))throw new Error("[Error] The interval parameter should be of integer type.");if(r<=0)throw new Error("[Error] The interval should be a positive integer otherwise it has no meaning.")}}async fetch(e,r,t=0){if("string"!=typeof e)throw new Error("[Error] The path parameter path should be of string type.");if("object"!=typeof r)throw new Error("[Error] The options parameter should be a object type.");var i=this.bases,a=(this.index<i.length-1?this.index+=1:this.index=0,this).index,i=i[a],a=(i.startsWith("https")&&(a=new _https.default.Agent({rejectUnauthorized:!1}),r.agent=a),i+e);return(0,_nodeFetch.default)(a,r)}}var _default=exports.default=MultiFetch;
|
package/server/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Blocks",{enumerable:!0,get:function(){return _Blocks.default}}),Object.defineProperty(exports,"MultiFetch",{enumerable:!0,get:function(){return _MultiFetch.default}}),exports.byteArray=void 0,Object.defineProperty(exports,"formatHttpDate",{enumerable:!0,get:function(){return _formatHttpDate.default}}),Object.defineProperty(exports,"formatHttpKey",{enumerable:!0,get:function(){return _formatHttpKey.default}}),Object.defineProperty(exports,"getOwnIpAddresses",{enumerable:!0,get:function(){return _getOwnIpAddresses.default}}),Object.defineProperty(exports,"isIntranetIpv4Address",{enumerable:!0,get:function(){return _isIntranetIpv4Address.default}}),Object.defineProperty(exports,"isIpv6Address",{enumerable:!0,get:function(){return _isIpv6Address.default}}),exports.nonZeroByteArray=void 0,Object.defineProperty(exports,"parseHttpDate",{enumerable:!0,get:function(){return _parseHttpDate.default}}),Object.defineProperty(exports,"readCookie",{enumerable:!0,get:function(){return _readCookie.default}}),Object.defineProperty(exports,"wrapIpv6",{enumerable:!0,get:function(){return _wrapIpv.default}});var _MultiFetch=_interopRequireDefault(require("./class/MultiFetch")),_Blocks=_interopRequireDefault(require("./class/Blocks")),_readCookie=_interopRequireDefault(require("./lib/readCookie")),_formatHttpKey=_interopRequireDefault(require("./lib/formatHttpKey")),_formatHttpDate=_interopRequireDefault(require("./lib/formatHttpDate")),_parseHttpDate=_interopRequireDefault(require("./lib/parseHttpDate")),_isIntranetIpv4Address=_interopRequireDefault(require("./lib/isIntranetIpv4Address")),_isIpv6Address=_interopRequireDefault(require("./lib/isIpv6Address")),_getOwnIpAddresses=_interopRequireDefault(require("./lib/getOwnIpAddresses")),_wrapIpv=_interopRequireDefault(require("./lib/wrapIpv6")),_byteArray=_interopRequireWildcard(require("./lib/byteArray")),_nonZeroByteArray=(exports.byteArray=_byteArray,_interopRequireWildcard(require("./lib/nonZeroByteArray")));function _interopRequireWildcard(e,r){var o,u;return"function"==typeof WeakMap&&(o=new WeakMap,u=new WeakMap),(_interopRequireWildcard=function(r,e){if(!e&&r&&r.__esModule)return r;var t,n,i={__proto__:null,default:r};if(null!==r&&("object"==typeof r||"function"==typeof r)){if(t=e?u:o){if(t.has(r))return t.get(r);t.set(r,i)}for(let e in r)"default"!==e&&{}.hasOwnProperty.call(r,e)&&((n=(t=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,e))&&(n.get||n.set)?t(i,e,n):i[e]=r[e])}return i})(e,r)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}exports.nonZeroByteArray=_nonZeroByteArray;
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Blocks",{enumerable:!0,get:function(){return _Blocks.default}}),Object.defineProperty(exports,"MultiFetch",{enumerable:!0,get:function(){return _MultiFetch.default}}),exports.byteArray=void 0,Object.defineProperty(exports,"errorHandle",{enumerable:!0,get:function(){return _errorHandle.default}}),Object.defineProperty(exports,"formatHttpDate",{enumerable:!0,get:function(){return _formatHttpDate.default}}),Object.defineProperty(exports,"formatHttpKey",{enumerable:!0,get:function(){return _formatHttpKey.default}}),Object.defineProperty(exports,"getOwnIpAddresses",{enumerable:!0,get:function(){return _getOwnIpAddresses.default}}),Object.defineProperty(exports,"isIntranetIpv4Address",{enumerable:!0,get:function(){return _isIntranetIpv4Address.default}}),Object.defineProperty(exports,"isIpv6Address",{enumerable:!0,get:function(){return _isIpv6Address.default}}),exports.nonZeroByteArray=void 0,Object.defineProperty(exports,"parseHttpDate",{enumerable:!0,get:function(){return _parseHttpDate.default}}),Object.defineProperty(exports,"readCookie",{enumerable:!0,get:function(){return _readCookie.default}}),Object.defineProperty(exports,"wrapIpv6",{enumerable:!0,get:function(){return _wrapIpv.default}});var _MultiFetch=_interopRequireDefault(require("./class/MultiFetch")),_Blocks=_interopRequireDefault(require("./class/Blocks")),_readCookie=_interopRequireDefault(require("./lib/readCookie")),_formatHttpKey=_interopRequireDefault(require("./lib/formatHttpKey")),_formatHttpDate=_interopRequireDefault(require("./lib/formatHttpDate")),_parseHttpDate=_interopRequireDefault(require("./lib/parseHttpDate")),_isIntranetIpv4Address=_interopRequireDefault(require("./lib/isIntranetIpv4Address")),_isIpv6Address=_interopRequireDefault(require("./lib/isIpv6Address")),_getOwnIpAddresses=_interopRequireDefault(require("./lib/getOwnIpAddresses")),_wrapIpv=_interopRequireDefault(require("./lib/wrapIpv6")),_errorHandle=_interopRequireDefault(require("./lib/errorHandle")),_byteArray=_interopRequireWildcard(require("./lib/byteArray")),_nonZeroByteArray=(exports.byteArray=_byteArray,_interopRequireWildcard(require("./lib/nonZeroByteArray")));function _interopRequireWildcard(e,r){var o,u;return"function"==typeof WeakMap&&(o=new WeakMap,u=new WeakMap),(_interopRequireWildcard=function(r,e){if(!e&&r&&r.__esModule)return r;var t,n,i={__proto__:null,default:r};if(null!==r&&("object"==typeof r||"function"==typeof r)){if(t=e?u:o){if(t.has(r))return t.get(r);t.set(r,i)}for(let e in r)"default"!==e&&{}.hasOwnProperty.call(r,e)&&((n=(t=Object.defineProperty)&&Object.getOwnPropertyDescriptor(r,e))&&(n.get||n.set)?t(i,e,n):i[e]=r[e])}return i})(e,r)}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}exports.nonZeroByteArray=_nonZeroByteArray;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function errorHandle(t){if("function"!=typeof t)throw new Error("[Error] The parameter request listener needs to be of function type.");return async(e,r)=>{try{await t(e,r)}catch(e){r.writeHead(500),r.end()}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=errorHandle;
|