node-red-contrib-web-worldmap 5.7.1 → 5.7.2
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 +1 -0
- package/README.md +1 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +21 -14
- package/node_modules/es-object-atoms/isObject.d.ts +1 -1
- package/node_modules/es-object-atoms/package.json +6 -7
- package/node_modules/es-object-atoms/tsconfig.json +1 -0
- package/node_modules/express/History.md +9 -0
- package/node_modules/express/lib/utils.js +2 -1
- package/node_modules/express/package.json +3 -3
- package/node_modules/qs/CHANGELOG.md +178 -0
- package/node_modules/qs/README.md +19 -1
- package/node_modules/qs/dist/qs.js +17 -17
- package/node_modules/qs/eslint.config.mjs +1 -0
- package/node_modules/qs/lib/parse.js +57 -25
- package/node_modules/qs/lib/stringify.js +11 -4
- package/node_modules/qs/lib/utils.js +2 -0
- package/node_modules/qs/package.json +3 -3
- package/node_modules/qs/test/parse.js +195 -4
- package/node_modules/qs/test/stringify.js +138 -0
- package/node_modules/qs/test/utils.js +38 -3
- package/package.json +2 -2
- package/node_modules/body-parser/node_modules/qs/.editorconfig +0 -46
- package/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml +0 -12
- package/node_modules/body-parser/node_modules/qs/.github/SECURITY.md +0 -11
- package/node_modules/body-parser/node_modules/qs/.github/THREAT_MODEL.md +0 -78
- package/node_modules/body-parser/node_modules/qs/.nycrc +0 -13
- package/node_modules/body-parser/node_modules/qs/CHANGELOG.md +0 -822
- package/node_modules/body-parser/node_modules/qs/LICENSE.md +0 -29
- package/node_modules/body-parser/node_modules/qs/README.md +0 -758
- package/node_modules/body-parser/node_modules/qs/dist/qs.js +0 -141
- package/node_modules/body-parser/node_modules/qs/eslint.config.mjs +0 -57
- package/node_modules/body-parser/node_modules/qs/lib/formats.js +0 -23
- package/node_modules/body-parser/node_modules/qs/lib/index.js +0 -11
- package/node_modules/body-parser/node_modules/qs/lib/parse.js +0 -403
- package/node_modules/body-parser/node_modules/qs/lib/stringify.js +0 -363
- package/node_modules/body-parser/node_modules/qs/lib/utils.js +0 -342
- package/node_modules/body-parser/node_modules/qs/package.json +0 -94
- package/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js +0 -267
- package/node_modules/body-parser/node_modules/qs/test/parse.js +0 -1703
- package/node_modules/body-parser/node_modules/qs/test/stringify.js +0 -1448
- package/node_modules/body-parser/node_modules/qs/test/utils.js +0 -432
|
@@ -210,6 +210,21 @@ test('parse()', function (t) {
|
|
|
210
210
|
t.test('uses original key when depth = 0', function (st) {
|
|
211
211
|
st.deepEqual(qs.parse('a[0]=b&a[1]=c', { depth: 0 }), { 'a[0]': 'b', 'a[1]': 'c' });
|
|
212
212
|
st.deepEqual(qs.parse('a[0][0]=b&a[0][1]=c&a[1]=d&e=2', { depth: 0 }), { 'a[0][0]': 'b', 'a[0][1]': 'c', 'a[1]': 'd', e: '2' });
|
|
213
|
+
st.deepEqual(qs.parse('a.b=c', { depth: 0, allowDots: true }), { 'a[b]': 'c' }, 'normalizes dots before applying depth-0 behavior');
|
|
214
|
+
st.deepEqual(qs.parse('toString=foo', { depth: 0 }), {}, 'respects prototype guard at depth 0');
|
|
215
|
+
st.deepEqual(qs.parse('toString=foo', { depth: 0, allowPrototypes: true }), { toString: 'foo' }, 'allows prototypes at depth 0 when enabled');
|
|
216
|
+
st.end();
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
t.test('ignores prototype keys when depth = 0 and allowPrototypes is false', function (st) {
|
|
220
|
+
st.deepEqual(qs.parse('toString=foo', { depth: 0 }), {});
|
|
221
|
+
st.deepEqual(qs.parse('hasOwnProperty=bar', { depth: 0 }), {});
|
|
222
|
+
st.deepEqual(qs.parse('toString=foo&a=b', { depth: 0 }), { a: 'b' });
|
|
223
|
+
st.end();
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
t.test('allows prototype keys when depth = 0 and allowPrototypes is true', function (st) {
|
|
227
|
+
st.deepEqual(qs.parse('toString=foo', { depth: 0, allowPrototypes: true }), { toString: 'foo' });
|
|
213
228
|
st.end();
|
|
214
229
|
});
|
|
215
230
|
|
|
@@ -251,6 +266,52 @@ test('parse()', function (t) {
|
|
|
251
266
|
st.end();
|
|
252
267
|
});
|
|
253
268
|
|
|
269
|
+
t.test('parses keys with literal [] inside a bracket group (#493)', function (st) {
|
|
270
|
+
// A bracket pair inside a bracket group should be treated literally as part of the key
|
|
271
|
+
st.deepEqual(
|
|
272
|
+
qs.parse('search[withbracket[]]=foobar'),
|
|
273
|
+
{ search: { 'withbracket[]': 'foobar' } },
|
|
274
|
+
'treats inner [] literally when inside a bracket group'
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
// Single-level variant
|
|
278
|
+
st.deepEqual(
|
|
279
|
+
qs.parse('a[b[]]=c'),
|
|
280
|
+
{ a: { 'b[]': 'c' } },
|
|
281
|
+
'keeps "b[]" as a literal key'
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
// Nested with an array push on the outer level
|
|
285
|
+
st.deepEqual(
|
|
286
|
+
qs.parse('list[][x[]]=y'),
|
|
287
|
+
{ list: [{ 'x[]': 'y' }] },
|
|
288
|
+
'preserves inner [] while still treating outer [] as array push'
|
|
289
|
+
);
|
|
290
|
+
|
|
291
|
+
// Multiple nested bracket pairs: inner [] remains literal as part of the key
|
|
292
|
+
st.deepEqual(
|
|
293
|
+
qs.parse('a[b[c[]]]=d'),
|
|
294
|
+
{ a: { 'b[c[]]': 'd' } },
|
|
295
|
+
'treats "b[c[]]" as a literal key inside the bracket group'
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
// Depth limits with literal brackets: preserve inner [] while limiting bracket-group parsing
|
|
299
|
+
st.deepEqual(
|
|
300
|
+
qs.parse('a[b[c[]]][d]=e', { depth: 1 }),
|
|
301
|
+
{ a: { 'b[c[]]': { '[d]': 'e' } } },
|
|
302
|
+
'respects depth: 1 and preserves literal inner [] in the parsed key'
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
// Unterminated inner bracket group is wrapped as a literal remainder segment
|
|
306
|
+
st.deepEqual(
|
|
307
|
+
qs.parse('a[[]b=c'),
|
|
308
|
+
{ a: { '[[]b': 'c' } },
|
|
309
|
+
'handles unterminated inner bracket groups without throwing'
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
st.end();
|
|
313
|
+
});
|
|
314
|
+
|
|
254
315
|
t.test('allows to specify array indices', function (st) {
|
|
255
316
|
st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
|
|
256
317
|
st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
|
|
@@ -784,25 +845,25 @@ test('parse()', function (t) {
|
|
|
784
845
|
|
|
785
846
|
t.test('add keys to objects', function (st) {
|
|
786
847
|
st.deepEqual(
|
|
787
|
-
qs.parse('a[b]=c&a=d'),
|
|
848
|
+
qs.parse('a[b]=c&a=d', { strictMerge: false }),
|
|
788
849
|
{ a: { b: 'c', d: true } },
|
|
789
850
|
'can add keys to objects'
|
|
790
851
|
);
|
|
791
852
|
|
|
792
853
|
st.deepEqual(
|
|
793
|
-
qs.parse('a[b]=c&a=toString'),
|
|
854
|
+
qs.parse('a[b]=c&a=toString', { strictMerge: false }),
|
|
794
855
|
{ a: { b: 'c' } },
|
|
795
856
|
'can not overwrite prototype'
|
|
796
857
|
);
|
|
797
858
|
|
|
798
859
|
st.deepEqual(
|
|
799
|
-
qs.parse('a[b]=c&a=toString', { allowPrototypes: true }),
|
|
860
|
+
qs.parse('a[b]=c&a=toString', { strictMerge: false, allowPrototypes: true }),
|
|
800
861
|
{ a: { b: 'c', toString: true } },
|
|
801
862
|
'can overwrite prototype with allowPrototypes true'
|
|
802
863
|
);
|
|
803
864
|
|
|
804
865
|
st.deepEqual(
|
|
805
|
-
qs.parse('a[b]=c&a=toString', { plainObjects: true }),
|
|
866
|
+
qs.parse('a[b]=c&a=toString', { strictMerge: false, plainObjects: true }),
|
|
806
867
|
{ __proto__: null, a: { __proto__: null, b: 'c', toString: true } },
|
|
807
868
|
'can overwrite prototype with plainObjects true'
|
|
808
869
|
);
|
|
@@ -810,6 +871,34 @@ test('parse()', function (t) {
|
|
|
810
871
|
st.end();
|
|
811
872
|
});
|
|
812
873
|
|
|
874
|
+
t.test('strictMerge wraps object and primitive into an array', function (st) {
|
|
875
|
+
st.deepEqual(
|
|
876
|
+
qs.parse('a[b]=c&a=d'),
|
|
877
|
+
{ a: [{ b: 'c' }, 'd'] },
|
|
878
|
+
'object then primitive produces array'
|
|
879
|
+
);
|
|
880
|
+
|
|
881
|
+
st.deepEqual(
|
|
882
|
+
qs.parse('a=d&a[b]=c'),
|
|
883
|
+
{ a: ['d', { b: 'c' }] },
|
|
884
|
+
'primitive then object produces array'
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
st.deepEqual(
|
|
888
|
+
qs.parse('a[b]=c&a=toString'),
|
|
889
|
+
{ a: [{ b: 'c' }, 'toString'] },
|
|
890
|
+
'prototype-colliding value is preserved in array'
|
|
891
|
+
);
|
|
892
|
+
|
|
893
|
+
st.deepEqual(
|
|
894
|
+
qs.parse('a[b]=c&a=toString', { plainObjects: true }),
|
|
895
|
+
{ __proto__: null, a: [{ __proto__: null, b: 'c' }, 'toString'] },
|
|
896
|
+
'plainObjects preserved in array wrapping'
|
|
897
|
+
);
|
|
898
|
+
|
|
899
|
+
st.end();
|
|
900
|
+
});
|
|
901
|
+
|
|
813
902
|
t.test('dunder proto is ignored', function (st) {
|
|
814
903
|
var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';
|
|
815
904
|
var result = qs.parse(payload, { allowPrototypes: true });
|
|
@@ -1046,6 +1135,15 @@ test('parse()', function (t) {
|
|
|
1046
1135
|
};
|
|
1047
1136
|
|
|
1048
1137
|
st.deepEqual(qs.parse('KeY=vAlUe', { decoder: decoder }), { key: 'VALUE' });
|
|
1138
|
+
|
|
1139
|
+
var noopDecoder = function () { return 'x'; };
|
|
1140
|
+
noopDecoder();
|
|
1141
|
+
st['throws'](
|
|
1142
|
+
function () { decoder('x', noopDecoder, 'utf-8', 'unknown'); },
|
|
1143
|
+
'this should never happen! type: unknown',
|
|
1144
|
+
'decoder throws for unexpected type'
|
|
1145
|
+
);
|
|
1146
|
+
|
|
1049
1147
|
st.end();
|
|
1050
1148
|
});
|
|
1051
1149
|
|
|
@@ -1075,6 +1173,14 @@ test('parse()', function (t) {
|
|
|
1075
1173
|
new RangeError('Parameter limit exceeded. Only 3 parameters allowed.'),
|
|
1076
1174
|
'throws error when parameter limit is exceeded'
|
|
1077
1175
|
);
|
|
1176
|
+
|
|
1177
|
+
sst['throws'](
|
|
1178
|
+
function () {
|
|
1179
|
+
qs.parse('a=1&b=2', { parameterLimit: 1, throwOnLimitExceeded: true });
|
|
1180
|
+
},
|
|
1181
|
+
new RangeError('Parameter limit exceeded. Only 1 parameter allowed.'),
|
|
1182
|
+
'throws error with singular "parameter" when parameterLimit is 1'
|
|
1183
|
+
);
|
|
1078
1184
|
sst.end();
|
|
1079
1185
|
});
|
|
1080
1186
|
|
|
@@ -1096,6 +1202,12 @@ test('parse()', function (t) {
|
|
|
1096
1202
|
sst.end();
|
|
1097
1203
|
});
|
|
1098
1204
|
|
|
1205
|
+
st.test('allows unlimited parameters when parameterLimit is Infinity and throwOnLimitExceeded is true', function (sst) {
|
|
1206
|
+
var result = qs.parse('a=1&b=2&c=3&d=4&e=5&f=6', { parameterLimit: Infinity, throwOnLimitExceeded: true });
|
|
1207
|
+
sst.deepEqual(result, { a: '1', b: '2', c: '3', d: '4', e: '5', f: '6' }, 'parses all parameters without truncation or throwing');
|
|
1208
|
+
sst.end();
|
|
1209
|
+
});
|
|
1210
|
+
|
|
1099
1211
|
st.end();
|
|
1100
1212
|
});
|
|
1101
1213
|
|
|
@@ -1161,6 +1273,14 @@ test('parse()', function (t) {
|
|
|
1161
1273
|
'throws error when a sparse index exceeds arrayLimit'
|
|
1162
1274
|
);
|
|
1163
1275
|
|
|
1276
|
+
sst['throws'](
|
|
1277
|
+
function () {
|
|
1278
|
+
qs.parse('a[2]=b', { arrayLimit: 1, throwOnLimitExceeded: true });
|
|
1279
|
+
},
|
|
1280
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1281
|
+
'throws error with singular "element" when arrayLimit is 1'
|
|
1282
|
+
);
|
|
1283
|
+
|
|
1164
1284
|
sst.end();
|
|
1165
1285
|
});
|
|
1166
1286
|
|
|
@@ -1178,6 +1298,17 @@ test('parse()', function (t) {
|
|
|
1178
1298
|
sst.end();
|
|
1179
1299
|
});
|
|
1180
1300
|
|
|
1301
|
+
st.test('throws when duplicate bracket keys exceed arrayLimit with throwOnLimitExceeded', function (sst) {
|
|
1302
|
+
sst['throws'](
|
|
1303
|
+
function () {
|
|
1304
|
+
qs.parse('a[]=1&a[]=2&a[]=3&a[]=4&a[]=5&a[]=6', { arrayLimit: 5, throwOnLimitExceeded: true });
|
|
1305
|
+
},
|
|
1306
|
+
new RangeError('Array limit exceeded. Only 5 elements allowed in an array.'),
|
|
1307
|
+
'throws error when duplicate bracket notation exceeds array limit'
|
|
1308
|
+
);
|
|
1309
|
+
sst.end();
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1181
1312
|
st.end();
|
|
1182
1313
|
});
|
|
1183
1314
|
|
|
@@ -1229,6 +1360,34 @@ test('`duplicates` option', function (t) {
|
|
|
1229
1360
|
'duplicates: last'
|
|
1230
1361
|
);
|
|
1231
1362
|
|
|
1363
|
+
t.test('bracket notation always combines regardless of duplicates', function (st) {
|
|
1364
|
+
st.deepEqual(
|
|
1365
|
+
qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }),
|
|
1366
|
+
{ a: '2', b: ['1', '2'] },
|
|
1367
|
+
'duplicates last: unbracketed takes last, bracketed combines'
|
|
1368
|
+
);
|
|
1369
|
+
|
|
1370
|
+
st.deepEqual(
|
|
1371
|
+
qs.parse('b[]=1&b[]=2', { duplicates: 'last' }),
|
|
1372
|
+
{ b: ['1', '2'] },
|
|
1373
|
+
'duplicates last: bracketed always combines'
|
|
1374
|
+
);
|
|
1375
|
+
|
|
1376
|
+
st.deepEqual(
|
|
1377
|
+
qs.parse('b[]=1&b[]=2', { duplicates: 'first' }),
|
|
1378
|
+
{ b: ['1', '2'] },
|
|
1379
|
+
'duplicates first: bracketed always combines'
|
|
1380
|
+
);
|
|
1381
|
+
|
|
1382
|
+
st.deepEqual(
|
|
1383
|
+
qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'first' }),
|
|
1384
|
+
{ a: '1', b: ['1', '2'] },
|
|
1385
|
+
'duplicates first: unbracketed takes first, bracketed combines'
|
|
1386
|
+
);
|
|
1387
|
+
|
|
1388
|
+
st.end();
|
|
1389
|
+
});
|
|
1390
|
+
|
|
1232
1391
|
t.end();
|
|
1233
1392
|
});
|
|
1234
1393
|
|
|
@@ -1406,6 +1565,14 @@ test('comma + arrayLimit', function (t) {
|
|
|
1406
1565
|
new RangeError('Array limit exceeded. Only 3 elements allowed in an array.'),
|
|
1407
1566
|
'throws error when comma-split exceeds array limit'
|
|
1408
1567
|
);
|
|
1568
|
+
|
|
1569
|
+
st['throws'](
|
|
1570
|
+
function () {
|
|
1571
|
+
qs.parse('a=1,2,3', { comma: true, arrayLimit: 1, throwOnLimitExceeded: true });
|
|
1572
|
+
},
|
|
1573
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1574
|
+
'throws error with singular "element" when arrayLimit is 1'
|
|
1575
|
+
);
|
|
1409
1576
|
st.end();
|
|
1410
1577
|
});
|
|
1411
1578
|
|
|
@@ -1508,5 +1675,29 @@ test('mixed array and object notation', function (t) {
|
|
|
1508
1675
|
st.end();
|
|
1509
1676
|
});
|
|
1510
1677
|
|
|
1678
|
+
t.test('uses existing array length for currentArrayLength when parsing object input with bracket keys', function (st) {
|
|
1679
|
+
var input = {};
|
|
1680
|
+
var arr = ['x', 'y'];
|
|
1681
|
+
arr.a = ['z', 'w'];
|
|
1682
|
+
input['a[]'] = arr;
|
|
1683
|
+
st.deepEqual(qs.parse(input), { a: ['x', 'y'] }, 'parses object input with bracket keys using existing array values');
|
|
1684
|
+
st.end();
|
|
1685
|
+
});
|
|
1686
|
+
|
|
1687
|
+
t.test('throws with singular message when object input bracket key exceeds arrayLimit of 1', function (st) {
|
|
1688
|
+
var input = {};
|
|
1689
|
+
var arr = ['x'];
|
|
1690
|
+
arr.a = ['z', 'w'];
|
|
1691
|
+
input['a[]'] = arr;
|
|
1692
|
+
st['throws'](
|
|
1693
|
+
function () {
|
|
1694
|
+
qs.parse(input, { throwOnLimitExceeded: true, arrayLimit: 1 });
|
|
1695
|
+
},
|
|
1696
|
+
new RangeError('Array limit exceeded. Only 1 element allowed in an array.'),
|
|
1697
|
+
'throws singular error for object input exceeding arrayLimit 1'
|
|
1698
|
+
);
|
|
1699
|
+
st.end();
|
|
1700
|
+
});
|
|
1701
|
+
|
|
1511
1702
|
t.end();
|
|
1512
1703
|
});
|
|
@@ -651,6 +651,49 @@ test('stringify()', function (t) {
|
|
|
651
651
|
st.end();
|
|
652
652
|
});
|
|
653
653
|
|
|
654
|
+
t.test('does not crash on null/undefined entries in arrayFormat=comma with encodeValuesOnly', function (st) {
|
|
655
|
+
st.doesNotThrow(
|
|
656
|
+
function () { qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); },
|
|
657
|
+
'does not pass a raw null array entry to the encoder'
|
|
658
|
+
);
|
|
659
|
+
st.doesNotThrow(
|
|
660
|
+
function () { qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }); },
|
|
661
|
+
'does not pass a raw undefined array entry to the encoder'
|
|
662
|
+
);
|
|
663
|
+
st.doesNotThrow(
|
|
664
|
+
function () { qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }); },
|
|
665
|
+
'does not crash on a single-null array'
|
|
666
|
+
);
|
|
667
|
+
|
|
668
|
+
st.equal(
|
|
669
|
+
qs.stringify({ a: [null, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }),
|
|
670
|
+
'a=,b',
|
|
671
|
+
'null entry joins as empty, comma stays unencoded under encodeValuesOnly'
|
|
672
|
+
);
|
|
673
|
+
st.equal(
|
|
674
|
+
qs.stringify({ a: [undefined, 'b'] }, { arrayFormat: 'comma', encodeValuesOnly: true }),
|
|
675
|
+
'a=,b',
|
|
676
|
+
'undefined entry joins as empty, comma stays unencoded under encodeValuesOnly'
|
|
677
|
+
);
|
|
678
|
+
st.equal(
|
|
679
|
+
qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true }),
|
|
680
|
+
'a=',
|
|
681
|
+
'single-null array stringifies as empty value'
|
|
682
|
+
);
|
|
683
|
+
st.equal(
|
|
684
|
+
qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true, strictNullHandling: true }),
|
|
685
|
+
'a',
|
|
686
|
+
'strictNullHandling drops the equals sign for a single-null array'
|
|
687
|
+
);
|
|
688
|
+
st.equal(
|
|
689
|
+
qs.stringify({ a: [null] }, { arrayFormat: 'comma', encodeValuesOnly: true, skipNulls: true }),
|
|
690
|
+
'',
|
|
691
|
+
'skipNulls drops a single-null array entirely'
|
|
692
|
+
);
|
|
693
|
+
|
|
694
|
+
st.end();
|
|
695
|
+
});
|
|
696
|
+
|
|
654
697
|
t.test('stringifies a null object', { skip: !hasProto }, function (st) {
|
|
655
698
|
st.equal(qs.stringify({ __proto__: null, a: 'b' }), 'a=b');
|
|
656
699
|
st.end();
|
|
@@ -825,6 +868,35 @@ test('stringify()', function (t) {
|
|
|
825
868
|
st.end();
|
|
826
869
|
});
|
|
827
870
|
|
|
871
|
+
t.test('skips null/undefined entries in filter=array', function (st) {
|
|
872
|
+
st.doesNotThrow(
|
|
873
|
+
function () { qs.stringify({ a: 'b', undefined: 'x' }, { filter: ['a', undefined] }); },
|
|
874
|
+
'does not pass a raw undefined filter entry to the encoder'
|
|
875
|
+
);
|
|
876
|
+
st.doesNotThrow(
|
|
877
|
+
function () { qs.stringify({ a: 'b', 'null': 'x' }, { filter: ['a', null] }); },
|
|
878
|
+
'does not pass a raw null filter entry to the encoder'
|
|
879
|
+
);
|
|
880
|
+
|
|
881
|
+
st.equal(
|
|
882
|
+
qs.stringify({ a: 'b', undefined: 'x', c: 'd' }, { filter: ['a', undefined, 'c'] }),
|
|
883
|
+
'a=b&c=d',
|
|
884
|
+
'undefined filter entry is skipped, remaining keys are kept'
|
|
885
|
+
);
|
|
886
|
+
st.equal(
|
|
887
|
+
qs.stringify({ a: 'b', 'null': 'x', c: 'd' }, { filter: ['a', null, 'c'] }),
|
|
888
|
+
'a=b&c=d',
|
|
889
|
+
'null filter entry is skipped, remaining keys are kept'
|
|
890
|
+
);
|
|
891
|
+
st.equal(
|
|
892
|
+
qs.stringify({ a: 'b', 'null': 'x' }, { filter: [null] }),
|
|
893
|
+
'',
|
|
894
|
+
'filter array containing only null yields empty string'
|
|
895
|
+
);
|
|
896
|
+
|
|
897
|
+
st.end();
|
|
898
|
+
});
|
|
899
|
+
|
|
828
900
|
t.test('supports custom representations when filter=function', function (st) {
|
|
829
901
|
var calls = 0;
|
|
830
902
|
var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
|
|
@@ -1111,6 +1183,28 @@ test('stringify()', function (t) {
|
|
|
1111
1183
|
st.end();
|
|
1112
1184
|
});
|
|
1113
1185
|
|
|
1186
|
+
t.test('strictNullHandling: applies the formatter to the encoded key (RFC1738)', function (st) {
|
|
1187
|
+
st.equal(
|
|
1188
|
+
qs.stringify(
|
|
1189
|
+
{ 'a b': null, 'c d': 'e f' },
|
|
1190
|
+
{ strictNullHandling: false, format: 'RFC1738' }
|
|
1191
|
+
),
|
|
1192
|
+
'a+b=&c+d=e+f',
|
|
1193
|
+
'without: as expected'
|
|
1194
|
+
);
|
|
1195
|
+
|
|
1196
|
+
st.equal(
|
|
1197
|
+
qs.stringify(
|
|
1198
|
+
{ 'a b': null, 'c d': 'e f' },
|
|
1199
|
+
{ strictNullHandling: true, format: 'RFC1738' }
|
|
1200
|
+
),
|
|
1201
|
+
'a+b&c+d=e+f',
|
|
1202
|
+
'with: as expected'
|
|
1203
|
+
);
|
|
1204
|
+
|
|
1205
|
+
st.end();
|
|
1206
|
+
});
|
|
1207
|
+
|
|
1114
1208
|
t.test('throws if an invalid charset is specified', function (st) {
|
|
1115
1209
|
st['throws'](function () {
|
|
1116
1210
|
qs.stringify({ a: 'b' }, { charset: 'foobar' });
|
|
@@ -1146,6 +1240,12 @@ test('stringify()', function (t) {
|
|
|
1146
1240
|
'adds the right sentinel when instructed to and the charset is iso-8859-1'
|
|
1147
1241
|
);
|
|
1148
1242
|
|
|
1243
|
+
st.equal(
|
|
1244
|
+
qs.stringify({ a: 1, b: 2 }, { charsetSentinel: true, delimiter: ';' }),
|
|
1245
|
+
'utf8=%E2%9C%93;a=1;b=2',
|
|
1246
|
+
'uses the configured delimiter after the sentinel'
|
|
1247
|
+
);
|
|
1248
|
+
|
|
1149
1249
|
st.end();
|
|
1150
1250
|
});
|
|
1151
1251
|
|
|
@@ -1188,6 +1288,15 @@ test('stringify()', function (t) {
|
|
|
1188
1288
|
};
|
|
1189
1289
|
|
|
1190
1290
|
st.deepEqual(qs.stringify({ KeY: 'vAlUe' }, { encoder: encoder }), 'key=VALUE');
|
|
1291
|
+
|
|
1292
|
+
var noopEncoder = function () { return 'x'; };
|
|
1293
|
+
noopEncoder();
|
|
1294
|
+
st['throws'](
|
|
1295
|
+
function () { encoder('x', noopEncoder, 'utf-8', 'unknown'); },
|
|
1296
|
+
'this should never happen! type: unknown',
|
|
1297
|
+
'encoder throws for unexpected type'
|
|
1298
|
+
);
|
|
1299
|
+
|
|
1191
1300
|
st.end();
|
|
1192
1301
|
});
|
|
1193
1302
|
|
|
@@ -1307,4 +1416,33 @@ test('stringifies empty keys', function (t) {
|
|
|
1307
1416
|
|
|
1308
1417
|
st.end();
|
|
1309
1418
|
});
|
|
1419
|
+
|
|
1420
|
+
t.test('round-trips keys containing percent-encoded bracket text', function (st) {
|
|
1421
|
+
var cases = [
|
|
1422
|
+
{ 'a%5Bb': 'c' },
|
|
1423
|
+
{ 'a%5Db': 'c' },
|
|
1424
|
+
{ 'a%255Bb': 'c' },
|
|
1425
|
+
{ 'a%255Db': 'c' },
|
|
1426
|
+
{ a: { 'b%5Bc': 'd' } },
|
|
1427
|
+
{ a: { 'b%255Bc': 'd' } },
|
|
1428
|
+
{ 'a%5B%255Bb': 'c' }
|
|
1429
|
+
];
|
|
1430
|
+
for (var i = 0; i < cases.length; i++) {
|
|
1431
|
+
st.deepEqual(
|
|
1432
|
+
qs.parse(qs.stringify(cases[i])),
|
|
1433
|
+
cases[i],
|
|
1434
|
+
'round-trips ' + JSON.stringify(cases[i])
|
|
1435
|
+
);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
st.end();
|
|
1439
|
+
});
|
|
1440
|
+
|
|
1441
|
+
t.test('parses input containing percent-encoded bracket text without mangling', function (st) {
|
|
1442
|
+
st.deepEqual(qs.parse('a%25255Bb=c'), { 'a%255Bb': 'c' }, 'a%25255Bb decodes to a%255Bb, not a%5Bb');
|
|
1443
|
+
st.deepEqual(qs.parse('a%25255Db=c'), { 'a%255Db': 'c' }, 'a%25255Db decodes to a%255Db, not a%5Db');
|
|
1444
|
+
st.deepEqual(qs.parse('a%5Bb%25255Bc%5D=d'), { a: { 'b%255Bc': 'd' } }, 'nested %25255B decodes to %255B inside segment, not %5B');
|
|
1445
|
+
|
|
1446
|
+
st.end();
|
|
1447
|
+
});
|
|
1310
1448
|
});
|
|
@@ -31,6 +31,7 @@ test('merge()', function (t) {
|
|
|
31
31
|
t.deepEqual(noOptionsNonObjectSource, { foo: 'baz', bar: true });
|
|
32
32
|
|
|
33
33
|
var func = function f() {};
|
|
34
|
+
func();
|
|
34
35
|
t.deepEqual(
|
|
35
36
|
utils.merge(func, { foo: 'bar' }),
|
|
36
37
|
[func, { foo: 'bar' }],
|
|
@@ -95,6 +96,13 @@ test('merge()', function (t) {
|
|
|
95
96
|
s2t.end();
|
|
96
97
|
});
|
|
97
98
|
|
|
99
|
+
st.test('with strictMerge, wraps object and primitive in array', function (s2t) {
|
|
100
|
+
var obj = { foo: 'bar' };
|
|
101
|
+
var merged = utils.merge(obj, 'baz', { strictMerge: true });
|
|
102
|
+
s2t.deepEqual(merged, [{ foo: 'bar' }, 'baz'], 'wraps in array with strictMerge');
|
|
103
|
+
s2t.end();
|
|
104
|
+
});
|
|
105
|
+
|
|
98
106
|
st.test('merges overflow object into primitive', function (s2t) {
|
|
99
107
|
// Create an overflow object via combine: 2 elements (indices 0-1) with limit 0
|
|
100
108
|
var overflow = utils.combine(['a'], 'b', 0, false);
|
|
@@ -105,6 +113,15 @@ test('merge()', function (t) {
|
|
|
105
113
|
s2t.end();
|
|
106
114
|
});
|
|
107
115
|
|
|
116
|
+
st.test('merges overflow object into primitive with plainObjects', function (s2t) {
|
|
117
|
+
var overflow = utils.combine(['a'], 'b', 0, false);
|
|
118
|
+
s2t.ok(utils.isOverflow(overflow), 'overflow object is marked');
|
|
119
|
+
var merged = utils.merge('c', overflow, { plainObjects: true });
|
|
120
|
+
s2t.ok(utils.isOverflow(merged), 'result is also marked as overflow');
|
|
121
|
+
s2t.deepEqual(merged, { __proto__: null, 0: 'c', 1: 'a', 2: 'b' }, 'creates null-proto object with primitive at 0');
|
|
122
|
+
s2t.end();
|
|
123
|
+
});
|
|
124
|
+
|
|
108
125
|
st.test('merges overflow object with multiple values into primitive', function (s2t) {
|
|
109
126
|
// Create an overflow object via combine: 3 elements (indices 0-2) with limit 0
|
|
110
127
|
var overflow = utils.combine(['b', 'c'], 'd', 0, false);
|
|
@@ -121,6 +138,21 @@ test('merge()', function (t) {
|
|
|
121
138
|
s2t.end();
|
|
122
139
|
});
|
|
123
140
|
|
|
141
|
+
st.test('merges primitive into array that exceeds arrayLimit', function (s2t) {
|
|
142
|
+
var arr = ['a', 'b', 'c'];
|
|
143
|
+
var merged = utils.merge(arr, 'd', { arrayLimit: 1 });
|
|
144
|
+
s2t.ok(utils.isOverflow(merged), 'result is marked as overflow');
|
|
145
|
+
s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c', 3: 'd' }, 'converts to overflow object with primitive appended');
|
|
146
|
+
s2t.end();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
st.test('merges array into primitive that exceeds arrayLimit', function (s2t) {
|
|
150
|
+
var merged = utils.merge('a', ['b', 'c'], { arrayLimit: 1 });
|
|
151
|
+
s2t.ok(utils.isOverflow(merged), 'result is marked as overflow');
|
|
152
|
+
s2t.deepEqual(merged, { 0: 'a', 1: 'b', 2: 'c' }, 'converts to overflow object');
|
|
153
|
+
s2t.end();
|
|
154
|
+
});
|
|
155
|
+
|
|
124
156
|
st.end();
|
|
125
157
|
});
|
|
126
158
|
|
|
@@ -369,7 +401,9 @@ test('encode', function (t) {
|
|
|
369
401
|
});
|
|
370
402
|
|
|
371
403
|
test('isBuffer()', function (t) {
|
|
372
|
-
|
|
404
|
+
var fn = function () {};
|
|
405
|
+
fn();
|
|
406
|
+
forEach([null, undefined, true, false, '', 'abc', 42, 0, NaN, {}, [], fn, /a/g], function (x) {
|
|
373
407
|
t.equal(utils.isBuffer(x), false, inspect(x) + ' is not a buffer');
|
|
374
408
|
});
|
|
375
409
|
|
|
@@ -379,8 +413,9 @@ test('isBuffer()', function (t) {
|
|
|
379
413
|
var saferBuffer = SaferBuffer.from('abc');
|
|
380
414
|
t.equal(utils.isBuffer(saferBuffer), true, 'SaferBuffer instance is a buffer');
|
|
381
415
|
|
|
382
|
-
var buffer =
|
|
383
|
-
t.
|
|
416
|
+
var buffer = SaferBuffer.from('abc');
|
|
417
|
+
t.notEqual(saferBuffer, buffer, 'different buffer instances');
|
|
418
|
+
t.equal(utils.isBuffer(buffer), true, 'another Buffer instance is a buffer');
|
|
384
419
|
t.end();
|
|
385
420
|
});
|
|
386
421
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-web-worldmap",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.2",
|
|
4
4
|
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@turf/bezier-spline": "7.3.5",
|
|
7
7
|
"cgi": "0.3.1",
|
|
8
8
|
"compression": "1.8.1",
|
|
9
|
-
"express": "4.22.
|
|
9
|
+
"express": "4.22.2",
|
|
10
10
|
"sockjs": "0.3.24"
|
|
11
11
|
},
|
|
12
12
|
"overrides": {
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
root = true
|
|
2
|
-
|
|
3
|
-
[*]
|
|
4
|
-
indent_style = space
|
|
5
|
-
indent_size = 4
|
|
6
|
-
end_of_line = lf
|
|
7
|
-
charset = utf-8
|
|
8
|
-
trim_trailing_whitespace = true
|
|
9
|
-
insert_final_newline = true
|
|
10
|
-
max_line_length = 180
|
|
11
|
-
quote_type = single
|
|
12
|
-
|
|
13
|
-
[test/*]
|
|
14
|
-
max_line_length = off
|
|
15
|
-
|
|
16
|
-
[LICENSE.md]
|
|
17
|
-
indent_size = off
|
|
18
|
-
|
|
19
|
-
[*.md]
|
|
20
|
-
max_line_length = off
|
|
21
|
-
|
|
22
|
-
[*.json]
|
|
23
|
-
max_line_length = off
|
|
24
|
-
|
|
25
|
-
[Makefile]
|
|
26
|
-
max_line_length = off
|
|
27
|
-
|
|
28
|
-
[CHANGELOG.md]
|
|
29
|
-
indent_style = space
|
|
30
|
-
indent_size = 2
|
|
31
|
-
|
|
32
|
-
[LICENSE]
|
|
33
|
-
indent_size = 2
|
|
34
|
-
max_line_length = off
|
|
35
|
-
|
|
36
|
-
[coverage/**/*]
|
|
37
|
-
indent_size = off
|
|
38
|
-
indent_style = off
|
|
39
|
-
indent = off
|
|
40
|
-
max_line_length = off
|
|
41
|
-
|
|
42
|
-
[.nycrc]
|
|
43
|
-
indent_style = tab
|
|
44
|
-
|
|
45
|
-
[tea.yaml]
|
|
46
|
-
indent_size = 2
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# These are supported funding model platforms
|
|
2
|
-
|
|
3
|
-
github: [ljharb]
|
|
4
|
-
patreon: # Replace with a single Patreon username
|
|
5
|
-
open_collective: # Replace with a single Open Collective username
|
|
6
|
-
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
-
tidelift: npm/qs
|
|
8
|
-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
-
liberapay: # Replace with a single Liberapay username
|
|
10
|
-
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
-
otechie: # Replace with a single Otechie username
|
|
12
|
-
custom: # Replace with a single custom sponsorship URL
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Security
|
|
2
|
-
|
|
3
|
-
Please file a private vulnerability report via GitHub, email [@ljharb](https://github.com/ljharb), or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
|
4
|
-
|
|
5
|
-
## Incident Response Plan
|
|
6
|
-
|
|
7
|
-
Please see our [Incident Response Plan](https://github.com/ljharb/.github/blob/main/INCIDENT_RESPONSE_PLAN.md).
|
|
8
|
-
|
|
9
|
-
## Threat Model
|
|
10
|
-
|
|
11
|
-
Please see [THREAT_MODEL.md](./THREAT_MODEL.md).
|