node-red-contrib-web-worldmap 2.27.1 → 2.28.0
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 +2 -0
- package/README.md +2 -0
- package/node_modules/accepts/HISTORY.md +7 -0
- package/node_modules/accepts/README.md +3 -5
- package/node_modules/accepts/package.json +31 -34
- package/node_modules/body-parser/HISTORY.md +9 -0
- package/node_modules/body-parser/node_modules/bytes/History.md +5 -0
- package/node_modules/body-parser/node_modules/bytes/index.js +4 -0
- package/node_modules/body-parser/node_modules/bytes/package.json +11 -11
- package/node_modules/body-parser/package.json +16 -16
- package/node_modules/compressible/HISTORY.md +7 -0
- package/node_modules/compressible/package.json +26 -29
- package/node_modules/cookie/HISTORY.md +6 -0
- package/node_modules/cookie/README.md +49 -20
- package/node_modules/cookie/index.js +11 -11
- package/node_modules/cookie/package.json +18 -16
- package/node_modules/express/History.md +15 -0
- package/node_modules/express/lib/response.js +1 -1
- package/node_modules/express/lib/utils.js +2 -1
- package/node_modules/express/package.json +16 -15
- package/node_modules/mime-db/HISTORY.md +82 -0
- package/node_modules/mime-db/README.md +15 -9
- package/node_modules/mime-db/db.json +689 -52
- package/node_modules/mime-db/package.json +29 -31
- package/node_modules/mime-types/HISTORY.md +82 -2
- package/node_modules/mime-types/README.md +8 -8
- package/node_modules/mime-types/package.json +29 -31
- package/node_modules/negotiator/HISTORY.md +5 -0
- package/node_modules/negotiator/README.md +3 -3
- package/node_modules/negotiator/index.js +4 -46
- package/node_modules/negotiator/lib/language.js +3 -3
- package/node_modules/negotiator/package.json +22 -25
- package/node_modules/qs/.editorconfig +1 -0
- package/node_modules/qs/.eslintrc +6 -3
- package/node_modules/qs/CHANGELOG.md +12 -0
- package/node_modules/qs/README.md +31 -19
- package/node_modules/qs/dist/qs.js +16 -6
- package/node_modules/qs/lib/parse.js +1 -1
- package/node_modules/qs/lib/stringify.js +14 -5
- package/node_modules/qs/lib/utils.js +1 -0
- package/node_modules/qs/package.json +22 -21
- package/node_modules/qs/test/parse.js +60 -0
- package/node_modules/qs/test/stringify.js +23 -12
- package/node_modules/raw-body/HISTORY.md +5 -0
- package/node_modules/raw-body/README.md +5 -3
- package/node_modules/raw-body/node_modules/bytes/History.md +5 -0
- package/node_modules/raw-body/node_modules/bytes/index.js +4 -0
- package/node_modules/raw-body/node_modules/bytes/package.json +11 -11
- package/node_modules/raw-body/package.json +14 -14
- package/package.json +1 -1
- package/worldmap/index.html +1 -0
- package/worldmap/index3d.html +203 -194
- package/worldmap/leaflet/leaflet.antimeridian-src.js +254 -0
- package/worldmap/leaflet/sockjs.min.js +3 -3
- package/worldmap/worldmap.js +26 -10
- package/worldmap.html +23 -11
- package/worldmap.js +8 -1
- package/node_modules/qs/.eslintignore +0 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# qs <sup>[![Version Badge][2]][1]</sup>
|
|
2
2
|
|
|
3
|
-
[![
|
|
4
|
-
[![
|
|
5
|
-
[![
|
|
3
|
+
[![github actions][actions-image]][actions-url]
|
|
4
|
+
[![coverage][codecov-image]][codecov-url]
|
|
5
|
+
[![dependency status][deps-svg]][deps-url]
|
|
6
|
+
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
|
6
7
|
[![License][license-image]][license-url]
|
|
7
8
|
[![Downloads][downloads-image]][downloads-url]
|
|
8
9
|
|
|
9
|
-
[![npm badge][
|
|
10
|
+
[![npm badge][npm-badge-png]][package-url]
|
|
10
11
|
|
|
11
12
|
A querystring parsing and stringifying library with some added security.
|
|
12
13
|
|
|
@@ -280,6 +281,17 @@ assert.deepEqual(arraysOfObjects, { a: ['b', 'c'] })
|
|
|
280
281
|
```
|
|
281
282
|
(_this cannot convert nested objects, such as `a={b:1},{c:d}`_)
|
|
282
283
|
|
|
284
|
+
### Parsing primitive/scalar values (numbers, booleans, null, etc)
|
|
285
|
+
|
|
286
|
+
By default, all values are parsed as strings. This behavior will not change and is explained in [issue #91](https://github.com/ljharb/qs/issues/91).
|
|
287
|
+
|
|
288
|
+
```javascript
|
|
289
|
+
var primitiveValues = qs.parse('a=15&b=true&c=null');
|
|
290
|
+
assert.deepEqual(primitiveValues, { a: '15', b: 'true', c: 'null' });
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
If you wish to auto-convert values which look like numbers, booleans, and other values into their primitive counterparts, you can use the [query-types Express JS middleware](https://github.com/xpepermint/query-types) which will auto-convert all request query parameters.
|
|
294
|
+
|
|
283
295
|
### Stringifying
|
|
284
296
|
|
|
285
297
|
[](#preventEval)
|
|
@@ -345,7 +357,7 @@ var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str, defaultE
|
|
|
345
357
|
The type argument is also provided to the decoder:
|
|
346
358
|
|
|
347
359
|
```javascript
|
|
348
|
-
var decoded = qs.parse('x=z', { decoder: function (str,
|
|
360
|
+
var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, type) {
|
|
349
361
|
if (type === 'key') {
|
|
350
362
|
return // Decoded key
|
|
351
363
|
} else if (type === 'value') {
|
|
@@ -587,18 +599,18 @@ Available as part of the Tidelift Subscription
|
|
|
587
599
|
|
|
588
600
|
The maintainers of qs and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-qs?utm_source=npm-qs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
589
601
|
|
|
590
|
-
[
|
|
591
|
-
[
|
|
592
|
-
[
|
|
593
|
-
[
|
|
594
|
-
[
|
|
595
|
-
[
|
|
596
|
-
[
|
|
597
|
-
[
|
|
598
|
-
[9]: https://ci.testling.com/ljharb/qs.png
|
|
599
|
-
[10]: https://ci.testling.com/ljharb/qs
|
|
600
|
-
[11]: https://nodei.co/npm/qs.png?downloads=true&stars=true
|
|
601
|
-
[license-image]: http://img.shields.io/npm/l/qs.svg
|
|
602
|
+
[package-url]: https://npmjs.org/package/qs
|
|
603
|
+
[npm-version-svg]: https://versionbadg.es/ljharb/qs.svg
|
|
604
|
+
[deps-svg]: https://david-dm.org/ljharb/qs.svg
|
|
605
|
+
[deps-url]: https://david-dm.org/ljharb/qs
|
|
606
|
+
[dev-deps-svg]: https://david-dm.org/ljharb/qs/dev-status.svg
|
|
607
|
+
[dev-deps-url]: https://david-dm.org/ljharb/qs#info=devDependencies
|
|
608
|
+
[npm-badge-png]: https://nodei.co/npm/qs.png?downloads=true&stars=true
|
|
609
|
+
[license-image]: https://img.shields.io/npm/l/qs.svg
|
|
602
610
|
[license-url]: LICENSE
|
|
603
|
-
[downloads-image]:
|
|
604
|
-
[downloads-url]:
|
|
611
|
+
[downloads-image]: https://img.shields.io/npm/dm/qs.svg
|
|
612
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=qs
|
|
613
|
+
[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg
|
|
614
|
+
[codecov-url]: https://app.codecov.io/gh/ljharb/qs/
|
|
615
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs
|
|
616
|
+
[actions-url]: https://github.com/ljharb/qs/actions
|
|
@@ -174,7 +174,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
|
|
|
174
174
|
) {
|
|
175
175
|
obj = [];
|
|
176
176
|
obj[index] = leaf;
|
|
177
|
-
} else {
|
|
177
|
+
} else if (cleanRoot !== '__proto__') {
|
|
178
178
|
obj[cleanRoot] = leaf;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
@@ -316,6 +316,7 @@ var arrayPrefixGenerators = {
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
var isArray = Array.isArray;
|
|
319
|
+
var split = String.prototype.split;
|
|
319
320
|
var push = Array.prototype.push;
|
|
320
321
|
var pushToArray = function (arr, valueOrArray) {
|
|
321
322
|
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
@@ -393,6 +394,14 @@ var stringify = function stringify(
|
|
|
393
394
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
394
395
|
if (encoder) {
|
|
395
396
|
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
397
|
+
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
|
|
398
|
+
var valuesArray = split.call(String(obj), ',');
|
|
399
|
+
var valuesJoined = '';
|
|
400
|
+
for (var i = 0; i < valuesArray.length; ++i) {
|
|
401
|
+
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
|
|
402
|
+
}
|
|
403
|
+
return [formatter(keyValue) + '=' + valuesJoined];
|
|
404
|
+
}
|
|
396
405
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
397
406
|
}
|
|
398
407
|
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
@@ -407,7 +416,7 @@ var stringify = function stringify(
|
|
|
407
416
|
var objKeys;
|
|
408
417
|
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
409
418
|
// we need to join elements in
|
|
410
|
-
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];
|
|
419
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
411
420
|
} else if (isArray(filter)) {
|
|
412
421
|
objKeys = filter;
|
|
413
422
|
} else {
|
|
@@ -415,9 +424,9 @@ var stringify = function stringify(
|
|
|
415
424
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
416
425
|
}
|
|
417
426
|
|
|
418
|
-
for (var
|
|
419
|
-
var key = objKeys[
|
|
420
|
-
var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];
|
|
427
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
428
|
+
var key = objKeys[j];
|
|
429
|
+
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
421
430
|
|
|
422
431
|
if (skipNulls && value === null) {
|
|
423
432
|
continue;
|
|
@@ -453,7 +462,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
453
462
|
return defaults;
|
|
454
463
|
}
|
|
455
464
|
|
|
456
|
-
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
|
465
|
+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
457
466
|
throw new TypeError('Encoder has to be a function.');
|
|
458
467
|
}
|
|
459
468
|
|
|
@@ -755,6 +764,7 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
755
764
|
|
|
756
765
|
i += 1;
|
|
757
766
|
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
767
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
758
768
|
out += hexTable[0xF0 | (c >> 18)]
|
|
759
769
|
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
760
770
|
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
@@ -18,6 +18,7 @@ var arrayPrefixGenerators = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
var isArray = Array.isArray;
|
|
21
|
+
var split = String.prototype.split;
|
|
21
22
|
var push = Array.prototype.push;
|
|
22
23
|
var pushToArray = function (arr, valueOrArray) {
|
|
23
24
|
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
@@ -95,6 +96,14 @@ var stringify = function stringify(
|
|
|
95
96
|
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
96
97
|
if (encoder) {
|
|
97
98
|
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
|
|
99
|
+
if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
|
|
100
|
+
var valuesArray = split.call(String(obj), ',');
|
|
101
|
+
var valuesJoined = '';
|
|
102
|
+
for (var i = 0; i < valuesArray.length; ++i) {
|
|
103
|
+
valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
|
|
104
|
+
}
|
|
105
|
+
return [formatter(keyValue) + '=' + valuesJoined];
|
|
106
|
+
}
|
|
98
107
|
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
|
|
99
108
|
}
|
|
100
109
|
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
@@ -109,7 +118,7 @@ var stringify = function stringify(
|
|
|
109
118
|
var objKeys;
|
|
110
119
|
if (generateArrayPrefix === 'comma' && isArray(obj)) {
|
|
111
120
|
// we need to join elements in
|
|
112
|
-
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];
|
|
121
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
113
122
|
} else if (isArray(filter)) {
|
|
114
123
|
objKeys = filter;
|
|
115
124
|
} else {
|
|
@@ -117,9 +126,9 @@ var stringify = function stringify(
|
|
|
117
126
|
objKeys = sort ? keys.sort(sort) : keys;
|
|
118
127
|
}
|
|
119
128
|
|
|
120
|
-
for (var
|
|
121
|
-
var key = objKeys[
|
|
122
|
-
var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];
|
|
129
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
130
|
+
var key = objKeys[j];
|
|
131
|
+
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
123
132
|
|
|
124
133
|
if (skipNulls && value === null) {
|
|
125
134
|
continue;
|
|
@@ -155,7 +164,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
|
155
164
|
return defaults;
|
|
156
165
|
}
|
|
157
166
|
|
|
158
|
-
if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
|
|
167
|
+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
159
168
|
throw new TypeError('Encoder has to be a function.');
|
|
160
169
|
}
|
|
161
170
|
|
|
@@ -177,6 +177,7 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
|
177
177
|
|
|
178
178
|
i += 1;
|
|
179
179
|
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
180
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
180
181
|
out += hexTable[0xF0 | (c >> 18)]
|
|
181
182
|
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
182
183
|
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "qs@6.9.
|
|
3
|
-
"_id": "qs@6.9.
|
|
2
|
+
"_from": "qs@6.9.7",
|
|
3
|
+
"_id": "qs@6.9.7",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==",
|
|
6
6
|
"_location": "/node-red-contrib-web-worldmap/qs",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "version",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "qs@6.9.
|
|
11
|
+
"raw": "qs@6.9.7",
|
|
12
12
|
"name": "qs",
|
|
13
13
|
"escapedName": "qs",
|
|
14
|
-
"rawSpec": "6.9.
|
|
14
|
+
"rawSpec": "6.9.7",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "6.9.
|
|
16
|
+
"fetchSpec": "6.9.7"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/node-red-contrib-web-worldmap/body-parser",
|
|
20
20
|
"/node-red-contrib-web-worldmap/express"
|
|
21
21
|
],
|
|
22
|
-
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.9.
|
|
23
|
-
"_shasum": "
|
|
24
|
-
"_spec": "qs@6.9.
|
|
22
|
+
"_resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz",
|
|
23
|
+
"_shasum": "4610846871485e1e048f44ae3b94033f0e675afe",
|
|
24
|
+
"_spec": "qs@6.9.7",
|
|
25
25
|
"_where": "/Users/conway/Projects/worldmap/node_modules/express",
|
|
26
26
|
"bugs": {
|
|
27
27
|
"url": "https://github.com/ljharb/qs/issues"
|
|
@@ -34,26 +34,26 @@
|
|
|
34
34
|
"url": "http://ljharb.codes"
|
|
35
35
|
}
|
|
36
36
|
],
|
|
37
|
-
"dependencies": {},
|
|
38
37
|
"deprecated": false,
|
|
39
38
|
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
|
40
39
|
"devDependencies": {
|
|
41
|
-
"@ljharb/eslint-config": "^
|
|
42
|
-
"aud": "^1.1.
|
|
40
|
+
"@ljharb/eslint-config": "^20.1.0",
|
|
41
|
+
"aud": "^1.1.5",
|
|
43
42
|
"browserify": "^16.5.2",
|
|
44
43
|
"eclint": "^2.8.1",
|
|
45
|
-
"eslint": "^
|
|
44
|
+
"eslint": "^8.6.0",
|
|
46
45
|
"evalmd": "^0.0.19",
|
|
47
46
|
"for-each": "^0.3.3",
|
|
48
|
-
"has-symbols": "^1.0.
|
|
47
|
+
"has-symbols": "^1.0.2",
|
|
49
48
|
"iconv-lite": "^0.5.1",
|
|
49
|
+
"in-publish": "^2.0.1",
|
|
50
50
|
"mkdirp": "^0.5.5",
|
|
51
51
|
"nyc": "^10.3.2",
|
|
52
|
-
"object-inspect": "^1.
|
|
52
|
+
"object-inspect": "^1.12.0",
|
|
53
53
|
"qs-iconv": "^1.0.4",
|
|
54
|
-
"safe-publish-latest": "^
|
|
54
|
+
"safe-publish-latest": "^2.0.0",
|
|
55
55
|
"safer-buffer": "^2.1.2",
|
|
56
|
-
"tape": "^5.
|
|
56
|
+
"tape": "^5.4.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=0.6"
|
|
@@ -85,14 +85,15 @@
|
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js",
|
|
88
|
-
"lint": "eslint
|
|
89
|
-
"postlint": "eclint check * lib/* test/*",
|
|
88
|
+
"lint": "eslint .",
|
|
89
|
+
"postlint": "eclint check * lib/* test/* !dist/*",
|
|
90
90
|
"posttest": "aud --production",
|
|
91
|
-
"prepublish": "
|
|
91
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
92
|
+
"prepublishOnly": "safe-publish-latest && npm run dist",
|
|
92
93
|
"pretest": "npm run --silent readme && npm run --silent lint",
|
|
93
94
|
"readme": "evalmd README.md",
|
|
94
95
|
"test": "npm run tests-only",
|
|
95
96
|
"tests-only": "nyc tape 'test/**/*.js'"
|
|
96
97
|
},
|
|
97
|
-
"version": "6.9.
|
|
98
|
+
"version": "6.9.7"
|
|
98
99
|
}
|
|
@@ -620,6 +620,66 @@ test('parse()', function (t) {
|
|
|
620
620
|
st.end();
|
|
621
621
|
});
|
|
622
622
|
|
|
623
|
+
t.test('dunder proto is ignored', function (st) {
|
|
624
|
+
var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';
|
|
625
|
+
var result = qs.parse(payload, { allowPrototypes: true });
|
|
626
|
+
|
|
627
|
+
st.deepEqual(
|
|
628
|
+
result,
|
|
629
|
+
{
|
|
630
|
+
categories: {
|
|
631
|
+
length: '42'
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
'silent [[Prototype]] payload'
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
var plainResult = qs.parse(payload, { allowPrototypes: true, plainObjects: true });
|
|
638
|
+
|
|
639
|
+
st.deepEqual(
|
|
640
|
+
plainResult,
|
|
641
|
+
{
|
|
642
|
+
__proto__: null,
|
|
643
|
+
categories: {
|
|
644
|
+
__proto__: null,
|
|
645
|
+
length: '42'
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
'silent [[Prototype]] payload: plain objects'
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
var query = qs.parse('categories[__proto__]=cats&categories[__proto__]=dogs&categories[some][json]=toInject', { allowPrototypes: true });
|
|
652
|
+
|
|
653
|
+
st.notOk(Array.isArray(query.categories), 'is not an array');
|
|
654
|
+
st.notOk(query.categories instanceof Array, 'is not instanceof an array');
|
|
655
|
+
st.deepEqual(query.categories, { some: { json: 'toInject' } });
|
|
656
|
+
st.equal(JSON.stringify(query.categories), '{"some":{"json":"toInject"}}', 'stringifies as a non-array');
|
|
657
|
+
|
|
658
|
+
st.deepEqual(
|
|
659
|
+
qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true }),
|
|
660
|
+
{
|
|
661
|
+
foo: {
|
|
662
|
+
bar: 'stuffs'
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
'hidden values'
|
|
666
|
+
);
|
|
667
|
+
|
|
668
|
+
st.deepEqual(
|
|
669
|
+
qs.parse('foo[__proto__][hidden]=value&foo[bar]=stuffs', { allowPrototypes: true, plainObjects: true }),
|
|
670
|
+
{
|
|
671
|
+
__proto__: null,
|
|
672
|
+
foo: {
|
|
673
|
+
__proto__: null,
|
|
674
|
+
bar: 'stuffs'
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
'hidden values: plain objects'
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
st.end();
|
|
681
|
+
});
|
|
682
|
+
|
|
623
683
|
t.test('can return null objects', { skip: !Object.create }, function (st) {
|
|
624
684
|
var expected = Object.create(null);
|
|
625
685
|
expected.a = Object.create(null);
|
|
@@ -132,10 +132,10 @@ test('stringify()', function (t) {
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
t.test('stringifies a nested array value', function (st) {
|
|
135
|
-
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a
|
|
136
|
-
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a
|
|
137
|
-
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'comma' }), 'a
|
|
138
|
-
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a
|
|
135
|
+
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'indices' }), 'a[b][0]=c&a[b][1]=d');
|
|
136
|
+
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'brackets' }), 'a[b][]=c&a[b][]=d');
|
|
137
|
+
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true, arrayFormat: 'comma' }), 'a[b]=c,d');
|
|
138
|
+
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { encodeValuesOnly: true }), 'a[b][0]=c&a[b][1]=d');
|
|
139
139
|
st.end();
|
|
140
140
|
});
|
|
141
141
|
|
|
@@ -143,7 +143,7 @@ test('stringify()', function (t) {
|
|
|
143
143
|
st.equal(
|
|
144
144
|
qs.stringify(
|
|
145
145
|
{ a: { b: ['c', 'd'] } },
|
|
146
|
-
{ allowDots: true,
|
|
146
|
+
{ allowDots: true, encodeValuesOnly: true, arrayFormat: 'indices' }
|
|
147
147
|
),
|
|
148
148
|
'a.b[0]=c&a.b[1]=d',
|
|
149
149
|
'indices: stringifies with dots + indices'
|
|
@@ -151,7 +151,7 @@ test('stringify()', function (t) {
|
|
|
151
151
|
st.equal(
|
|
152
152
|
qs.stringify(
|
|
153
153
|
{ a: { b: ['c', 'd'] } },
|
|
154
|
-
{ allowDots: true,
|
|
154
|
+
{ allowDots: true, encodeValuesOnly: true, arrayFormat: 'brackets' }
|
|
155
155
|
),
|
|
156
156
|
'a.b[]=c&a.b[]=d',
|
|
157
157
|
'brackets: stringifies with dots + brackets'
|
|
@@ -159,7 +159,7 @@ test('stringify()', function (t) {
|
|
|
159
159
|
st.equal(
|
|
160
160
|
qs.stringify(
|
|
161
161
|
{ a: { b: ['c', 'd'] } },
|
|
162
|
-
{ allowDots: true,
|
|
162
|
+
{ allowDots: true, encodeValuesOnly: true, arrayFormat: 'comma' }
|
|
163
163
|
),
|
|
164
164
|
'a.b=c,d',
|
|
165
165
|
'comma: stringifies with dots + comma'
|
|
@@ -167,7 +167,7 @@ test('stringify()', function (t) {
|
|
|
167
167
|
st.equal(
|
|
168
168
|
qs.stringify(
|
|
169
169
|
{ a: { b: ['c', 'd'] } },
|
|
170
|
-
{ allowDots: true,
|
|
170
|
+
{ allowDots: true, encodeValuesOnly: true }
|
|
171
171
|
),
|
|
172
172
|
'a.b[0]=c&a.b[1]=d',
|
|
173
173
|
'default: stringifies with dots + indices'
|
|
@@ -215,17 +215,23 @@ test('stringify()', function (t) {
|
|
|
215
215
|
|
|
216
216
|
t.test('stringifies an array with mixed objects and primitives', function (st) {
|
|
217
217
|
st.equal(
|
|
218
|
-
qs.stringify({ a: [{ b: 1 }, 2, 3] }, {
|
|
218
|
+
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'indices' }),
|
|
219
219
|
'a[0][b]=1&a[1]=2&a[2]=3',
|
|
220
220
|
'indices => indices'
|
|
221
221
|
);
|
|
222
222
|
st.equal(
|
|
223
|
-
qs.stringify({ a: [{ b: 1 }, 2, 3] }, {
|
|
223
|
+
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'brackets' }),
|
|
224
224
|
'a[][b]=1&a[]=2&a[]=3',
|
|
225
225
|
'brackets => brackets'
|
|
226
226
|
);
|
|
227
227
|
st.equal(
|
|
228
|
-
qs.stringify({ a: [{ b: 1 }, 2, 3] }, {
|
|
228
|
+
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true, arrayFormat: 'comma' }),
|
|
229
|
+
'???',
|
|
230
|
+
'brackets => brackets',
|
|
231
|
+
{ skip: 'TODO: figure out what this should do' }
|
|
232
|
+
);
|
|
233
|
+
st.equal(
|
|
234
|
+
qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encodeValuesOnly: true }),
|
|
229
235
|
'a[0][b]=1&a[1]=2&a[2]=3',
|
|
230
236
|
'default => indices'
|
|
231
237
|
);
|
|
@@ -784,7 +790,12 @@ test('stringify()', function (t) {
|
|
|
784
790
|
st.equal(qs.stringify(withArray, { encode: false }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, no arrayFormat');
|
|
785
791
|
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'bracket' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, bracket');
|
|
786
792
|
st.equal(qs.stringify(withArray, { encode: false, arrayFormat: 'indices' }), 'a[b][0][c]=d&a[b][0][e]=f', 'array, indices');
|
|
787
|
-
st.equal(
|
|
793
|
+
st.equal(
|
|
794
|
+
qs.stringify(withArray, { encode: false, arrayFormat: 'comma' }),
|
|
795
|
+
'???',
|
|
796
|
+
'array, comma',
|
|
797
|
+
{ skip: 'TODO: figure out what this should do' }
|
|
798
|
+
);
|
|
788
799
|
|
|
789
800
|
st.end();
|
|
790
801
|
});
|
|
@@ -61,8 +61,10 @@ You can also pass a string in place of options to just specify the encoding.
|
|
|
61
61
|
|
|
62
62
|
If an error occurs, the stream will be paused, everything unpiped,
|
|
63
63
|
and you are responsible for correctly disposing the stream.
|
|
64
|
-
For HTTP requests,
|
|
65
|
-
|
|
64
|
+
For HTTP requests, you may need to finish consuming the stream if
|
|
65
|
+
you want to keep the socket open for future requests. For streams
|
|
66
|
+
that use file descriptors, you should `stream.destroy()` or
|
|
67
|
+
`stream.close()` to prevent leaks.
|
|
66
68
|
|
|
67
69
|
## Errors
|
|
68
70
|
|
|
@@ -79,7 +81,7 @@ otherwise an error created by this module, which has the following attributes:
|
|
|
79
81
|
|
|
80
82
|
### Types
|
|
81
83
|
|
|
82
|
-
The errors from this module have a `type` property which allows for the
|
|
84
|
+
The errors from this module have a `type` property which allows for the programmatic
|
|
83
85
|
determination of the type of error returned.
|
|
84
86
|
|
|
85
87
|
#### encoding.unsupported
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "bytes@3.1.
|
|
3
|
-
"_id": "bytes@3.1.
|
|
2
|
+
"_from": "bytes@3.1.2",
|
|
3
|
+
"_id": "bytes@3.1.2",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512
|
|
5
|
+
"_integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
|
6
6
|
"_location": "/node-red-contrib-web-worldmap/raw-body/bytes",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "version",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "bytes@3.1.
|
|
11
|
+
"raw": "bytes@3.1.2",
|
|
12
12
|
"name": "bytes",
|
|
13
13
|
"escapedName": "bytes",
|
|
14
|
-
"rawSpec": "3.1.
|
|
14
|
+
"rawSpec": "3.1.2",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "3.1.
|
|
16
|
+
"fetchSpec": "3.1.2"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/node-red-contrib-web-worldmap/raw-body"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "bytes@3.1.
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
|
|
22
|
+
"_shasum": "8b0beeb98605adf1b128fa4386403c009e0221a5",
|
|
23
|
+
"_spec": "bytes@3.1.2",
|
|
24
24
|
"_where": "/Users/conway/Projects/worldmap/node_modules/raw-body",
|
|
25
25
|
"author": {
|
|
26
26
|
"name": "TJ Holowaychuk",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"eslint": "7.32.0",
|
|
48
48
|
"eslint-plugin-markdown": "2.2.1",
|
|
49
|
-
"mocha": "9.
|
|
49
|
+
"mocha": "9.2.0",
|
|
50
50
|
"nyc": "15.1.0"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
81
81
|
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
82
82
|
},
|
|
83
|
-
"version": "3.1.
|
|
83
|
+
"version": "3.1.2"
|
|
84
84
|
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_from": "raw-body@2.4.
|
|
3
|
-
"_id": "raw-body@2.4.
|
|
2
|
+
"_from": "raw-body@2.4.3",
|
|
3
|
+
"_id": "raw-body@2.4.3",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==",
|
|
6
6
|
"_location": "/node-red-contrib-web-worldmap/raw-body",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
9
9
|
"type": "version",
|
|
10
10
|
"registry": true,
|
|
11
|
-
"raw": "raw-body@2.4.
|
|
11
|
+
"raw": "raw-body@2.4.3",
|
|
12
12
|
"name": "raw-body",
|
|
13
13
|
"escapedName": "raw-body",
|
|
14
|
-
"rawSpec": "2.4.
|
|
14
|
+
"rawSpec": "2.4.3",
|
|
15
15
|
"saveSpec": null,
|
|
16
|
-
"fetchSpec": "2.4.
|
|
16
|
+
"fetchSpec": "2.4.3"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
19
|
"/node-red-contrib-web-worldmap/body-parser"
|
|
20
20
|
],
|
|
21
|
-
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.
|
|
22
|
-
"_shasum": "
|
|
23
|
-
"_spec": "raw-body@2.4.
|
|
21
|
+
"_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz",
|
|
22
|
+
"_shasum": "8f80305d11c2a0a545c2d9d89d7a0286fcead43c",
|
|
23
|
+
"_spec": "raw-body@2.4.3",
|
|
24
24
|
"_where": "/Users/conway/Projects/worldmap/node_modules/body-parser",
|
|
25
25
|
"author": {
|
|
26
26
|
"name": "Jonathan Ong",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"bytes": "3.1.
|
|
45
|
+
"bytes": "3.1.2",
|
|
46
46
|
"http-errors": "1.8.1",
|
|
47
47
|
"iconv-lite": "0.4.24",
|
|
48
48
|
"unpipe": "1.0.0"
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
"bluebird": "3.7.2",
|
|
54
54
|
"eslint": "7.32.0",
|
|
55
55
|
"eslint-config-standard": "14.1.1",
|
|
56
|
-
"eslint-plugin-import": "2.25.
|
|
56
|
+
"eslint-plugin-import": "2.25.4",
|
|
57
57
|
"eslint-plugin-markdown": "2.2.1",
|
|
58
58
|
"eslint-plugin-node": "11.1.0",
|
|
59
|
-
"eslint-plugin-promise": "5.
|
|
59
|
+
"eslint-plugin-promise": "5.2.0",
|
|
60
60
|
"eslint-plugin-standard": "4.1.0",
|
|
61
|
-
"mocha": "9.
|
|
61
|
+
"mocha": "9.2.0",
|
|
62
62
|
"nyc": "15.1.0",
|
|
63
63
|
"readable-stream": "2.3.7",
|
|
64
64
|
"safe-buffer": "5.2.1"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
87
87
|
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
88
88
|
},
|
|
89
|
-
"version": "2.4.
|
|
89
|
+
"version": "2.4.3"
|
|
90
90
|
}
|
package/package.json
CHANGED