node-red-contrib-web-worldmap 2.23.5 → 2.24.3
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/CHANGELOG.md +5 -1
- package/README.md +11 -2
- package/node_modules/body-parser/HISTORY.md +15 -0
- package/node_modules/body-parser/README.md +25 -12
- package/node_modules/body-parser/node_modules/bytes/History.md +5 -0
- package/node_modules/body-parser/node_modules/bytes/Readme.md +42 -16
- package/node_modules/body-parser/node_modules/bytes/index.js +5 -1
- package/node_modules/body-parser/node_modules/bytes/package.json +20 -22
- package/node_modules/body-parser/package.json +34 -37
- package/node_modules/content-disposition/HISTORY.md +5 -0
- package/node_modules/content-disposition/README.md +3 -9
- package/node_modules/content-disposition/index.js +1 -1
- package/node_modules/content-disposition/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/content-disposition/node_modules/safe-buffer/package.json +76 -0
- package/node_modules/content-disposition/package.json +27 -30
- package/node_modules/cookie/HISTORY.md +5 -0
- package/node_modules/cookie/README.md +4 -0
- package/node_modules/cookie/index.js +5 -1
- package/node_modules/cookie/package.json +22 -25
- package/node_modules/express/History.md +33 -0
- package/node_modules/express/Readme.md +8 -5
- package/node_modules/express/lib/application.js +1 -1
- package/node_modules/express/lib/request.js +1 -1
- package/node_modules/express/lib/response.js +16 -11
- package/node_modules/express/lib/router/index.js +6 -0
- package/node_modules/express/lib/utils.js +2 -6
- package/node_modules/express/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/express/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/express/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/express/node_modules/safe-buffer/index.js +65 -0
- package/node_modules/express/node_modules/safe-buffer/package.json +76 -0
- package/node_modules/express/package.json +37 -39
- package/node_modules/faye-websocket/CHANGELOG.md +5 -0
- package/node_modules/faye-websocket/LICENSE.md +1 -1
- package/node_modules/faye-websocket/README.md +13 -13
- package/node_modules/faye-websocket/lib/faye/websocket/api.js +10 -8
- package/node_modules/faye-websocket/lib/faye/websocket/client.js +4 -4
- package/node_modules/faye-websocket/lib/faye/websocket.js +1 -1
- package/node_modules/faye-websocket/package.json +16 -19
- package/node_modules/forwarded/HISTORY.md +5 -0
- package/node_modules/forwarded/README.md +3 -3
- package/node_modules/forwarded/index.js +15 -1
- package/node_modules/forwarded/package.json +27 -28
- package/node_modules/http-errors/HISTORY.md +16 -0
- package/node_modules/http-errors/README.md +12 -6
- package/node_modules/http-errors/index.js +35 -2
- package/node_modules/http-errors/package.json +32 -35
- package/node_modules/inherits/inherits.js +2 -0
- package/node_modules/inherits/inherits_browser.js +18 -14
- package/node_modules/inherits/package.json +17 -20
- package/node_modules/ipaddr.js/README.md +1 -1
- package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +6 -9
- package/node_modules/ipaddr.js/package.json +17 -19
- package/node_modules/proxy-addr/HISTORY.md +11 -0
- package/node_modules/proxy-addr/README.md +3 -19
- package/node_modules/proxy-addr/index.js +1 -1
- package/node_modules/proxy-addr/package.json +30 -33
- package/node_modules/qs/.editorconfig +9 -0
- package/node_modules/qs/.eslintignore +2 -1
- package/node_modules/qs/.eslintrc +15 -1
- package/node_modules/qs/.github/FUNDING.yml +12 -0
- package/node_modules/qs/.nycrc +13 -0
- package/node_modules/qs/CHANGELOG.md +103 -0
- package/node_modules/qs/LICENSE.md +29 -0
- package/node_modules/qs/README.md +34 -0
- package/node_modules/qs/dist/qs.js +117 -67
- package/node_modules/qs/lib/formats.js +9 -4
- package/node_modules/qs/lib/parse.js +29 -14
- package/node_modules/qs/lib/stringify.js +55 -46
- package/node_modules/qs/lib/utils.js +23 -2
- package/node_modules/qs/package.json +42 -34
- package/node_modules/qs/test/parse.js +97 -1
- package/node_modules/qs/test/stringify.js +115 -1
- package/node_modules/qs/test/utils.js +1 -1
- package/node_modules/raw-body/HISTORY.md +14 -0
- package/node_modules/raw-body/README.md +3 -5
- package/node_modules/raw-body/node_modules/bytes/History.md +5 -0
- package/node_modules/raw-body/node_modules/bytes/Readme.md +42 -16
- package/node_modules/raw-body/node_modules/bytes/index.js +5 -1
- package/node_modules/raw-body/node_modules/bytes/package.json +20 -22
- package/node_modules/raw-body/package.json +32 -35
- package/node_modules/send/HISTORY.md +10 -0
- package/node_modules/send/README.md +4 -6
- package/node_modules/send/index.js +7 -3
- package/node_modules/send/node_modules/ms/index.js +3 -3
- package/node_modules/send/node_modules/ms/license.md +1 -1
- package/node_modules/send/node_modules/ms/package.json +21 -23
- package/node_modules/send/node_modules/ms/readme.md +1 -2
- package/node_modules/send/package.json +31 -34
- package/node_modules/serve-static/HISTORY.md +8 -0
- package/node_modules/serve-static/README.md +9 -11
- package/node_modules/serve-static/package.json +30 -33
- package/node_modules/setprototypeof/README.md +1 -1
- package/node_modules/setprototypeof/index.js +1 -1
- package/node_modules/setprototypeof/package.json +20 -21
- package/node_modules/sockjs/Changelog +12 -0
- package/node_modules/sockjs/lib/transport.js +1 -1
- package/node_modules/sockjs/package.json +16 -19
- package/node_modules/toidentifier/HISTORY.md +9 -0
- package/node_modules/toidentifier/README.md +3 -3
- package/node_modules/toidentifier/index.js +2 -0
- package/node_modules/toidentifier/package.json +30 -29
- package/node_modules/uuid/CHANGELOG.md +154 -44
- package/node_modules/uuid/CONTRIBUTING.md +18 -0
- package/node_modules/uuid/LICENSE.md +4 -16
- package/node_modules/uuid/README.md +384 -155
- package/node_modules/uuid/dist/bin/uuid +2 -0
- package/node_modules/uuid/dist/esm-browser/index.js +9 -0
- package/node_modules/uuid/{lib/md5-browser.js → dist/esm-browser/md5.js} +70 -71
- package/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/node_modules/uuid/dist/esm-browser/parse.js +35 -0
- package/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/node_modules/uuid/dist/esm-browser/rng.js +19 -0
- package/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
- package/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
- package/node_modules/uuid/{v1.js → dist/esm-browser/v1.js} +36 -50
- package/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/node_modules/uuid/dist/esm-browser/v35.js +64 -0
- package/node_modules/uuid/dist/esm-browser/v4.js +24 -0
- package/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/node_modules/uuid/dist/esm-browser/validate.js +7 -0
- package/node_modules/uuid/dist/esm-browser/version.js +11 -0
- package/node_modules/uuid/dist/esm-node/index.js +9 -0
- package/node_modules/uuid/dist/esm-node/md5.js +13 -0
- package/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/node_modules/uuid/dist/esm-node/parse.js +35 -0
- package/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/node_modules/uuid/dist/esm-node/rng.js +12 -0
- package/node_modules/uuid/dist/esm-node/sha1.js +13 -0
- package/node_modules/uuid/dist/esm-node/stringify.js +29 -0
- package/node_modules/uuid/dist/esm-node/v1.js +95 -0
- package/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/node_modules/uuid/dist/esm-node/v35.js +64 -0
- package/node_modules/uuid/dist/esm-node/v4.js +24 -0
- package/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/node_modules/uuid/dist/esm-node/validate.js +7 -0
- package/node_modules/uuid/dist/esm-node/version.js +11 -0
- package/node_modules/uuid/dist/index.js +79 -0
- package/node_modules/uuid/dist/md5-browser.js +223 -0
- package/node_modules/uuid/dist/md5.js +23 -0
- package/node_modules/uuid/dist/nil.js +8 -0
- package/node_modules/uuid/dist/parse.js +45 -0
- package/node_modules/uuid/dist/regex.js +8 -0
- package/node_modules/uuid/dist/rng-browser.js +26 -0
- package/node_modules/uuid/dist/rng.js +24 -0
- package/node_modules/uuid/dist/sha1-browser.js +104 -0
- package/node_modules/uuid/dist/sha1.js +23 -0
- package/node_modules/uuid/dist/stringify.js +39 -0
- package/node_modules/uuid/dist/umd/uuid.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
- package/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
- package/node_modules/uuid/dist/uuid-bin.js +85 -0
- package/node_modules/uuid/dist/v1.js +107 -0
- package/node_modules/uuid/dist/v3.js +16 -0
- package/node_modules/uuid/dist/v35.js +78 -0
- package/node_modules/uuid/dist/v4.js +37 -0
- package/node_modules/uuid/dist/v5.js +16 -0
- package/node_modules/uuid/dist/validate.js +17 -0
- package/node_modules/uuid/dist/version.js +21 -0
- package/node_modules/uuid/package.json +118 -57
- package/node_modules/uuid/wrapper.mjs +10 -0
- package/node_modules/websocket-driver/node_modules/http-parser-js/package.json +4 -4
- package/package.json +3 -3
- package/worldmap/css/worldmap.css +7 -5
- package/worldmap/index.html +1 -0
- package/worldmap/leaflet/leaflet-arc.min.js +1 -0
- package/worldmap/worldmap.js +44 -27
- package/worldmap.html +1 -1
- package/worldmap.js +2 -2
- package/node_modules/qs/LICENSE +0 -28
- package/node_modules/qs/test/.eslintrc +0 -17
- package/node_modules/qs/test/index.js +0 -7
- package/node_modules/uuid/AUTHORS +0 -5
- package/node_modules/uuid/bin/uuid +0 -65
- package/node_modules/uuid/index.js +0 -8
- package/node_modules/uuid/lib/bytesToUuid.js +0 -26
- package/node_modules/uuid/lib/md5.js +0 -25
- package/node_modules/uuid/lib/rng-browser.js +0 -34
- package/node_modules/uuid/lib/rng.js +0 -8
- package/node_modules/uuid/lib/sha1-browser.js +0 -89
- package/node_modules/uuid/lib/sha1.js +0 -25
- package/node_modules/uuid/lib/v35.js +0 -57
- package/node_modules/uuid/v3.js +0 -4
- package/node_modules/uuid/v4.js +0 -29
- package/node_modules/uuid/v5.js +0 -3
|
@@ -5,6 +5,8 @@ var qs = require('../');
|
|
|
5
5
|
var utils = require('../lib/utils');
|
|
6
6
|
var iconv = require('iconv-lite');
|
|
7
7
|
var SaferBuffer = require('safer-buffer').Buffer;
|
|
8
|
+
var hasSymbols = require('has-symbols');
|
|
9
|
+
var hasBigInt = typeof BigInt === 'function';
|
|
8
10
|
|
|
9
11
|
test('stringify()', function (t) {
|
|
10
12
|
t.test('stringifies a querystring object', function (st) {
|
|
@@ -28,6 +30,39 @@ test('stringify()', function (t) {
|
|
|
28
30
|
st.end();
|
|
29
31
|
});
|
|
30
32
|
|
|
33
|
+
t.test('stringifies symbols', { skip: !hasSymbols() }, function (st) {
|
|
34
|
+
st.equal(qs.stringify(Symbol.iterator), '');
|
|
35
|
+
st.equal(qs.stringify([Symbol.iterator]), '0=Symbol%28Symbol.iterator%29');
|
|
36
|
+
st.equal(qs.stringify({ a: Symbol.iterator }), 'a=Symbol%28Symbol.iterator%29');
|
|
37
|
+
st.equal(
|
|
38
|
+
qs.stringify({ a: [Symbol.iterator] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
|
|
39
|
+
'a[]=Symbol%28Symbol.iterator%29'
|
|
40
|
+
);
|
|
41
|
+
st.end();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
t.test('stringifies bigints', { skip: !hasBigInt }, function (st) {
|
|
45
|
+
var three = BigInt(3);
|
|
46
|
+
var encodeWithN = function (value, defaultEncoder, charset) {
|
|
47
|
+
var result = defaultEncoder(value, defaultEncoder, charset);
|
|
48
|
+
return typeof value === 'bigint' ? result + 'n' : result;
|
|
49
|
+
};
|
|
50
|
+
st.equal(qs.stringify(three), '');
|
|
51
|
+
st.equal(qs.stringify([three]), '0=3');
|
|
52
|
+
st.equal(qs.stringify([three], { encoder: encodeWithN }), '0=3n');
|
|
53
|
+
st.equal(qs.stringify({ a: three }), 'a=3');
|
|
54
|
+
st.equal(qs.stringify({ a: three }, { encoder: encodeWithN }), 'a=3n');
|
|
55
|
+
st.equal(
|
|
56
|
+
qs.stringify({ a: [three] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
|
|
57
|
+
'a[]=3'
|
|
58
|
+
);
|
|
59
|
+
st.equal(
|
|
60
|
+
qs.stringify({ a: [three] }, { encodeValuesOnly: true, encoder: encodeWithN, arrayFormat: 'brackets' }),
|
|
61
|
+
'a[]=3n'
|
|
62
|
+
);
|
|
63
|
+
st.end();
|
|
64
|
+
});
|
|
65
|
+
|
|
31
66
|
t.test('adds query prefix', function (st) {
|
|
32
67
|
st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');
|
|
33
68
|
st.end();
|
|
@@ -301,6 +336,27 @@ test('stringify()', function (t) {
|
|
|
301
336
|
st.end();
|
|
302
337
|
});
|
|
303
338
|
|
|
339
|
+
t.test('stringifies an empty array in different arrayFormat', function (st) {
|
|
340
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false }), 'b[0]=&c=c');
|
|
341
|
+
// arrayFormat default
|
|
342
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices' }), 'b[0]=&c=c');
|
|
343
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets' }), 'b[]=&c=c');
|
|
344
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat' }), 'b=&c=c');
|
|
345
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma' }), 'b=&c=c');
|
|
346
|
+
// with strictNullHandling
|
|
347
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', strictNullHandling: true }), 'b[0]&c=c');
|
|
348
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', strictNullHandling: true }), 'b[]&c=c');
|
|
349
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', strictNullHandling: true }), 'b&c=c');
|
|
350
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', strictNullHandling: true }), 'b&c=c');
|
|
351
|
+
// with skipNulls
|
|
352
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'indices', skipNulls: true }), 'c=c');
|
|
353
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'brackets', skipNulls: true }), 'c=c');
|
|
354
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'repeat', skipNulls: true }), 'c=c');
|
|
355
|
+
st.equal(qs.stringify({ a: [], b: [null], c: 'c' }, { encode: false, arrayFormat: 'comma', skipNulls: true }), 'c=c');
|
|
356
|
+
|
|
357
|
+
st.end();
|
|
358
|
+
});
|
|
359
|
+
|
|
304
360
|
t.test('stringifies a null object', { skip: !Object.create }, function (st) {
|
|
305
361
|
var obj = Object.create(null);
|
|
306
362
|
obj.a = 'b';
|
|
@@ -520,6 +576,12 @@ test('stringify()', function (t) {
|
|
|
520
576
|
return String.fromCharCode(buffer.readUInt8(0) + 97);
|
|
521
577
|
}
|
|
522
578
|
}), 'a=b');
|
|
579
|
+
|
|
580
|
+
st.equal(qs.stringify({ a: SaferBuffer.from('a b') }, {
|
|
581
|
+
encoder: function (buffer) {
|
|
582
|
+
return buffer;
|
|
583
|
+
}
|
|
584
|
+
}), 'a=a b');
|
|
523
585
|
st.end();
|
|
524
586
|
});
|
|
525
587
|
|
|
@@ -554,23 +616,43 @@ test('stringify()', function (t) {
|
|
|
554
616
|
'custom serializeDate function called'
|
|
555
617
|
);
|
|
556
618
|
|
|
619
|
+
st.equal(
|
|
620
|
+
qs.stringify(
|
|
621
|
+
{ a: [date] },
|
|
622
|
+
{
|
|
623
|
+
serializeDate: function (d) { return d.getTime(); },
|
|
624
|
+
arrayFormat: 'comma'
|
|
625
|
+
}
|
|
626
|
+
),
|
|
627
|
+
'a=' + date.getTime(),
|
|
628
|
+
'works with arrayFormat comma'
|
|
629
|
+
);
|
|
630
|
+
|
|
557
631
|
st.end();
|
|
558
632
|
});
|
|
559
633
|
|
|
560
|
-
t.test('RFC 1738
|
|
634
|
+
t.test('RFC 1738 serialization', function (st) {
|
|
561
635
|
st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
|
|
562
636
|
st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
|
|
637
|
+
st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC1738 }), 'a+b=a+b');
|
|
638
|
+
|
|
639
|
+
st.equal(qs.stringify({ 'foo(ref)': 'bar' }, { format: qs.formats.RFC1738 }), 'foo(ref)=bar');
|
|
640
|
+
|
|
563
641
|
st.end();
|
|
564
642
|
});
|
|
565
643
|
|
|
566
644
|
t.test('RFC 3986 spaces serialization', function (st) {
|
|
567
645
|
st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');
|
|
568
646
|
st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');
|
|
647
|
+
st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }, { format: qs.formats.RFC3986 }), 'a%20b=a%20b');
|
|
648
|
+
|
|
569
649
|
st.end();
|
|
570
650
|
});
|
|
571
651
|
|
|
572
652
|
t.test('Backward compatibility to RFC 3986', function (st) {
|
|
573
653
|
st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
|
|
654
|
+
st.equal(qs.stringify({ 'a b': SaferBuffer.from('a b') }), 'a%20b=a%20b');
|
|
655
|
+
|
|
574
656
|
st.end();
|
|
575
657
|
});
|
|
576
658
|
|
|
@@ -675,5 +757,37 @@ test('stringify()', function (t) {
|
|
|
675
757
|
st.end();
|
|
676
758
|
});
|
|
677
759
|
|
|
760
|
+
t.test('allows for encoding keys and values differently', function (st) {
|
|
761
|
+
var encoder = function (str, defaultEncoder, charset, type) {
|
|
762
|
+
if (type === 'key') {
|
|
763
|
+
return defaultEncoder(str, defaultEncoder, charset, type).toLowerCase();
|
|
764
|
+
}
|
|
765
|
+
if (type === 'value') {
|
|
766
|
+
return defaultEncoder(str, defaultEncoder, charset, type).toUpperCase();
|
|
767
|
+
}
|
|
768
|
+
throw 'this should never happen! type: ' + type;
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');
|
|
772
|
+
st.end();
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
t.test('objects inside arrays', function (st) {
|
|
776
|
+
var obj = { a: { b: { c: 'd', e: 'f' } } };
|
|
777
|
+
var withArray = { a: { b: [{ c: 'd', e: 'f' }] } };
|
|
778
|
+
|
|
779
|
+
st.equal(qs.stringify(obj, { encode: false }), 'a[b][c]=d&a[b][e]=f', 'no array, no arrayFormat');
|
|
780
|
+
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'bracket' }), 'a[b][c]=d&a[b][e]=f', 'no array, bracket');
|
|
781
|
+
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'indices' }), 'a[b][c]=d&a[b][e]=f', 'no array, indices');
|
|
782
|
+
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), 'a[b][c]=d&a[b][e]=f', 'no array, comma');
|
|
783
|
+
|
|
784
|
+
st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat');
|
|
785
|
+
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket');
|
|
786
|
+
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices');
|
|
787
|
+
st.equal(qs.stringify(obj, { encode: false, arrayFormat: 'comma' }), '???', 'array, comma (pending issue #378)', { skip: true });
|
|
788
|
+
|
|
789
|
+
st.end();
|
|
790
|
+
});
|
|
791
|
+
|
|
678
792
|
t.end();
|
|
679
793
|
});
|
|
@@ -130,7 +130,7 @@ test('isBuffer()', function (t) {
|
|
|
130
130
|
var saferBuffer = SaferBuffer.from('abc');
|
|
131
131
|
t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');
|
|
132
132
|
|
|
133
|
-
var buffer = Buffer.from ? Buffer.from('abc') : new Buffer('abc');
|
|
133
|
+
var buffer = Buffer.from && Buffer.alloc ? Buffer.from('abc') : new Buffer('abc');
|
|
134
134
|
t.equal(utils.isBuffer(buffer), true, 'real Buffer instance is a buffer');
|
|
135
135
|
t.end();
|
|
136
136
|
});
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
2.4.2 / 2021-11-16
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
* deps: bytes@3.1.1
|
|
5
|
+
* deps: http-errors@1.8.1
|
|
6
|
+
- deps: setprototypeof@1.2.0
|
|
7
|
+
- deps: toidentifier@1.0.1
|
|
8
|
+
|
|
9
|
+
2.4.1 / 2019-06-25
|
|
10
|
+
==================
|
|
11
|
+
|
|
12
|
+
* deps: http-errors@1.7.3
|
|
13
|
+
- deps: inherits@2.0.4
|
|
14
|
+
|
|
1
15
|
2.4.0 / 2019-04-17
|
|
2
16
|
==================
|
|
3
17
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
|
4
4
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
5
|
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
-
[![Build status][
|
|
6
|
+
[![Build status][github-actions-ci-image]][github-actions-ci-url]
|
|
7
7
|
[![Test coverage][coveralls-image]][coveralls-url]
|
|
8
8
|
|
|
9
9
|
Gets the entire buffer of a stream either as a `Buffer` or a string.
|
|
@@ -33,8 +33,6 @@ $ npm install @types/node
|
|
|
33
33
|
|
|
34
34
|
## API
|
|
35
35
|
|
|
36
|
-
<!-- eslint-disable no-unused-vars -->
|
|
37
|
-
|
|
38
36
|
```js
|
|
39
37
|
var getRawBody = require('raw-body')
|
|
40
38
|
```
|
|
@@ -211,9 +209,9 @@ server.listen(3000);
|
|
|
211
209
|
[npm-url]: https://npmjs.org/package/raw-body
|
|
212
210
|
[node-version-image]: https://img.shields.io/node/v/raw-body.svg
|
|
213
211
|
[node-version-url]: https://nodejs.org/en/download/
|
|
214
|
-
[travis-image]: https://img.shields.io/travis/stream-utils/raw-body/master.svg
|
|
215
|
-
[travis-url]: https://travis-ci.org/stream-utils/raw-body
|
|
216
212
|
[coveralls-image]: https://img.shields.io/coveralls/stream-utils/raw-body/master.svg
|
|
217
213
|
[coveralls-url]: https://coveralls.io/r/stream-utils/raw-body?branch=master
|
|
218
214
|
[downloads-image]: https://img.shields.io/npm/dm/raw-body.svg
|
|
219
215
|
[downloads-url]: https://npmjs.org/package/raw-body
|
|
216
|
+
[github-actions-ci-image]: https://img.shields.io/github/workflow/status/stream-utils/raw-body/ci/master?label=ci
|
|
217
|
+
[github-actions-ci-url]: https://github.com/jshttp/stream-utils/raw-body?query=workflow%3Aci
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-image]][npm-url]
|
|
4
4
|
[![NPM Downloads][downloads-image]][downloads-url]
|
|
5
|
-
[![Build Status][
|
|
5
|
+
[![Build Status][ci-image]][ci-url]
|
|
6
6
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
7
7
|
|
|
8
8
|
Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa.
|
|
@@ -23,6 +23,33 @@ $ npm install bytes
|
|
|
23
23
|
var bytes = require('bytes');
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
#### bytes(number|string value, [options]): number|string|null
|
|
27
|
+
|
|
28
|
+
Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`.
|
|
29
|
+
|
|
30
|
+
**Arguments**
|
|
31
|
+
|
|
32
|
+
| Name | Type | Description |
|
|
33
|
+
|---------|----------|--------------------|
|
|
34
|
+
| value | `number`|`string` | Number value to format or string value to parse |
|
|
35
|
+
| options | `Object` | Conversion options for `format` |
|
|
36
|
+
|
|
37
|
+
**Returns**
|
|
38
|
+
|
|
39
|
+
| Name | Type | Description |
|
|
40
|
+
|---------|------------------|-------------------------------------------------|
|
|
41
|
+
| results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. |
|
|
42
|
+
|
|
43
|
+
**Example**
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
bytes(1024);
|
|
47
|
+
// output: '1KB'
|
|
48
|
+
|
|
49
|
+
bytes('1KB');
|
|
50
|
+
// output: 1024
|
|
51
|
+
```
|
|
52
|
+
|
|
26
53
|
#### bytes.format(number value, [options]): string|null
|
|
27
54
|
|
|
28
55
|
Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is
|
|
@@ -41,7 +68,7 @@ Format the given value in bytes into a string. If the value is negative, it is k
|
|
|
41
68
|
|-------------------|--------|-----------------------------------------------------------------------------------------|
|
|
42
69
|
| decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. |
|
|
43
70
|
| fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` |
|
|
44
|
-
| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and
|
|
71
|
+
| thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. |
|
|
45
72
|
| unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). |
|
|
46
73
|
| unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. |
|
|
47
74
|
|
|
@@ -54,21 +81,20 @@ Format the given value in bytes into a string. If the value is negative, it is k
|
|
|
54
81
|
**Example**
|
|
55
82
|
|
|
56
83
|
```js
|
|
57
|
-
bytes(1024);
|
|
84
|
+
bytes.format(1024);
|
|
58
85
|
// output: '1KB'
|
|
59
86
|
|
|
60
|
-
bytes(1000);
|
|
87
|
+
bytes.format(1000);
|
|
61
88
|
// output: '1000B'
|
|
62
89
|
|
|
63
|
-
bytes(1000, {thousandsSeparator: ' '});
|
|
90
|
+
bytes.format(1000, {thousandsSeparator: ' '});
|
|
64
91
|
// output: '1 000B'
|
|
65
92
|
|
|
66
|
-
bytes(1024 * 1.7, {decimalPlaces: 0});
|
|
93
|
+
bytes.format(1024 * 1.7, {decimalPlaces: 0});
|
|
67
94
|
// output: '2KB'
|
|
68
95
|
|
|
69
|
-
bytes(1024, {unitSeparator: ' '});
|
|
96
|
+
bytes.format(1024, {unitSeparator: ' '});
|
|
70
97
|
// output: '1 KB'
|
|
71
|
-
|
|
72
98
|
```
|
|
73
99
|
|
|
74
100
|
#### bytes.parse(string|number value): number|null
|
|
@@ -102,25 +128,25 @@ The units are in powers of two, not ten. This means 1kb = 1024b according to thi
|
|
|
102
128
|
**Example**
|
|
103
129
|
|
|
104
130
|
```js
|
|
105
|
-
bytes('1KB');
|
|
131
|
+
bytes.parse('1KB');
|
|
106
132
|
// output: 1024
|
|
107
133
|
|
|
108
|
-
bytes('1024');
|
|
134
|
+
bytes.parse('1024');
|
|
109
135
|
// output: 1024
|
|
110
136
|
|
|
111
|
-
bytes(1024);
|
|
112
|
-
// output:
|
|
137
|
+
bytes.parse(1024);
|
|
138
|
+
// output: 1024
|
|
113
139
|
```
|
|
114
140
|
|
|
115
|
-
## License
|
|
141
|
+
## License
|
|
116
142
|
|
|
117
143
|
[MIT](LICENSE)
|
|
118
144
|
|
|
145
|
+
[ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci
|
|
146
|
+
[ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci
|
|
119
147
|
[coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master
|
|
120
148
|
[coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master
|
|
121
149
|
[downloads-image]: https://badgen.net/npm/dm/bytes
|
|
122
150
|
[downloads-url]: https://npmjs.org/package/bytes
|
|
123
|
-
[npm-image]: https://badgen.net/npm/
|
|
151
|
+
[npm-image]: https://badgen.net/npm/v/bytes
|
|
124
152
|
[npm-url]: https://npmjs.org/package/bytes
|
|
125
|
-
[travis-image]: https://badgen.net/travis/visionmedia/bytes.js/master
|
|
126
|
-
[travis-url]: https://travis-ci.org/visionmedia/bytes.js
|
|
@@ -117,7 +117,11 @@ function format(value, options) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
if (thousandsSeparator) {
|
|
120
|
-
str = str.
|
|
120
|
+
str = str.split('.').map(function (s, i) {
|
|
121
|
+
return i === 0
|
|
122
|
+
? s.replace(formatThousandsRegExp, thousandsSeparator)
|
|
123
|
+
: s
|
|
124
|
+
}).join('.');
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
return str + unitSeparator + unit;
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
"bytes@3.1.0",
|
|
5
|
-
"/Users/conway/Projects/worldmap"
|
|
6
|
-
]
|
|
7
|
-
],
|
|
8
|
-
"_from": "bytes@3.1.0",
|
|
9
|
-
"_id": "bytes@3.1.0",
|
|
2
|
+
"_from": "bytes@3.1.1",
|
|
3
|
+
"_id": "bytes@3.1.1",
|
|
10
4
|
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-
|
|
12
|
-
"_location": "/raw-body/bytes",
|
|
5
|
+
"_integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==",
|
|
6
|
+
"_location": "/node-red-contrib-web-worldmap/raw-body/bytes",
|
|
13
7
|
"_phantomChildren": {},
|
|
14
8
|
"_requested": {
|
|
15
9
|
"type": "version",
|
|
16
10
|
"registry": true,
|
|
17
|
-
"raw": "bytes@3.1.
|
|
11
|
+
"raw": "bytes@3.1.1",
|
|
18
12
|
"name": "bytes",
|
|
19
13
|
"escapedName": "bytes",
|
|
20
|
-
"rawSpec": "3.1.
|
|
14
|
+
"rawSpec": "3.1.1",
|
|
21
15
|
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "3.1.
|
|
16
|
+
"fetchSpec": "3.1.1"
|
|
23
17
|
},
|
|
24
18
|
"_requiredBy": [
|
|
25
|
-
"/raw-body"
|
|
19
|
+
"/node-red-contrib-web-worldmap/raw-body"
|
|
26
20
|
],
|
|
27
|
-
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.
|
|
28
|
-
"
|
|
29
|
-
"
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz",
|
|
22
|
+
"_shasum": "3f018291cb4cbad9accb6e6970bca9c8889e879a",
|
|
23
|
+
"_spec": "bytes@3.1.1",
|
|
24
|
+
"_where": "/Users/conway/Projects/worldmap/node_modules/raw-body",
|
|
30
25
|
"author": {
|
|
31
26
|
"name": "TJ Holowaychuk",
|
|
32
27
|
"email": "tj@vision-media.ca",
|
|
@@ -35,6 +30,7 @@
|
|
|
35
30
|
"bugs": {
|
|
36
31
|
"url": "https://github.com/visionmedia/bytes.js/issues"
|
|
37
32
|
},
|
|
33
|
+
"bundleDependencies": false,
|
|
38
34
|
"contributors": [
|
|
39
35
|
{
|
|
40
36
|
"name": "Jed Watson",
|
|
@@ -45,11 +41,13 @@
|
|
|
45
41
|
"email": "theo.fidry@gmail.com"
|
|
46
42
|
}
|
|
47
43
|
],
|
|
44
|
+
"deprecated": false,
|
|
48
45
|
"description": "Utility to parse a string bytes to bytes and vice-versa",
|
|
49
46
|
"devDependencies": {
|
|
50
|
-
"eslint": "
|
|
51
|
-
"
|
|
52
|
-
"
|
|
47
|
+
"eslint": "7.32.0",
|
|
48
|
+
"eslint-plugin-markdown": "2.2.1",
|
|
49
|
+
"mocha": "9.1.3",
|
|
50
|
+
"nyc": "15.1.0"
|
|
53
51
|
},
|
|
54
52
|
"engines": {
|
|
55
53
|
"node": ">= 0.8"
|
|
@@ -79,8 +77,8 @@
|
|
|
79
77
|
"scripts": {
|
|
80
78
|
"lint": "eslint .",
|
|
81
79
|
"test": "mocha --check-leaks --reporter spec",
|
|
82
|
-
"test-ci": "nyc --reporter=text npm test",
|
|
80
|
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
83
81
|
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
84
82
|
},
|
|
85
|
-
"version": "3.1.
|
|
83
|
+
"version": "3.1.1"
|
|
86
84
|
}
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
"raw-body@2.4.0",
|
|
5
|
-
"/Users/conway/Projects/worldmap"
|
|
6
|
-
]
|
|
7
|
-
],
|
|
8
|
-
"_from": "raw-body@2.4.0",
|
|
9
|
-
"_id": "raw-body@2.4.0",
|
|
2
|
+
"_from": "raw-body@2.4.2",
|
|
3
|
+
"_id": "raw-body@2.4.2",
|
|
10
4
|
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-
|
|
12
|
-
"_location": "/raw-body",
|
|
5
|
+
"_integrity": "sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ==",
|
|
6
|
+
"_location": "/node-red-contrib-web-worldmap/raw-body",
|
|
13
7
|
"_phantomChildren": {},
|
|
14
8
|
"_requested": {
|
|
15
9
|
"type": "version",
|
|
16
10
|
"registry": true,
|
|
17
|
-
"raw": "raw-body@2.4.
|
|
11
|
+
"raw": "raw-body@2.4.2",
|
|
18
12
|
"name": "raw-body",
|
|
19
13
|
"escapedName": "raw-body",
|
|
20
|
-
"rawSpec": "2.4.
|
|
14
|
+
"rawSpec": "2.4.2",
|
|
21
15
|
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "2.4.
|
|
16
|
+
"fetchSpec": "2.4.2"
|
|
23
17
|
},
|
|
24
18
|
"_requiredBy": [
|
|
25
|
-
"/body-parser"
|
|
19
|
+
"/node-red-contrib-web-worldmap/body-parser"
|
|
26
20
|
],
|
|
27
|
-
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.
|
|
28
|
-
"
|
|
29
|
-
"
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz",
|
|
22
|
+
"_shasum": "baf3e9c21eebced59dd6533ac872b71f7b61cb32",
|
|
23
|
+
"_spec": "raw-body@2.4.2",
|
|
24
|
+
"_where": "/Users/conway/Projects/worldmap/node_modules/body-parser",
|
|
30
25
|
"author": {
|
|
31
26
|
"name": "Jonathan Ong",
|
|
32
27
|
"email": "me@jongleberry.com",
|
|
@@ -35,6 +30,7 @@
|
|
|
35
30
|
"bugs": {
|
|
36
31
|
"url": "https://github.com/stream-utils/raw-body/issues"
|
|
37
32
|
},
|
|
33
|
+
"bundleDependencies": false,
|
|
38
34
|
"contributors": [
|
|
39
35
|
{
|
|
40
36
|
"name": "Douglas Christopher Wilson",
|
|
@@ -46,25 +42,26 @@
|
|
|
46
42
|
}
|
|
47
43
|
],
|
|
48
44
|
"dependencies": {
|
|
49
|
-
"bytes": "3.1.
|
|
50
|
-
"http-errors": "1.
|
|
45
|
+
"bytes": "3.1.1",
|
|
46
|
+
"http-errors": "1.8.1",
|
|
51
47
|
"iconv-lite": "0.4.24",
|
|
52
48
|
"unpipe": "1.0.0"
|
|
53
49
|
},
|
|
50
|
+
"deprecated": false,
|
|
54
51
|
"description": "Get and validate the raw body of a readable stream.",
|
|
55
52
|
"devDependencies": {
|
|
56
|
-
"bluebird": "3.
|
|
57
|
-
"eslint": "
|
|
58
|
-
"eslint-config-standard": "
|
|
59
|
-
"eslint-plugin-import": "2.
|
|
60
|
-
"eslint-plugin-markdown": "
|
|
61
|
-
"eslint-plugin-node": "
|
|
62
|
-
"eslint-plugin-promise": "
|
|
63
|
-
"eslint-plugin-standard": "4.
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"readable-stream": "2.3.
|
|
67
|
-
"safe-buffer": "5.1
|
|
53
|
+
"bluebird": "3.7.2",
|
|
54
|
+
"eslint": "7.32.0",
|
|
55
|
+
"eslint-config-standard": "14.1.1",
|
|
56
|
+
"eslint-plugin-import": "2.25.3",
|
|
57
|
+
"eslint-plugin-markdown": "2.2.1",
|
|
58
|
+
"eslint-plugin-node": "11.1.0",
|
|
59
|
+
"eslint-plugin-promise": "5.1.1",
|
|
60
|
+
"eslint-plugin-standard": "4.1.0",
|
|
61
|
+
"mocha": "9.1.3",
|
|
62
|
+
"nyc": "15.1.0",
|
|
63
|
+
"readable-stream": "2.3.7",
|
|
64
|
+
"safe-buffer": "5.2.1"
|
|
68
65
|
},
|
|
69
66
|
"engines": {
|
|
70
67
|
"node": ">= 0.8"
|
|
@@ -84,10 +81,10 @@
|
|
|
84
81
|
"url": "git+https://github.com/stream-utils/raw-body.git"
|
|
85
82
|
},
|
|
86
83
|
"scripts": {
|
|
87
|
-
"lint": "eslint
|
|
84
|
+
"lint": "eslint .",
|
|
88
85
|
"test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/",
|
|
89
|
-
"test-
|
|
90
|
-
"test-
|
|
86
|
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
87
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
91
88
|
},
|
|
92
|
-
"version": "2.4.
|
|
89
|
+
"version": "2.4.2"
|
|
93
90
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
0.17.2 / 2021-12-11
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
* pref: ignore empty http tokens
|
|
5
|
+
* deps: http-errors@1.8.1
|
|
6
|
+
- deps: inherits@2.0.4
|
|
7
|
+
- deps: toidentifier@1.0.1
|
|
8
|
+
- deps: setprototypeof@1.2.0
|
|
9
|
+
* deps: ms@2.1.3
|
|
10
|
+
|
|
1
11
|
0.17.1 / 2019-05-10
|
|
2
12
|
===================
|
|
3
13
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[![NPM Version][npm-version-image]][npm-url]
|
|
4
4
|
[![NPM Downloads][npm-downloads-image]][npm-url]
|
|
5
|
-
[![Linux Build][
|
|
5
|
+
[![Linux Build][github-actions-ci-image]][github-actions-ci-url]
|
|
6
6
|
[![Windows Build][appveyor-image]][appveyor-url]
|
|
7
7
|
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
8
|
|
|
@@ -26,8 +26,6 @@ $ npm install send
|
|
|
26
26
|
|
|
27
27
|
## API
|
|
28
28
|
|
|
29
|
-
<!-- eslint-disable no-unused-vars -->
|
|
30
|
-
|
|
31
29
|
```js
|
|
32
30
|
var send = require('send')
|
|
33
31
|
```
|
|
@@ -87,7 +85,7 @@ This is skipped if the requested file already has an extension.
|
|
|
87
85
|
|
|
88
86
|
##### immutable
|
|
89
87
|
|
|
90
|
-
Enable or
|
|
88
|
+
Enable or disable the `immutable` directive in the `Cache-Control` response
|
|
91
89
|
header, defaults to `false`. If set to `true`, the `maxAge` option should
|
|
92
90
|
also be specified to enable caching. The `immutable` directive will prevent
|
|
93
91
|
supported clients from making conditional requests during the life of the
|
|
@@ -320,10 +318,10 @@ server.listen(3000)
|
|
|
320
318
|
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send
|
|
321
319
|
[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master
|
|
322
320
|
[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master
|
|
321
|
+
[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=ci
|
|
322
|
+
[github-actions-ci-url]: https://github.com/pillarjs/send/actions?query=workflow%3Aci
|
|
323
323
|
[node-image]: https://badgen.net/npm/node/send
|
|
324
324
|
[node-url]: https://nodejs.org/en/download/
|
|
325
325
|
[npm-downloads-image]: https://badgen.net/npm/dm/send
|
|
326
326
|
[npm-url]: https://npmjs.org/package/send
|
|
327
327
|
[npm-version-image]: https://badgen.net/npm/v/send
|
|
328
|
-
[travis-image]: https://badgen.net/travis/pillarjs/send/master?label=linux
|
|
329
|
-
[travis-url]: https://travis-ci.org/pillarjs/send
|
|
@@ -435,7 +435,7 @@ SendStream.prototype.onStatError = function onStatError (error) {
|
|
|
435
435
|
|
|
436
436
|
SendStream.prototype.isFresh = function isFresh () {
|
|
437
437
|
return fresh(this.req.headers, {
|
|
438
|
-
|
|
438
|
+
etag: this.res.getHeader('ETag'),
|
|
439
439
|
'last-modified': this.res.getHeader('Last-Modified')
|
|
440
440
|
})
|
|
441
441
|
}
|
|
@@ -1096,7 +1096,9 @@ function parseTokenList (str) {
|
|
|
1096
1096
|
}
|
|
1097
1097
|
break
|
|
1098
1098
|
case 0x2c: /* , */
|
|
1099
|
-
|
|
1099
|
+
if (start !== end) {
|
|
1100
|
+
list.push(str.substring(start, end))
|
|
1101
|
+
}
|
|
1100
1102
|
start = end = i + 1
|
|
1101
1103
|
break
|
|
1102
1104
|
default:
|
|
@@ -1106,7 +1108,9 @@ function parseTokenList (str) {
|
|
|
1106
1108
|
}
|
|
1107
1109
|
|
|
1108
1110
|
// final token
|
|
1109
|
-
|
|
1111
|
+
if (start !== end) {
|
|
1112
|
+
list.push(str.substring(start, end))
|
|
1113
|
+
}
|
|
1110
1114
|
|
|
1111
1115
|
return list
|
|
1112
1116
|
}
|
|
@@ -23,12 +23,12 @@ var y = d * 365.25;
|
|
|
23
23
|
* @api public
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
module.exports = function(val, options) {
|
|
26
|
+
module.exports = function (val, options) {
|
|
27
27
|
options = options || {};
|
|
28
28
|
var type = typeof val;
|
|
29
29
|
if (type === 'string' && val.length > 0) {
|
|
30
30
|
return parse(val);
|
|
31
|
-
} else if (type === 'number' &&
|
|
31
|
+
} else if (type === 'number' && isFinite(val)) {
|
|
32
32
|
return options.long ? fmtLong(val) : fmtShort(val);
|
|
33
33
|
}
|
|
34
34
|
throw new Error(
|
|
@@ -50,7 +50,7 @@ function parse(str) {
|
|
|
50
50
|
if (str.length > 100) {
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
var match = /^((?:\d+)
|
|
53
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
54
54
|
str
|
|
55
55
|
);
|
|
56
56
|
if (!match) {
|