manner.js 1.0.27 → 1.0.29
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/coverage/clover.xml +122 -72
- package/coverage/coverage-final.json +5 -3
- package/coverage/lcov-report/class/Blocks.js.html +47 -170
- package/coverage/lcov-report/class/MultiFetch.js.html +26 -8
- package/coverage/lcov-report/class/Prevents.js.html +361 -0
- package/coverage/lcov-report/class/Tackles.js.html +199 -0
- package/coverage/lcov-report/class/index.html +58 -28
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/lib/byteArray.js.html +1 -1
- package/coverage/lcov-report/lib/errorHandle.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/lib/isIntranetIpv4Address.js.html +1 -1
- 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.info +230 -128
- package/package.json +2 -2
- package/server/class/Blocks.js +1 -1
- package/server/class/MultiFetch.js +1 -1
- package/server/class/Prevents.js +1 -0
- package/server/class/Tackles.js +1 -0
- package/server/index.js +1 -1
- package/server/class/Blockable.js +0 -1
package/coverage/lcov.info
CHANGED
|
@@ -1,116 +1,74 @@
|
|
|
1
1
|
TN:
|
|
2
2
|
SF:src/server/class/Blocks.js
|
|
3
|
-
FN:
|
|
4
|
-
FN:
|
|
5
|
-
FN:
|
|
6
|
-
FN:
|
|
7
|
-
FN:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
FN:90,(anonymous_8)
|
|
12
|
-
FNF:9
|
|
13
|
-
FNH:7
|
|
14
|
-
FNDA:13,getIntervalFromTime
|
|
3
|
+
FN:6,(anonymous_0)
|
|
4
|
+
FN:12,(anonymous_1)
|
|
5
|
+
FN:24,(anonymous_2)
|
|
6
|
+
FN:36,(anonymous_3)
|
|
7
|
+
FN:48,(anonymous_4)
|
|
8
|
+
FNF:5
|
|
9
|
+
FNH:5
|
|
10
|
+
FNDA:2,(anonymous_0)
|
|
15
11
|
FNDA:2,(anonymous_1)
|
|
16
|
-
FNDA:
|
|
17
|
-
FNDA:
|
|
18
|
-
FNDA:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
FNDA:14,(anonymous_8)
|
|
23
|
-
DA:5,13
|
|
24
|
-
DA:6,13
|
|
25
|
-
DA:11,2
|
|
26
|
-
DA:12,2
|
|
12
|
+
FNDA:14,(anonymous_2)
|
|
13
|
+
FNDA:3,(anonymous_3)
|
|
14
|
+
FNDA:14,(anonymous_4)
|
|
15
|
+
DA:7,2
|
|
16
|
+
DA:8,2
|
|
17
|
+
DA:9,2
|
|
27
18
|
DA:13,2
|
|
28
|
-
DA:14,
|
|
29
|
-
DA:
|
|
19
|
+
DA:14,0
|
|
20
|
+
DA:16,2
|
|
21
|
+
DA:17,0
|
|
30
22
|
DA:19,2
|
|
31
23
|
DA:20,0
|
|
32
|
-
DA:
|
|
33
|
-
DA:23,0
|
|
34
|
-
DA:25,2
|
|
24
|
+
DA:25,14
|
|
35
25
|
DA:26,0
|
|
36
|
-
DA:
|
|
37
|
-
DA:
|
|
38
|
-
DA:
|
|
39
|
-
DA:
|
|
40
|
-
DA:
|
|
41
|
-
DA:
|
|
42
|
-
DA:
|
|
43
|
-
DA:
|
|
44
|
-
DA:
|
|
45
|
-
DA:
|
|
46
|
-
DA:
|
|
47
|
-
DA:
|
|
48
|
-
DA:
|
|
49
|
-
DA:
|
|
50
|
-
DA:
|
|
51
|
-
DA:
|
|
52
|
-
DA:
|
|
53
|
-
DA:
|
|
54
|
-
DA:
|
|
55
|
-
DA:
|
|
56
|
-
DA:
|
|
57
|
-
DA:
|
|
58
|
-
DA:
|
|
59
|
-
DA:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
LF:59
|
|
83
|
-
LH:46
|
|
84
|
-
BRDA:19,0,0,0
|
|
85
|
-
BRDA:19,0,1,2
|
|
86
|
-
BRDA:22,1,0,0
|
|
87
|
-
BRDA:22,1,1,2
|
|
88
|
-
BRDA:25,2,0,0
|
|
89
|
-
BRDA:25,2,1,2
|
|
90
|
-
BRDA:35,3,0,0
|
|
91
|
-
BRDA:35,3,1,0
|
|
92
|
-
BRDA:38,4,0,0
|
|
93
|
-
BRDA:38,4,1,0
|
|
94
|
-
BRDA:46,5,0,2
|
|
95
|
-
BRDA:46,5,1,1
|
|
96
|
-
BRDA:48,6,0,1
|
|
97
|
-
BRDA:48,6,1,0
|
|
98
|
-
BRDA:54,7,0,3
|
|
99
|
-
BRDA:54,7,1,0
|
|
100
|
-
BRDA:57,8,0,3
|
|
101
|
-
BRDA:57,8,1,0
|
|
102
|
-
BRDA:67,9,0,4
|
|
103
|
-
BRDA:67,9,1,10
|
|
104
|
-
BRDA:76,10,0,10
|
|
105
|
-
BRDA:76,10,1,0
|
|
106
|
-
BRDA:91,11,0,14
|
|
107
|
-
BRDA:91,11,1,0
|
|
108
|
-
BRDA:93,12,0,7
|
|
109
|
-
BRDA:93,12,1,7
|
|
110
|
-
BRDA:96,13,0,7
|
|
111
|
-
BRDA:96,13,1,0
|
|
112
|
-
BRF:28
|
|
113
|
-
BRH:15
|
|
26
|
+
DA:28,14
|
|
27
|
+
DA:29,0
|
|
28
|
+
DA:31,14
|
|
29
|
+
DA:32,14
|
|
30
|
+
DA:33,14
|
|
31
|
+
DA:34,4
|
|
32
|
+
DA:35,4
|
|
33
|
+
DA:36,4
|
|
34
|
+
DA:37,3
|
|
35
|
+
DA:40,10
|
|
36
|
+
DA:41,10
|
|
37
|
+
DA:42,10
|
|
38
|
+
DA:43,10
|
|
39
|
+
DA:45,14
|
|
40
|
+
DA:49,14
|
|
41
|
+
DA:50,0
|
|
42
|
+
DA:52,14
|
|
43
|
+
DA:53,14
|
|
44
|
+
DA:54,7
|
|
45
|
+
DA:55,7
|
|
46
|
+
DA:56,7
|
|
47
|
+
DA:57,7
|
|
48
|
+
DA:58,7
|
|
49
|
+
DA:60,0
|
|
50
|
+
LF:35
|
|
51
|
+
LH:28
|
|
52
|
+
BRDA:13,0,0,0
|
|
53
|
+
BRDA:13,0,1,2
|
|
54
|
+
BRDA:16,1,0,0
|
|
55
|
+
BRDA:16,1,1,2
|
|
56
|
+
BRDA:19,2,0,0
|
|
57
|
+
BRDA:19,2,1,2
|
|
58
|
+
BRDA:25,3,0,0
|
|
59
|
+
BRDA:25,3,1,14
|
|
60
|
+
BRDA:28,4,0,0
|
|
61
|
+
BRDA:28,4,1,14
|
|
62
|
+
BRDA:33,5,0,4
|
|
63
|
+
BRDA:33,5,1,10
|
|
64
|
+
BRDA:49,6,0,0
|
|
65
|
+
BRDA:49,6,1,14
|
|
66
|
+
BRDA:53,7,0,7
|
|
67
|
+
BRDA:53,7,1,7
|
|
68
|
+
BRDA:56,8,0,7
|
|
69
|
+
BRDA:56,8,1,0
|
|
70
|
+
BRF:18
|
|
71
|
+
BRH:11
|
|
114
72
|
end_of_record
|
|
115
73
|
TN:
|
|
116
74
|
SF:src/server/class/MultiFetch.js
|
|
@@ -143,17 +101,21 @@ DA:39,20
|
|
|
143
101
|
DA:40,0
|
|
144
102
|
DA:42,20
|
|
145
103
|
DA:43,20
|
|
146
|
-
DA:44,
|
|
147
|
-
DA:
|
|
104
|
+
DA:44,0
|
|
105
|
+
DA:45,0
|
|
148
106
|
DA:48,20
|
|
149
107
|
DA:49,20
|
|
150
|
-
DA:50,
|
|
151
|
-
DA:
|
|
152
|
-
DA:52,0
|
|
108
|
+
DA:50,16
|
|
109
|
+
DA:52,4
|
|
153
110
|
DA:54,20
|
|
154
111
|
DA:55,20
|
|
155
|
-
|
|
156
|
-
|
|
112
|
+
DA:56,20
|
|
113
|
+
DA:57,0
|
|
114
|
+
DA:58,0
|
|
115
|
+
DA:60,20
|
|
116
|
+
DA:61,20
|
|
117
|
+
LF:34
|
|
118
|
+
LH:19
|
|
157
119
|
BRDA:12,0,0,0
|
|
158
120
|
BRDA:12,0,1,1
|
|
159
121
|
BRDA:18,1,0,0
|
|
@@ -171,12 +133,152 @@ BRDA:36,7,0,0
|
|
|
171
133
|
BRDA:36,7,1,20
|
|
172
134
|
BRDA:39,8,0,0
|
|
173
135
|
BRDA:39,8,1,20
|
|
174
|
-
BRDA:43,9,0,
|
|
175
|
-
BRDA:43,9,1,
|
|
176
|
-
BRDA:
|
|
177
|
-
BRDA:
|
|
178
|
-
|
|
179
|
-
|
|
136
|
+
BRDA:43,9,0,0
|
|
137
|
+
BRDA:43,9,1,20
|
|
138
|
+
BRDA:44,10,0,0
|
|
139
|
+
BRDA:44,10,1,0
|
|
140
|
+
BRDA:49,11,0,16
|
|
141
|
+
BRDA:49,11,1,4
|
|
142
|
+
BRDA:56,12,0,0
|
|
143
|
+
BRDA:56,12,1,20
|
|
144
|
+
BRF:25
|
|
145
|
+
BRH:10
|
|
146
|
+
end_of_record
|
|
147
|
+
TN:
|
|
148
|
+
SF:src/server/class/Prevents.js
|
|
149
|
+
FN:8,(anonymous_0)
|
|
150
|
+
FN:15,(anonymous_1)
|
|
151
|
+
FN:30,(anonymous_2)
|
|
152
|
+
FN:45,(anonymous_3)
|
|
153
|
+
FN:72,(anonymous_4)
|
|
154
|
+
FNF:5
|
|
155
|
+
FNH:4
|
|
156
|
+
FNDA:1,(anonymous_0)
|
|
157
|
+
FNDA:1,(anonymous_1)
|
|
158
|
+
FNDA:3,(anonymous_2)
|
|
159
|
+
FNDA:0,(anonymous_3)
|
|
160
|
+
FNDA:3,(anonymous_4)
|
|
161
|
+
DA:9,1
|
|
162
|
+
DA:10,1
|
|
163
|
+
DA:11,1
|
|
164
|
+
DA:12,1
|
|
165
|
+
DA:19,1
|
|
166
|
+
DA:20,0
|
|
167
|
+
DA:25,1
|
|
168
|
+
DA:26,0
|
|
169
|
+
DA:31,3
|
|
170
|
+
DA:32,0
|
|
171
|
+
DA:34,3
|
|
172
|
+
DA:35,0
|
|
173
|
+
DA:37,3
|
|
174
|
+
DA:38,0
|
|
175
|
+
DA:40,3
|
|
176
|
+
DA:41,3
|
|
177
|
+
DA:42,3
|
|
178
|
+
DA:43,1
|
|
179
|
+
DA:44,1
|
|
180
|
+
DA:45,1
|
|
181
|
+
DA:46,0
|
|
182
|
+
DA:49,2
|
|
183
|
+
DA:50,2
|
|
184
|
+
DA:51,2
|
|
185
|
+
DA:52,2
|
|
186
|
+
DA:53,2
|
|
187
|
+
DA:54,0
|
|
188
|
+
DA:55,0
|
|
189
|
+
DA:56,0
|
|
190
|
+
DA:57,0
|
|
191
|
+
DA:58,0
|
|
192
|
+
DA:64,2
|
|
193
|
+
DA:65,2
|
|
194
|
+
DA:66,1
|
|
195
|
+
DA:69,3
|
|
196
|
+
DA:73,3
|
|
197
|
+
DA:74,0
|
|
198
|
+
DA:76,3
|
|
199
|
+
DA:77,0
|
|
200
|
+
DA:79,3
|
|
201
|
+
DA:80,3
|
|
202
|
+
DA:81,0
|
|
203
|
+
DA:82,0
|
|
204
|
+
DA:83,3
|
|
205
|
+
DA:84,3
|
|
206
|
+
DA:85,3
|
|
207
|
+
DA:87,0
|
|
208
|
+
LF:47
|
|
209
|
+
LH:31
|
|
210
|
+
BRDA:19,0,0,0
|
|
211
|
+
BRDA:19,0,1,1
|
|
212
|
+
BRDA:25,1,0,0
|
|
213
|
+
BRDA:25,1,1,1
|
|
214
|
+
BRDA:31,2,0,0
|
|
215
|
+
BRDA:31,2,1,3
|
|
216
|
+
BRDA:34,3,0,0
|
|
217
|
+
BRDA:34,3,1,3
|
|
218
|
+
BRDA:37,4,0,0
|
|
219
|
+
BRDA:37,4,1,3
|
|
220
|
+
BRDA:42,5,0,1
|
|
221
|
+
BRDA:42,5,1,2
|
|
222
|
+
BRDA:53,6,0,0
|
|
223
|
+
BRDA:53,6,1,2
|
|
224
|
+
BRDA:55,7,0,0
|
|
225
|
+
BRDA:55,7,1,0
|
|
226
|
+
BRDA:57,8,0,0
|
|
227
|
+
BRDA:57,8,1,0
|
|
228
|
+
BRDA:65,9,0,1
|
|
229
|
+
BRDA:65,9,1,1
|
|
230
|
+
BRDA:73,10,0,0
|
|
231
|
+
BRDA:73,10,1,3
|
|
232
|
+
BRDA:76,11,0,0
|
|
233
|
+
BRDA:76,11,1,3
|
|
234
|
+
BRDA:80,12,0,0
|
|
235
|
+
BRDA:80,12,1,3
|
|
236
|
+
BRDA:83,13,0,3
|
|
237
|
+
BRDA:83,13,1,0
|
|
238
|
+
BRF:28
|
|
239
|
+
BRH:14
|
|
240
|
+
end_of_record
|
|
241
|
+
TN:
|
|
242
|
+
SF:src/server/class/Tackles.js
|
|
243
|
+
FN:5,(anonymous_0)
|
|
244
|
+
FN:10,(anonymous_1)
|
|
245
|
+
FN:22,(anonymous_2)
|
|
246
|
+
FNF:3
|
|
247
|
+
FNH:2
|
|
248
|
+
FNDA:3,(anonymous_0)
|
|
249
|
+
FNDA:0,(anonymous_1)
|
|
250
|
+
FNDA:3,(anonymous_2)
|
|
251
|
+
DA:6,3
|
|
252
|
+
DA:7,3
|
|
253
|
+
DA:11,0
|
|
254
|
+
DA:12,0
|
|
255
|
+
DA:13,0
|
|
256
|
+
DA:14,0
|
|
257
|
+
DA:15,0
|
|
258
|
+
DA:16,0
|
|
259
|
+
DA:18,0
|
|
260
|
+
DA:23,3
|
|
261
|
+
DA:24,0
|
|
262
|
+
DA:27,3
|
|
263
|
+
DA:28,2
|
|
264
|
+
DA:29,1
|
|
265
|
+
DA:30,1
|
|
266
|
+
DA:32,0
|
|
267
|
+
DA:34,3
|
|
268
|
+
LF:17
|
|
269
|
+
LH:8
|
|
270
|
+
BRDA:11,0,0,0
|
|
271
|
+
BRDA:11,0,1,0
|
|
272
|
+
BRDA:14,1,0,0
|
|
273
|
+
BRDA:14,1,1,0
|
|
274
|
+
BRDA:23,2,0,0
|
|
275
|
+
BRDA:23,2,1,3
|
|
276
|
+
BRDA:27,3,0,2
|
|
277
|
+
BRDA:27,3,1,1
|
|
278
|
+
BRDA:29,4,0,1
|
|
279
|
+
BRDA:29,4,1,0
|
|
280
|
+
BRF:10
|
|
281
|
+
BRH:4
|
|
180
282
|
end_of_record
|
|
181
283
|
TN:
|
|
182
284
|
SF:src/server/lib/byteArray.js
|
|
@@ -376,11 +478,11 @@ FNDA:3,isIpv6Address
|
|
|
376
478
|
DA:2,3
|
|
377
479
|
DA:3,3
|
|
378
480
|
DA:4,3
|
|
379
|
-
DA:5,
|
|
380
|
-
DA:6,
|
|
481
|
+
DA:5,99
|
|
482
|
+
DA:6,99
|
|
381
483
|
DA:9,22
|
|
382
484
|
DA:10,22
|
|
383
|
-
DA:12,
|
|
485
|
+
DA:12,77
|
|
384
486
|
DA:13,0
|
|
385
487
|
DA:17,3
|
|
386
488
|
DA:18,1
|
|
@@ -389,13 +491,13 @@ LF:12
|
|
|
389
491
|
LH:11
|
|
390
492
|
BRDA:6,0,0,3
|
|
391
493
|
BRDA:6,0,1,22
|
|
392
|
-
BRDA:6,0,2,
|
|
494
|
+
BRDA:6,0,2,77
|
|
393
495
|
BRDA:12,1,0,0
|
|
394
|
-
BRDA:12,1,1,
|
|
395
|
-
BRDA:12,2,0,
|
|
396
|
-
BRDA:12,2,1,
|
|
397
|
-
BRDA:12,2,2,
|
|
398
|
-
BRDA:12,2,3,
|
|
496
|
+
BRDA:12,1,1,77
|
|
497
|
+
BRDA:12,2,0,77
|
|
498
|
+
BRDA:12,2,1,77
|
|
499
|
+
BRDA:12,2,2,17
|
|
500
|
+
BRDA:12,2,3,17
|
|
399
501
|
BRDA:17,3,0,1
|
|
400
502
|
BRDA:17,3,1,2
|
|
401
503
|
BRF:11
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "manner.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Frontend mode project.",
|
|
5
5
|
"repository": "git@github.com:leobrad/mode.git",
|
|
6
6
|
"author": "Leo Ely",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"jest": "^29.7.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"advising.js": "^1.0.
|
|
25
|
+
"advising.js": "^1.0.17",
|
|
26
26
|
"babel-plugin-root-import": "^6.6.0",
|
|
27
27
|
"gulp": "^4.0.2",
|
|
28
28
|
"node-fetch": "2"
|
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}}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _net=_interopRequireDefault(require("net")),_advising=require("advising.js"),_Tackles=_interopRequireDefault(require("./Tackles"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class Blocks extends _Tackles.default{constructor(e){super(),this.dealParams(e),this.interval=e}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.")}examineIpAddress(e,r){if("string"!=typeof e)throw new Error("[Error] The parameter ip should be of string type.");if(!(r instanceof _advising.Router))throw new Error("[Error] The parameter ipRouter should be the router type.");let t=!0;var i,o=r.gain(e);return void 0===o?(r.attach(e,1),i=this.interval,setTimeout(()=>{super.cleanTackle(e)},i)):(i=o,r.revise(e,i+=1),t=!1),t}examine(e){if("string"!=typeof e)throw new Error("[Error] The parameter ip should be of string type.");var r,{}=this;if(_net.default.isIPv4(e))return r=this.ipv4Router,this.examineIpAddress(e,r);if(_net.default.isIPv6(e))return r=this.ipv6Router,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")),_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=
|
|
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={}){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,t=t.req;if(void 0===t||t instanceof _http.default.ClientRequest)return t=this.bases,i=(this.index<t.length-1?this.index+=1:this.index=0,this).index,(t=t[i]).startsWith("https")&&(i=new _https.default.Agent({rejectUnauthorized:!1}),r.agent=i),(0,_nodeFetch.default)(t+e,r);throw new Error("[Error] Need to pass http request objec.")}}var _default=exports.default=MultiFetch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _http=_interopRequireDefault(require("http")),_net=_interopRequireDefault(require("net")),_advising=require("advising.js"),_parseHttpDate=_interopRequireDefault(require("../lib/parseHttpDate")),_Tackles=_interopRequireDefault(require("./Tackles"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class Prevents extends _Tackles.default{constructor(e,t){super(),this.dealParams(e,t),this.threshold=e,this.interval=t}dealParams(e,t){if(!(0<e))throw new Error("[Error] The parameter threshold should be of positive integer type.");if(!(0<t))throw new Error("[Error] The parameter interval should be of positive integer type.")}inspectStaticFile(e,t,r){if("string"!=typeof e)throw new Error("[Error] The parameter ip should be of string type.");if(t instanceof _http.default.ClientRequest)throw new Error("[Error] The parameter req should be the clientRequest type.");if(!(r instanceof _advising.Router))throw new Error("[Error] The parameter ipPevents should be the router type.");let i=!0;var s,o=r.gain(e);return void 0===o?(r.attach(e,1),s=this.interval,setTimeout(()=>{super.cleanTackle(e)},s)):(s=o,r.revise(e,s+=1),t=("string"==typeof(o=t.headers["if-modified-since"])&&"number"!=typeof(r=(0,_parseHttpDate.default)(o).getTime())&&r<=(new Date).getTime()&&(i=!1),this).threshold,t<=s&&(i=!1)),i}inspect(e,t){if("string"!=typeof e)throw new Error("[Error] The parameter ip should be of string type.");if(t instanceof _http.default.ClientRequest)throw new Error("[Error] The parameter req should be the clientRequest type.");var r,{}=this;if(_net.default.isIPv4(e))return r=this.ipv4Router,this.inspectStaticFile(e,t,r);if(_net.default.isIPv6(e))return r=this.ipv6Router,this.inspectStaticFile(e,t,r);throw new Error("[Error] The Ip type is not expected.")}}var _default=exports.default=Prevents;
|
|
@@ -0,0 +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}}class Tackles{constructor(){this.ipv4Router=new _advising.Ipv4Router({debug:!1,hideError:!0}),this.ipv6Router=new _advising.Ipv6Router({debug:!1,hideError:!0})}getCount(e){var r;if(_net.default.isIPv4(e))return r=this.ipv4Router,r.gain(e);if(_net.default.isIPv6(e))return r=this.ipv6Router,r.gain(e);throw new Error("[Error] The Ip type is not expected.")}cleanTackle(e){if("string"!=typeof e)throw new Error("[Error] The parameter ip should be of string type.");let r;if(_net.default.isIPv4(e))r=this.ipv4Router;else{if(!_net.default.isIPv6(e))throw new Error("[Error] The Ip type is not expected");r=this.ipv6Router}r.ruin(e)}}var _default=exports.default=Tackles;
|
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,"disconnectHandle",{enumerable:!0,get:function(){return _disconnectHandle.default}}),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")),_disconnectHandle=_interopRequireDefault(require("./lib/disconnectHandle")),_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}}),Object.defineProperty(exports,"Prevents",{enumerable:!0,get:function(){return _Prevents.default}}),exports.byteArray=void 0,Object.defineProperty(exports,"disconnectHandle",{enumerable:!0,get:function(){return _disconnectHandle.default}}),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")),_Prevents=_interopRequireDefault(require("./class/Prevents")),_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")),_disconnectHandle=_interopRequireDefault(require("./lib/disconnectHandle")),_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 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _net=_interopRequireDefault(require("net"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getIntervalFromTime(e){var t=(new Date).getTime();return Math.floor(t-e)}class Blockable{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,t){let r;if(_net.default.isIPv4(e))r=this.ipv4Block;else{if(!_net.default.isIPv6(e))throw new Error("[Error] The Ip type is not expected");r=this.ipv6Block}var i=r.gain(e);void 0!==i&&getIntervalFromTime(i)<t&&r.ruin(e)}examineIpAddress(t,r){let e=!0;var i=r.gain(t);if(void 0===i){var a=(new Date).getTime();r.attach(t,a);let e=this.interval;setTimeout(()=>this.cleanIpAddress(t,e),e)}else getIntervalFromTime(i)<this.interval?(a=this.interval-i,setTimeout(()=>this.cleanIpAddress(t,this.interval),a),e=!1):r.ruin(t);return e}}var _default=exports.default=Blockable;
|