manner.js 1.0.7 → 1.0.10
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/index.js +1 -34
- package/client/lib/clearCookie.js +1 -20
- package/client/lib/filterNamespace.js +1 -15
- package/client/lib/readCookie.js +1 -38
- package/client/lib/setCookie.js +1 -25
- package/coverage/clover.xml +105 -28
- package/coverage/coverage-final.json +4 -2
- package/coverage/lcov-report/byteArray.js.html +154 -0
- package/coverage/lcov-report/class/Blockable.js.html +262 -0
- package/coverage/lcov-report/class/Blocks.js.html +202 -0
- package/coverage/lcov-report/class/MultiFetch.js.html +131 -29
- package/coverage/lcov-report/class/index.html +44 -14
- package/coverage/lcov-report/formatHttpDate.js.html +2 -5
- package/coverage/lcov-report/formatHttpKey.js.html +1 -1
- package/coverage/lcov-report/getOwnIpAddresses.js.html +220 -0
- package/coverage/lcov-report/index.html +19 -19
- package/coverage/lcov-report/isIntranetIpv4Address.js.html +196 -0
- package/coverage/lcov-report/isIpv6Address.js.html +148 -0
- package/coverage/lcov-report/lib/byteArray.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-report/nonZeroByteArray.js.html +157 -0
- package/coverage/lcov-report/parseHttpDate.js.html +238 -0
- package/coverage/lcov-report/wrapIpv6.js.html +94 -0
- package/coverage/lcov.info +199 -49
- package/package.json +3 -1
- package/server/class/Blockable.js +1 -0
- package/server/class/Blocks.js +1 -0
- package/server/class/MultiFetch.js +1 -59
- package/server/index.js +1 -77
- package/server/lib/byteArray.js +1 -28
- package/server/lib/formatHttpDate.js +1 -12
- package/server/lib/formatHttpKey.js +1 -11
- package/server/lib/getOwnIpAddresses.js +1 -66
- package/server/lib/isIntranetIpv4Address.js +1 -44
- package/server/lib/isIpv6Address.js +1 -27
- package/server/lib/nonZeroByteArray.js +1 -31
- package/server/lib/parseHttpDate.js +1 -57
- package/server/lib/readCookie.js +1 -27
- package/server/lib/wrapIpv6.js +1 -9
|
@@ -1,57 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = parseHttpDate;
|
|
7
|
-
function parseHttpDate(httpDate) {
|
|
8
|
-
let [_, rest] = httpDate.split(', ');
|
|
9
|
-
let [day, month, year, time] = rest.split(' ');
|
|
10
|
-
const [hours, minutes, seconds] = time.split(':');
|
|
11
|
-
const date = new Date();
|
|
12
|
-
date.setFullYear(parseInt(year));
|
|
13
|
-
switch (month) {
|
|
14
|
-
case 'Jan':
|
|
15
|
-
month = 0;
|
|
16
|
-
break;
|
|
17
|
-
case 'Feb':
|
|
18
|
-
month = 1;
|
|
19
|
-
break;
|
|
20
|
-
case 'Mar':
|
|
21
|
-
month = 2;
|
|
22
|
-
break;
|
|
23
|
-
case 'Apr':
|
|
24
|
-
month = 3;
|
|
25
|
-
break;
|
|
26
|
-
case 'May':
|
|
27
|
-
month = 4;
|
|
28
|
-
break;
|
|
29
|
-
case 'Jun':
|
|
30
|
-
month = 5;
|
|
31
|
-
break;
|
|
32
|
-
case 'Jul':
|
|
33
|
-
month = 6;
|
|
34
|
-
break;
|
|
35
|
-
case 'Aug':
|
|
36
|
-
month = 7;
|
|
37
|
-
break;
|
|
38
|
-
case 'Sep':
|
|
39
|
-
month = 8;
|
|
40
|
-
break;
|
|
41
|
-
case 'Oct':
|
|
42
|
-
month = 9;
|
|
43
|
-
break;
|
|
44
|
-
case 'Nov':
|
|
45
|
-
month = 10;
|
|
46
|
-
break;
|
|
47
|
-
case 'Dec':
|
|
48
|
-
month = 11;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
date.setMonth(month);
|
|
52
|
-
date.setUTCDate(parseInt(day));
|
|
53
|
-
date.setHours(parseInt(hours));
|
|
54
|
-
date.setMinutes(parseInt(minutes));
|
|
55
|
-
date.setSeconds(parseInt(seconds));
|
|
56
|
-
return date;
|
|
57
|
-
}
|
|
1
|
+
function parseHttpDate(e){var[,e]=e.split(", ");let[a,s,t,r]=e.split(" ");var[e,c,p]=r.split(":"),n=new Date;switch(n.setFullYear(parseInt(t)),s){case"Jan":s=0;break;case"Feb":s=1;break;case"Mar":s=2;break;case"Apr":s=3;break;case"May":s=4;break;case"Jun":s=5;break;case"Jul":s=6;break;case"Aug":s=7;break;case"Sep":s=8;break;case"Oct":s=9;break;case"Nov":s=10;break;case"Dec":s=11}return n.setMonth(s),n.setUTCDate(parseInt(a)),n.setHours(parseInt(e)),n.setMinutes(parseInt(c)),n.setSeconds(parseInt(p)),n}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=parseHttpDate;
|
package/server/lib/readCookie.js
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.readCookie = readCookie;
|
|
7
|
-
function readCookie(cookie) {
|
|
8
|
-
const cookies = {};
|
|
9
|
-
if (typeof cookie === 'string') {
|
|
10
|
-
cookie.split(';').forEach(i => {
|
|
11
|
-
const [key, value] = i.split('=');
|
|
12
|
-
cookies[key.trim()] = value;
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const namespaces = {};
|
|
16
|
-
Object.keys(cookies).forEach(k => {
|
|
17
|
-
const result = k.split('_');
|
|
18
|
-
if (result.length === 2) {
|
|
19
|
-
const [namespace, key] = result;
|
|
20
|
-
if (namespaces[namespace] === undefined) {
|
|
21
|
-
namespaces[namespace] = {};
|
|
22
|
-
}
|
|
23
|
-
namespaces[namespace][key] = cookies[k];
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return namespaces;
|
|
27
|
-
}
|
|
1
|
+
function readCookie(e){let t={},i=("string"==typeof e&&e.split(";").forEach(e=>{var[e,o]=e.split("=");t[e.trim()]=o}),{});return Object.keys(t).forEach(e=>{var o,r=e.split("_");2===r.length&&([r,o]=r,void 0===i[r]&&(i[r]={}),i[r][o]=t[e])}),i}Object.defineProperty(exports,"__esModule",{value:!0}),exports.readCookie=readCookie;
|
package/server/lib/wrapIpv6.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = wrapIpv6;
|
|
7
|
-
function wrapIpv6(ipv6) {
|
|
8
|
-
return '[' + ipv6 + ']';
|
|
9
|
-
}
|
|
1
|
+
function wrapIpv6(e){return"["+e+"]"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=wrapIpv6;
|