node-red-contrib-web-worldmap 2.28.3 → 2.30.1
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/.github/FUNDING.yml +13 -0
- package/CHANGELOG.md +10 -0
- package/README.md +5 -3
- package/node_modules/array-flatten/package.json +6 -9
- package/node_modules/body-parser/HISTORY.md +18 -0
- package/node_modules/body-parser/README.md +9 -1
- package/node_modules/body-parser/SECURITY.md +25 -0
- package/node_modules/body-parser/lib/read.js +26 -2
- package/node_modules/body-parser/lib/types/json.js +10 -4
- package/node_modules/body-parser/package.json +24 -20
- package/node_modules/call-bind/.eslintignore +1 -0
- package/node_modules/call-bind/.eslintrc +17 -0
- package/node_modules/call-bind/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind/.nycrc +13 -0
- package/node_modules/call-bind/CHANGELOG.md +42 -0
- package/node_modules/call-bind/LICENSE +21 -0
- package/node_modules/call-bind/README.md +2 -0
- package/node_modules/call-bind/callBound.js +15 -0
- package/node_modules/call-bind/index.js +47 -0
- package/node_modules/call-bind/package.json +108 -0
- package/node_modules/call-bind/test/callBound.js +55 -0
- package/node_modules/call-bind/test/index.js +66 -0
- package/node_modules/cookie/HISTORY.md +8 -0
- package/node_modules/cookie/README.md +50 -34
- package/node_modules/cookie/SECURITY.md +25 -0
- package/node_modules/cookie/index.js +83 -15
- package/node_modules/cookie/package.json +17 -15
- package/node_modules/cookie-signature/package.json +6 -9
- package/node_modules/depd/History.md +7 -0
- package/node_modules/depd/LICENSE +1 -1
- package/node_modules/depd/Readme.md +8 -8
- package/node_modules/depd/index.js +29 -13
- package/node_modules/depd/package.json +25 -24
- package/node_modules/destroy/LICENSE +1 -0
- package/node_modules/destroy/README.md +15 -12
- package/node_modules/destroy/index.js +147 -13
- package/node_modules/destroy/package.json +29 -20
- package/node_modules/ee-first/package.json +6 -9
- package/node_modules/encodeurl/package.json +11 -14
- package/node_modules/escape-html/package.json +11 -14
- package/node_modules/etag/package.json +11 -14
- package/node_modules/express/History.md +54 -0
- package/node_modules/express/Readme.md +39 -31
- package/node_modules/express/lib/application.js +18 -1
- package/node_modules/express/lib/response.js +40 -18
- package/node_modules/express/lib/router/index.js +20 -15
- package/node_modules/express/lib/router/route.js +9 -0
- package/node_modules/express/lib/utils.js +1 -0
- package/node_modules/express/lib/view.js +1 -1
- package/node_modules/express/package.json +25 -26
- package/node_modules/finalhandler/HISTORY.md +8 -0
- package/node_modules/finalhandler/LICENSE +1 -1
- package/node_modules/finalhandler/README.md +5 -6
- package/node_modules/finalhandler/SECURITY.md +25 -0
- package/node_modules/finalhandler/index.js +8 -3
- package/node_modules/finalhandler/package.json +30 -32
- package/node_modules/fresh/package.json +6 -9
- package/node_modules/function-bind/.editorconfig +20 -0
- package/node_modules/function-bind/.eslintrc +15 -0
- package/node_modules/function-bind/.jscs.json +176 -0
- package/node_modules/function-bind/.npmignore +22 -0
- package/node_modules/function-bind/.travis.yml +168 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +48 -0
- package/node_modules/function-bind/implementation.js +52 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +96 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +37 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +98 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +334 -0
- package/node_modules/get-intrinsic/package.json +120 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/has/LICENSE-MIT +22 -0
- package/node_modules/has/README.md +18 -0
- package/node_modules/has/package.json +73 -0
- package/node_modules/has/src/index.js +5 -0
- package/node_modules/has/test/index.js +10 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +75 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.js +13 -0
- package/node_modules/has-symbols/package.json +126 -0
- package/node_modules/has-symbols/shams.js +42 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +28 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +28 -0
- package/node_modules/has-symbols/test/tests.js +56 -0
- package/node_modules/http-errors/HISTORY.md +15 -0
- package/node_modules/http-errors/README.md +2 -2
- package/node_modules/http-errors/index.js +15 -25
- package/node_modules/http-errors/package.json +22 -20
- package/node_modules/media-typer/package.json +6 -9
- package/node_modules/merge-descriptors/package.json +6 -9
- package/node_modules/methods/package.json +11 -14
- package/node_modules/object-inspect/.eslintrc +53 -0
- package/node_modules/object-inspect/.github/FUNDING.yml +12 -0
- package/node_modules/object-inspect/.nycrc +13 -0
- package/node_modules/object-inspect/CHANGELOG.md +360 -0
- package/node_modules/object-inspect/LICENSE +21 -0
- package/node_modules/object-inspect/example/all.js +23 -0
- package/node_modules/object-inspect/example/circular.js +6 -0
- package/node_modules/object-inspect/example/fn.js +5 -0
- package/node_modules/object-inspect/example/inspect.js +10 -0
- package/node_modules/object-inspect/index.js +512 -0
- package/node_modules/object-inspect/package-support.json +20 -0
- package/node_modules/object-inspect/package.json +122 -0
- package/node_modules/object-inspect/readme.markdown +86 -0
- package/node_modules/object-inspect/test/bigint.js +58 -0
- package/node_modules/object-inspect/test/browser/dom.js +15 -0
- package/node_modules/object-inspect/test/circular.js +16 -0
- package/node_modules/object-inspect/test/deep.js +12 -0
- package/node_modules/object-inspect/test/element.js +53 -0
- package/node_modules/object-inspect/test/err.js +48 -0
- package/node_modules/object-inspect/test/fakes.js +29 -0
- package/node_modules/object-inspect/test/fn.js +76 -0
- package/node_modules/object-inspect/test/has.js +15 -0
- package/node_modules/object-inspect/test/holes.js +15 -0
- package/node_modules/object-inspect/test/indent-option.js +271 -0
- package/node_modules/object-inspect/test/inspect.js +139 -0
- package/node_modules/object-inspect/test/lowbyte.js +12 -0
- package/node_modules/object-inspect/test/number.js +58 -0
- package/node_modules/object-inspect/test/quoteStyle.js +17 -0
- package/node_modules/object-inspect/test/toStringTag.js +40 -0
- package/node_modules/object-inspect/test/undef.js +12 -0
- package/node_modules/object-inspect/test/values.js +211 -0
- package/node_modules/object-inspect/test-core-js.js +26 -0
- package/node_modules/object-inspect/util.inspect.js +1 -0
- package/node_modules/on-finished/HISTORY.md +10 -0
- package/node_modules/on-finished/README.md +28 -20
- package/node_modules/on-finished/index.js +51 -13
- package/node_modules/on-finished/package.json +25 -20
- package/node_modules/path-to-regexp/package.json +6 -9
- package/node_modules/qs/CHANGELOG.md +22 -5
- package/node_modules/qs/README.md +7 -0
- package/node_modules/qs/dist/qs.js +1207 -5
- package/node_modules/qs/lib/parse.js +6 -0
- package/node_modules/qs/lib/stringify.js +33 -3
- package/node_modules/qs/package.json +16 -13
- package/node_modules/qs/test/parse.js +9 -0
- package/node_modules/qs/test/stringify.js +62 -1
- package/node_modules/raw-body/HISTORY.md +14 -0
- package/node_modules/raw-body/LICENSE +1 -1
- package/node_modules/raw-body/README.md +4 -0
- package/node_modules/raw-body/SECURITY.md +24 -0
- package/node_modules/raw-body/index.js +45 -2
- package/node_modules/raw-body/package.json +16 -15
- package/node_modules/send/HISTORY.md +15 -0
- package/node_modules/send/LICENSE +1 -1
- package/node_modules/send/README.md +2 -2
- package/node_modules/send/SECURITY.md +24 -0
- package/node_modules/send/index.js +37 -27
- package/node_modules/send/package.json +22 -21
- package/node_modules/serve-static/HISTORY.md +12 -0
- package/node_modules/serve-static/README.md +1 -1
- package/node_modules/serve-static/package.json +16 -16
- package/node_modules/side-channel/.eslintignore +1 -0
- package/node_modules/side-channel/.eslintrc +11 -0
- package/node_modules/side-channel/.github/FUNDING.yml +12 -0
- package/node_modules/side-channel/.nycrc +13 -0
- package/node_modules/side-channel/CHANGELOG.md +65 -0
- package/node_modules/side-channel/LICENSE +21 -0
- package/node_modules/side-channel/README.md +2 -0
- package/node_modules/side-channel/index.js +124 -0
- package/node_modules/side-channel/package.json +95 -0
- package/node_modules/side-channel/test/index.js +78 -0
- package/node_modules/statuses/HISTORY.md +17 -0
- package/node_modules/statuses/README.md +51 -42
- package/node_modules/statuses/codes.json +2 -3
- package/node_modules/statuses/index.js +52 -19
- package/node_modules/statuses/package.json +29 -31
- package/node_modules/unpipe/package.json +7 -9
- package/node_modules/utils-merge/package.json +6 -9
- package/package.json +2 -2
- package/worldmap/worldmap.js +90 -42
- package/worldmap.html +16 -2
- package/worldmap.js +553 -551
- package/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
- package/node_modules/depd/lib/compat/event-listener-count.js +0 -22
- package/node_modules/depd/lib/compat/index.js +0 -79
|
@@ -8,6 +8,7 @@ var isArray = Array.isArray;
|
|
|
8
8
|
var defaults = {
|
|
9
9
|
allowDots: false,
|
|
10
10
|
allowPrototypes: false,
|
|
11
|
+
allowSparse: false,
|
|
11
12
|
arrayLimit: 20,
|
|
12
13
|
charset: 'utf-8',
|
|
13
14
|
charsetSentinel: false,
|
|
@@ -217,6 +218,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
|
217
218
|
return {
|
|
218
219
|
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
|
219
220
|
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
221
|
+
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
220
222
|
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
221
223
|
charset: charset,
|
|
222
224
|
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
@@ -253,5 +255,9 @@ module.exports = function (str, opts) {
|
|
|
253
255
|
obj = utils.merge(obj, newObj, options);
|
|
254
256
|
}
|
|
255
257
|
|
|
258
|
+
if (options.allowSparse === true) {
|
|
259
|
+
return obj;
|
|
260
|
+
}
|
|
261
|
+
|
|
256
262
|
return utils.compact(obj);
|
|
257
263
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var getSideChannel = require('side-channel');
|
|
3
4
|
var utils = require('./utils');
|
|
4
5
|
var formats = require('./formats');
|
|
5
6
|
var has = Object.prototype.hasOwnProperty;
|
|
@@ -55,6 +56,8 @@ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
|
55
56
|
|| typeof v === 'bigint';
|
|
56
57
|
};
|
|
57
58
|
|
|
59
|
+
var sentinel = {};
|
|
60
|
+
|
|
58
61
|
var stringify = function stringify(
|
|
59
62
|
object,
|
|
60
63
|
prefix,
|
|
@@ -69,9 +72,30 @@ var stringify = function stringify(
|
|
|
69
72
|
format,
|
|
70
73
|
formatter,
|
|
71
74
|
encodeValuesOnly,
|
|
72
|
-
charset
|
|
75
|
+
charset,
|
|
76
|
+
sideChannel
|
|
73
77
|
) {
|
|
74
78
|
var obj = object;
|
|
79
|
+
|
|
80
|
+
var tmpSc = sideChannel;
|
|
81
|
+
var step = 0;
|
|
82
|
+
var findFlag = false;
|
|
83
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
|
|
84
|
+
// Where object last appeared in the ref tree
|
|
85
|
+
var pos = tmpSc.get(object);
|
|
86
|
+
step += 1;
|
|
87
|
+
if (typeof pos !== 'undefined') {
|
|
88
|
+
if (pos === step) {
|
|
89
|
+
throw new RangeError('Cyclic object value');
|
|
90
|
+
} else {
|
|
91
|
+
findFlag = true; // Break while
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (typeof tmpSc.get(sentinel) === 'undefined') {
|
|
95
|
+
step = 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
75
99
|
if (typeof filter === 'function') {
|
|
76
100
|
obj = filter(prefix, obj);
|
|
77
101
|
} else if (obj instanceof Date) {
|
|
@@ -138,6 +162,9 @@ var stringify = function stringify(
|
|
|
138
162
|
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
|
|
139
163
|
: prefix + (allowDots ? '.' + key : '[' + key + ']');
|
|
140
164
|
|
|
165
|
+
sideChannel.set(object, step);
|
|
166
|
+
var valueSideChannel = getSideChannel();
|
|
167
|
+
valueSideChannel.set(sentinel, sideChannel);
|
|
141
168
|
pushToArray(values, stringify(
|
|
142
169
|
value,
|
|
143
170
|
keyPrefix,
|
|
@@ -152,7 +179,8 @@ var stringify = function stringify(
|
|
|
152
179
|
format,
|
|
153
180
|
formatter,
|
|
154
181
|
encodeValuesOnly,
|
|
155
|
-
charset
|
|
182
|
+
charset,
|
|
183
|
+
valueSideChannel
|
|
156
184
|
));
|
|
157
185
|
}
|
|
158
186
|
|
|
@@ -246,6 +274,7 @@ module.exports = function (object, opts) {
|
|
|
246
274
|
objKeys.sort(options.sort);
|
|
247
275
|
}
|
|
248
276
|
|
|
277
|
+
var sideChannel = getSideChannel();
|
|
249
278
|
for (var i = 0; i < objKeys.length; ++i) {
|
|
250
279
|
var key = objKeys[i];
|
|
251
280
|
|
|
@@ -266,7 +295,8 @@ module.exports = function (object, opts) {
|
|
|
266
295
|
options.format,
|
|
267
296
|
options.formatter,
|
|
268
297
|
options.encodeValuesOnly,
|
|
269
|
-
options.charset
|
|
298
|
+
options.charset,
|
|
299
|
+
sideChannel
|
|
270
300
|
));
|
|
271
301
|
}
|
|
272
302
|
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "qs@6.
|
|
3
|
-
"_id": "qs@6.
|
|
2
|
+
"_from": "qs@6.10.3",
|
|
3
|
+
"_id": "qs@6.10.3",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
6
|
-
"_location": "/
|
|
5
|
+
"_integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
|
|
6
|
+
"_location": "/qs",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "version",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "qs@6.
|
|
11
|
+
"raw": "qs@6.10.3",
|
|
12
12
|
"name": "qs",
|
|
13
13
|
"escapedName": "qs",
|
|
14
|
-
"rawSpec": "6.
|
|
14
|
+
"rawSpec": "6.10.3",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "6.
|
|
16
|
+
"fetchSpec": "6.10.3"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
|
-
"/
|
|
20
|
-
"/
|
|
19
|
+
"/body-parser",
|
|
20
|
+
"/express"
|
|
21
21
|
],
|
|
22
|
-
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.
|
|
23
|
-
"_shasum": "
|
|
24
|
-
"_spec": "qs@6.
|
|
22
|
+
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
|
|
23
|
+
"_shasum": "d6cde1b2ffca87b5aa57889816c5f81535e22e8e",
|
|
24
|
+
"_spec": "qs@6.10.3",
|
|
25
25
|
"_where": "/Users/conway/Projects/worldmap/node_modules/express",
|
|
26
26
|
"bugs": {
|
|
27
27
|
"url": "https://github.com/ljharb/qs/issues"
|
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
"url": "http://ljharb.codes"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"side-channel": "^1.0.4"
|
|
39
|
+
},
|
|
37
40
|
"deprecated": false,
|
|
38
41
|
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
|
39
42
|
"devDependencies": {
|
|
@@ -95,5 +98,5 @@
|
|
|
95
98
|
"test": "npm run tests-only",
|
|
96
99
|
"tests-only": "nyc tape 'test/**/*.js'"
|
|
97
100
|
},
|
|
98
|
-
"version": "6.
|
|
101
|
+
"version": "6.10.3"
|
|
99
102
|
}
|
|
@@ -269,6 +269,15 @@ test('parse()', function (t) {
|
|
|
269
269
|
st.end();
|
|
270
270
|
});
|
|
271
271
|
|
|
272
|
+
t.test('parses sparse arrays', function (st) {
|
|
273
|
+
/* eslint no-sparse-arrays: 0 */
|
|
274
|
+
st.deepEqual(qs.parse('a[4]=1&a[1]=2', { allowSparse: true }), { a: [, '2', , , '1'] });
|
|
275
|
+
st.deepEqual(qs.parse('a[1][b][2][c]=1', { allowSparse: true }), { a: [, { b: [, , { c: '1' }] }] });
|
|
276
|
+
st.deepEqual(qs.parse('a[1][2][3][c]=1', { allowSparse: true }), { a: [, [, , [, , , { c: '1' }]]] });
|
|
277
|
+
st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { allowSparse: true }), { a: [, [, , [, , , { c: [, '1'] }]]] });
|
|
278
|
+
st.end();
|
|
279
|
+
});
|
|
280
|
+
|
|
272
281
|
t.test('parses semi-parsed strings', function (st) {
|
|
273
282
|
st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
|
|
274
283
|
st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
|
|
@@ -439,7 +439,7 @@ test('stringify()', function (t) {
|
|
|
439
439
|
st.end();
|
|
440
440
|
});
|
|
441
441
|
|
|
442
|
-
t.test('
|
|
442
|
+
t.test('does not blow up when Buffer global is missing', function (st) {
|
|
443
443
|
var tempBuffer = global.Buffer;
|
|
444
444
|
delete global.Buffer;
|
|
445
445
|
var result = qs.stringify({ a: 'b', c: 'd' });
|
|
@@ -448,6 +448,57 @@ test('stringify()', function (t) {
|
|
|
448
448
|
st.end();
|
|
449
449
|
});
|
|
450
450
|
|
|
451
|
+
t.test('does not crash when parsing circular references', function (st) {
|
|
452
|
+
var a = {};
|
|
453
|
+
a.b = a;
|
|
454
|
+
|
|
455
|
+
st['throws'](
|
|
456
|
+
function () { qs.stringify({ 'foo[bar]': 'baz', 'foo[baz]': a }); },
|
|
457
|
+
/RangeError: Cyclic object value/,
|
|
458
|
+
'cyclic values throw'
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
var circular = {
|
|
462
|
+
a: 'value'
|
|
463
|
+
};
|
|
464
|
+
circular.a = circular;
|
|
465
|
+
st['throws'](
|
|
466
|
+
function () { qs.stringify(circular); },
|
|
467
|
+
/RangeError: Cyclic object value/,
|
|
468
|
+
'cyclic values throw'
|
|
469
|
+
);
|
|
470
|
+
|
|
471
|
+
var arr = ['a'];
|
|
472
|
+
st.doesNotThrow(
|
|
473
|
+
function () { qs.stringify({ x: arr, y: arr }); },
|
|
474
|
+
'non-cyclic values do not throw'
|
|
475
|
+
);
|
|
476
|
+
|
|
477
|
+
st.end();
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
t.test('non-circular duplicated references can still work', function (st) {
|
|
481
|
+
var hourOfDay = {
|
|
482
|
+
'function': 'hour_of_day'
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
var p1 = {
|
|
486
|
+
'function': 'gte',
|
|
487
|
+
arguments: [hourOfDay, 0]
|
|
488
|
+
};
|
|
489
|
+
var p2 = {
|
|
490
|
+
'function': 'lte',
|
|
491
|
+
arguments: [hourOfDay, 23]
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
st.equal(
|
|
495
|
+
qs.stringify({ filters: { $and: [p1, p2] } }, { encodeValuesOnly: true }),
|
|
496
|
+
'filters[$and][0][function]=gte&filters[$and][0][arguments][0][function]=hour_of_day&filters[$and][0][arguments][1]=0&filters[$and][1][function]=lte&filters[$and][1][arguments][0][function]=hour_of_day&filters[$and][1][arguments][1]=23'
|
|
497
|
+
);
|
|
498
|
+
|
|
499
|
+
st.end();
|
|
500
|
+
});
|
|
501
|
+
|
|
451
502
|
t.test('selects properties when filter=array', function (st) {
|
|
452
503
|
st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
|
|
453
504
|
st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
|
|
@@ -800,5 +851,15 @@ test('stringify()', function (t) {
|
|
|
800
851
|
st.end();
|
|
801
852
|
});
|
|
802
853
|
|
|
854
|
+
t.test('stringifies sparse arrays', function (st) {
|
|
855
|
+
/* eslint no-sparse-arrays: 0 */
|
|
856
|
+
st.equal(qs.stringify({ a: [, '2', , , '1'] }, { encodeValuesOnly: true }), 'a[1]=2&a[4]=1');
|
|
857
|
+
st.equal(qs.stringify({ a: [, { b: [, , { c: '1' }] }] }, { encodeValuesOnly: true }), 'a[1][b][2][c]=1');
|
|
858
|
+
st.equal(qs.stringify({ a: [, [, , [, , , { c: '1' }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c]=1');
|
|
859
|
+
st.equal(qs.stringify({ a: [, [, , [, , , { c: [, '1'] }]]] }, { encodeValuesOnly: true }), 'a[1][2][3][c][1]=1');
|
|
860
|
+
|
|
861
|
+
st.end();
|
|
862
|
+
});
|
|
863
|
+
|
|
803
864
|
t.end();
|
|
804
865
|
});
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
2.5.1 / 2022-02-28
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
* Fix error on early async hooks implementations
|
|
5
|
+
|
|
6
|
+
2.5.0 / 2022-02-21
|
|
7
|
+
==================
|
|
8
|
+
|
|
9
|
+
* Prevent loss of async hooks context
|
|
10
|
+
* Prevent hanging when stream is not readable
|
|
11
|
+
* deps: http-errors@2.0.0
|
|
12
|
+
- deps: depd@2.0.0
|
|
13
|
+
- deps: statuses@2.0.1
|
|
14
|
+
|
|
1
15
|
2.4.3 / 2022-02-14
|
|
2
16
|
==================
|
|
3
17
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2013-2014 Jonathan Ong <me@jongleberry.com>
|
|
4
|
-
Copyright (c) 2014-
|
|
4
|
+
Copyright (c) 2014-2022 Douglas Christopher Wilson <doug@somethingdoug.com>
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -111,6 +111,10 @@ This error will occur when the given stream has an encoding set on it, making it
|
|
|
111
111
|
a decoded stream. The stream should not have an encoding set and is expected to
|
|
112
112
|
emit `Buffer` objects.
|
|
113
113
|
|
|
114
|
+
#### stream.not.readable
|
|
115
|
+
|
|
116
|
+
This error will occur when the given stream is not readable.
|
|
117
|
+
|
|
114
118
|
## Examples
|
|
115
119
|
|
|
116
120
|
### Simple Express example
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Security Policies and Procedures
|
|
2
|
+
|
|
3
|
+
## Reporting a Bug
|
|
4
|
+
|
|
5
|
+
The `raw-body` team and community take all security bugs seriously. Thank you
|
|
6
|
+
for improving the security of Express. We appreciate your efforts and
|
|
7
|
+
responsible disclosure and will make every effort to acknowledge your
|
|
8
|
+
contributions.
|
|
9
|
+
|
|
10
|
+
Report security bugs by emailing the current owners of `raw-body`. This information
|
|
11
|
+
can be found in the npm registry using the command `npm owner ls raw-body`.
|
|
12
|
+
If unsure or unable to get the information from the above, open an issue
|
|
13
|
+
in the [project issue tracker](https://github.com/stream-utils/raw-body/issues)
|
|
14
|
+
asking for the current contact information.
|
|
15
|
+
|
|
16
|
+
To ensure the timely response to your report, please ensure that the entirety
|
|
17
|
+
of the report is contained within the email body and not solely behind a web
|
|
18
|
+
link or an attachment.
|
|
19
|
+
|
|
20
|
+
At least one owner will acknowledge your email within 48 hours, and will send a
|
|
21
|
+
more detailed response within 48 hours indicating the next steps in handling
|
|
22
|
+
your report. After the initial reply to your report, the owners will
|
|
23
|
+
endeavor to keep you informed of the progress towards a fix and full
|
|
24
|
+
announcement, and may ask for additional information or guidance.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* raw-body
|
|
3
3
|
* Copyright(c) 2013-2014 Jonathan Ong
|
|
4
|
-
* Copyright(c) 2014-
|
|
4
|
+
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
5
5
|
* MIT Licensed
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* @private
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
var asyncHooks = tryRequireAsyncHooks()
|
|
15
16
|
var bytes = require('bytes')
|
|
16
17
|
var createError = require('http-errors')
|
|
17
18
|
var iconv = require('iconv-lite')
|
|
@@ -105,7 +106,7 @@ function getRawBody (stream, options, callback) {
|
|
|
105
106
|
|
|
106
107
|
if (done) {
|
|
107
108
|
// classic callback style
|
|
108
|
-
return readStream(stream, encoding, length, limit, done)
|
|
109
|
+
return readStream(stream, encoding, length, limit, wrap(done))
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
return new Promise(function executor (resolve, reject) {
|
|
@@ -173,6 +174,12 @@ function readStream (stream, encoding, length, limit, callback) {
|
|
|
173
174
|
}))
|
|
174
175
|
}
|
|
175
176
|
|
|
177
|
+
if (typeof stream.readable !== 'undefined' && !stream.readable) {
|
|
178
|
+
return done(createError(500, 'stream is not readable', {
|
|
179
|
+
type: 'stream.not.readable'
|
|
180
|
+
}))
|
|
181
|
+
}
|
|
182
|
+
|
|
176
183
|
var received = 0
|
|
177
184
|
var decoder
|
|
178
185
|
|
|
@@ -284,3 +291,39 @@ function readStream (stream, encoding, length, limit, callback) {
|
|
|
284
291
|
stream.removeListener('close', cleanup)
|
|
285
292
|
}
|
|
286
293
|
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Try to require async_hooks
|
|
297
|
+
* @private
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
function tryRequireAsyncHooks () {
|
|
301
|
+
try {
|
|
302
|
+
return require('async_hooks')
|
|
303
|
+
} catch (e) {
|
|
304
|
+
return {}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Wrap function with async resource, if possible.
|
|
310
|
+
* AsyncResource.bind static method backported.
|
|
311
|
+
* @private
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
function wrap (fn) {
|
|
315
|
+
var res
|
|
316
|
+
|
|
317
|
+
// create anonymous resource
|
|
318
|
+
if (asyncHooks.AsyncResource) {
|
|
319
|
+
res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn')
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// incompatible node.js
|
|
323
|
+
if (!res || !res.runInAsyncScope) {
|
|
324
|
+
return fn
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// return bound function
|
|
328
|
+
return res.runInAsyncScope.bind(res, fn, null)
|
|
329
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "raw-body@2.
|
|
3
|
-
"_id": "raw-body@2.
|
|
2
|
+
"_from": "raw-body@2.5.1",
|
|
3
|
+
"_id": "raw-body@2.5.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
6
|
-
"_location": "/
|
|
5
|
+
"_integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
|
|
6
|
+
"_location": "/raw-body",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "version",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "raw-body@2.
|
|
11
|
+
"raw": "raw-body@2.5.1",
|
|
12
12
|
"name": "raw-body",
|
|
13
13
|
"escapedName": "raw-body",
|
|
14
|
-
"rawSpec": "2.
|
|
14
|
+
"rawSpec": "2.5.1",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "2.
|
|
16
|
+
"fetchSpec": "2.5.1"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
|
-
"/
|
|
19
|
+
"/body-parser"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "raw-body@2.
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
|
|
22
|
+
"_shasum": "fe1b1628b181b700215e5fd42389f98b71392857",
|
|
23
|
+
"_spec": "raw-body@2.5.1",
|
|
24
24
|
"_where": "/Users/conway/Projects/worldmap/node_modules/body-parser",
|
|
25
25
|
"author": {
|
|
26
26
|
"name": "Jonathan Ong",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"bytes": "3.1.2",
|
|
46
|
-
"http-errors": "
|
|
46
|
+
"http-errors": "2.0.0",
|
|
47
47
|
"iconv-lite": "0.4.24",
|
|
48
48
|
"unpipe": "1.0.0"
|
|
49
49
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"eslint-plugin-node": "11.1.0",
|
|
59
59
|
"eslint-plugin-promise": "5.2.0",
|
|
60
60
|
"eslint-plugin-standard": "4.1.0",
|
|
61
|
-
"mocha": "9.2.
|
|
61
|
+
"mocha": "9.2.1",
|
|
62
62
|
"nyc": "15.1.0",
|
|
63
63
|
"readable-stream": "2.3.7",
|
|
64
64
|
"safe-buffer": "5.2.1"
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"HISTORY.md",
|
|
71
71
|
"LICENSE",
|
|
72
72
|
"README.md",
|
|
73
|
+
"SECURITY.md",
|
|
73
74
|
"index.d.ts",
|
|
74
75
|
"index.js"
|
|
75
76
|
],
|
|
@@ -83,8 +84,8 @@
|
|
|
83
84
|
"scripts": {
|
|
84
85
|
"lint": "eslint .",
|
|
85
86
|
"test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/",
|
|
86
|
-
"test-ci": "nyc --reporter=
|
|
87
|
+
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
|
|
87
88
|
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
88
89
|
},
|
|
89
|
-
"version": "2.
|
|
90
|
+
"version": "2.5.1"
|
|
90
91
|
}
|
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
0.18.0 / 2022-03-23
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
* Fix emitted 416 error missing headers property
|
|
5
|
+
* Limit the headers removed for 304 response
|
|
6
|
+
* deps: depd@2.0.0
|
|
7
|
+
- Replace internal `eval` usage with `Function` constructor
|
|
8
|
+
- Use instance methods on `process` to check for listeners
|
|
9
|
+
* deps: destroy@1.2.0
|
|
10
|
+
* deps: http-errors@2.0.0
|
|
11
|
+
- deps: depd@2.0.0
|
|
12
|
+
- deps: statuses@2.0.1
|
|
13
|
+
* deps: on-finished@2.4.1
|
|
14
|
+
* deps: statuses@2.0.1
|
|
15
|
+
|
|
1
16
|
0.17.2 / 2021-12-11
|
|
2
17
|
===================
|
|
3
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(The MIT License)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2012 TJ Holowaychuk
|
|
4
|
-
Copyright (c) 2014-
|
|
4
|
+
Copyright (c) 2014-2022 Douglas Christopher Wilson
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
7
|
a copy of this software and associated documentation files (the
|
|
@@ -318,8 +318,8 @@ server.listen(3000)
|
|
|
318
318
|
[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send
|
|
319
319
|
[coveralls-image]: https://badgen.net/coveralls/c/github/pillarjs/send/master
|
|
320
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=
|
|
322
|
-
[github-actions-ci-url]: https://github.com/pillarjs/send/actions
|
|
321
|
+
[github-actions-ci-image]: https://badgen.net/github/checks/pillarjs/send/master?label=linux
|
|
322
|
+
[github-actions-ci-url]: https://github.com/pillarjs/send/actions/workflows/ci.yml
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Security Policies and Procedures
|
|
2
|
+
|
|
3
|
+
## Reporting a Bug
|
|
4
|
+
|
|
5
|
+
The `send` team and community take all security bugs seriously. Thank you
|
|
6
|
+
for improving the security of Express. We appreciate your efforts and
|
|
7
|
+
responsible disclosure and will make every effort to acknowledge your
|
|
8
|
+
contributions.
|
|
9
|
+
|
|
10
|
+
Report security bugs by emailing the current owner(s) of `send`. This information
|
|
11
|
+
can be found in the npm registry using the command `npm owner ls send`.
|
|
12
|
+
If unsure or unable to get the information from the above, open an issue
|
|
13
|
+
in the [project issue tracker](https://github.com/pillarjs/send/issues)
|
|
14
|
+
asking for the current contact information.
|
|
15
|
+
|
|
16
|
+
To ensure the timely response to your report, please ensure that the entirety
|
|
17
|
+
of the report is contained within the email body and not solely behind a web
|
|
18
|
+
link or an attachment.
|
|
19
|
+
|
|
20
|
+
At least one owner will acknowledge your email within 48 hours, and will send a
|
|
21
|
+
more detailed response within 48 hours indicating the next steps in handling
|
|
22
|
+
your report. After the initial reply to your report, the owners will
|
|
23
|
+
endeavor to keep you informed of the progress towards a fix and full
|
|
24
|
+
announcement, and may ask for additional information or guidance.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* send
|
|
3
3
|
* Copyright(c) 2012 TJ Holowaychuk
|
|
4
|
-
* Copyright(c) 2014-
|
|
4
|
+
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
5
5
|
* MIT Licensed
|
|
6
6
|
*/
|
|
7
7
|
|
|
@@ -267,13 +267,11 @@ SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) {
|
|
|
267
267
|
SendStream.prototype.error = function error (status, err) {
|
|
268
268
|
// emit if listeners instead of responding
|
|
269
269
|
if (hasListeners(this, 'error')) {
|
|
270
|
-
return this.emit('error',
|
|
271
|
-
expose: false
|
|
272
|
-
}))
|
|
270
|
+
return this.emit('error', createHttpError(status, err))
|
|
273
271
|
}
|
|
274
272
|
|
|
275
273
|
var res = this.res
|
|
276
|
-
var msg = statuses[status] || String(status)
|
|
274
|
+
var msg = statuses.message[status] || String(status)
|
|
277
275
|
var doc = createHtmlDocument('Error', escapeHtml(msg))
|
|
278
276
|
|
|
279
277
|
// clear existing headers
|
|
@@ -349,21 +347,19 @@ SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {
|
|
|
349
347
|
}
|
|
350
348
|
|
|
351
349
|
/**
|
|
352
|
-
* Strip content
|
|
350
|
+
* Strip various content header fields for a change in entity.
|
|
353
351
|
*
|
|
354
352
|
* @private
|
|
355
353
|
*/
|
|
356
354
|
|
|
357
355
|
SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {
|
|
358
356
|
var res = this.res
|
|
359
|
-
var headers = getHeaderNames(res)
|
|
360
357
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}
|
|
358
|
+
res.removeHeader('Content-Encoding')
|
|
359
|
+
res.removeHeader('Content-Language')
|
|
360
|
+
res.removeHeader('Content-Length')
|
|
361
|
+
res.removeHeader('Content-Range')
|
|
362
|
+
res.removeHeader('Content-Type')
|
|
367
363
|
}
|
|
368
364
|
|
|
369
365
|
/**
|
|
@@ -787,8 +783,6 @@ SendStream.prototype.sendIndex = function sendIndex (path) {
|
|
|
787
783
|
*/
|
|
788
784
|
|
|
789
785
|
SendStream.prototype.stream = function stream (path, options) {
|
|
790
|
-
// TODO: this is all lame, refactor meeee
|
|
791
|
-
var finished = false
|
|
792
786
|
var self = this
|
|
793
787
|
var res = this.res
|
|
794
788
|
|
|
@@ -797,20 +791,18 @@ SendStream.prototype.stream = function stream (path, options) {
|
|
|
797
791
|
this.emit('stream', stream)
|
|
798
792
|
stream.pipe(res)
|
|
799
793
|
|
|
800
|
-
//
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
})
|
|
794
|
+
// cleanup
|
|
795
|
+
function cleanup () {
|
|
796
|
+
destroy(stream, true)
|
|
797
|
+
}
|
|
805
798
|
|
|
806
|
-
//
|
|
807
|
-
|
|
808
|
-
// request already finished
|
|
809
|
-
if (finished) return
|
|
799
|
+
// response finished, cleanup
|
|
800
|
+
onFinished(res, cleanup)
|
|
810
801
|
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
802
|
+
// error handling
|
|
803
|
+
stream.on('error', function onerror (err) {
|
|
804
|
+
// clean up stream early
|
|
805
|
+
cleanup()
|
|
814
806
|
|
|
815
807
|
// error
|
|
816
808
|
self.onStatError(err)
|
|
@@ -974,6 +966,24 @@ function createHtmlDocument (title, body) {
|
|
|
974
966
|
'</html>\n'
|
|
975
967
|
}
|
|
976
968
|
|
|
969
|
+
/**
|
|
970
|
+
* Create a HttpError object from simple arguments.
|
|
971
|
+
*
|
|
972
|
+
* @param {number} status
|
|
973
|
+
* @param {Error|object} err
|
|
974
|
+
* @private
|
|
975
|
+
*/
|
|
976
|
+
|
|
977
|
+
function createHttpError (status, err) {
|
|
978
|
+
if (!err) {
|
|
979
|
+
return createError(status)
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
return err instanceof Error
|
|
983
|
+
? createError(status, err, { expose: false })
|
|
984
|
+
: createError(status, err)
|
|
985
|
+
}
|
|
986
|
+
|
|
977
987
|
/**
|
|
978
988
|
* decodeURIComponent.
|
|
979
989
|
*
|