node-red-contrib-web-worldmap 5.7.1 → 5.8.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.
Files changed (279) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +3 -1
  3. package/node_modules/es-object-atoms/CHANGELOG.md +21 -14
  4. package/node_modules/es-object-atoms/isObject.d.ts +1 -1
  5. package/node_modules/es-object-atoms/package.json +6 -7
  6. package/node_modules/es-object-atoms/tsconfig.json +1 -0
  7. package/node_modules/express/History.md +9 -0
  8. package/node_modules/express/lib/utils.js +2 -1
  9. package/node_modules/express/package.json +3 -3
  10. package/node_modules/qs/CHANGELOG.md +178 -0
  11. package/node_modules/qs/README.md +19 -1
  12. package/node_modules/qs/dist/qs.js +17 -17
  13. package/node_modules/qs/eslint.config.mjs +1 -0
  14. package/node_modules/qs/lib/parse.js +57 -25
  15. package/node_modules/qs/lib/stringify.js +11 -4
  16. package/node_modules/qs/lib/utils.js +2 -0
  17. package/node_modules/qs/package.json +3 -3
  18. package/node_modules/qs/test/parse.js +195 -4
  19. package/node_modules/qs/test/stringify.js +138 -0
  20. package/node_modules/qs/test/utils.js +38 -3
  21. package/node_modules/uuid/README.md +182 -177
  22. package/node_modules/uuid/dist/cjs/index.d.ts +15 -0
  23. package/node_modules/uuid/dist/cjs/index.js +31 -0
  24. package/node_modules/uuid/dist/cjs/max.d.ts +2 -0
  25. package/node_modules/uuid/dist/cjs/max.js +3 -0
  26. package/node_modules/uuid/dist/cjs/md5.d.ts +4 -0
  27. package/node_modules/uuid/dist/cjs/md5.js +13 -0
  28. package/node_modules/uuid/dist/cjs/native.d.ts +6 -0
  29. package/node_modules/uuid/dist/cjs/native.js +4 -0
  30. package/node_modules/uuid/dist/cjs/nil.d.ts +2 -0
  31. package/node_modules/uuid/dist/cjs/nil.js +3 -0
  32. package/node_modules/uuid/dist/cjs/package.json +1 -0
  33. package/node_modules/uuid/dist/cjs/parse.d.ts +2 -0
  34. package/node_modules/uuid/dist/cjs/parse.js +11 -0
  35. package/node_modules/uuid/dist/cjs/regex.d.ts +2 -0
  36. package/node_modules/uuid/dist/cjs/regex.js +3 -0
  37. package/node_modules/uuid/dist/cjs/rng.d.ts +1 -0
  38. package/node_modules/uuid/dist/cjs/rng.js +13 -0
  39. package/node_modules/uuid/dist/cjs/sha1.d.ts +4 -0
  40. package/node_modules/uuid/dist/cjs/sha1.js +13 -0
  41. package/node_modules/uuid/dist/cjs/stringify.d.ts +3 -0
  42. package/node_modules/uuid/dist/cjs/stringify.js +39 -0
  43. package/node_modules/uuid/dist/cjs/types.d.ts +21 -0
  44. package/node_modules/uuid/dist/cjs/types.js +2 -0
  45. package/node_modules/uuid/dist/cjs/uuid-bin.d.ts +1 -0
  46. package/node_modules/uuid/dist/cjs/uuid-bin.js +72 -0
  47. package/node_modules/uuid/dist/cjs/v1.d.ts +11 -0
  48. package/node_modules/uuid/dist/cjs/v1.js +87 -0
  49. package/node_modules/uuid/dist/cjs/v1ToV6.d.ts +2 -0
  50. package/node_modules/uuid/dist/cjs/v1ToV6.js +13 -0
  51. package/node_modules/uuid/dist/cjs/v3.d.ts +9 -0
  52. package/node_modules/uuid/dist/cjs/v3.js +14 -0
  53. package/node_modules/uuid/dist/cjs/v35.d.ts +7 -0
  54. package/node_modules/uuid/dist/cjs/v35.js +44 -0
  55. package/node_modules/uuid/dist/cjs/v4.d.ts +4 -0
  56. package/node_modules/uuid/dist/cjs/v4.js +29 -0
  57. package/node_modules/uuid/dist/cjs/v5.d.ts +9 -0
  58. package/node_modules/uuid/dist/cjs/v5.js +14 -0
  59. package/node_modules/uuid/dist/cjs/v6.d.ts +4 -0
  60. package/node_modules/uuid/dist/cjs/v6.js +22 -0
  61. package/node_modules/uuid/dist/cjs/v6ToV1.d.ts +2 -0
  62. package/node_modules/uuid/dist/cjs/v6ToV1.js +13 -0
  63. package/node_modules/uuid/dist/cjs/v7.d.ts +9 -0
  64. package/node_modules/uuid/dist/cjs/v7.js +69 -0
  65. package/node_modules/uuid/dist/cjs/validate.d.ts +2 -0
  66. package/node_modules/uuid/dist/cjs/validate.js +7 -0
  67. package/node_modules/uuid/dist/cjs/version.d.ts +2 -0
  68. package/node_modules/uuid/dist/cjs/version.js +10 -0
  69. package/node_modules/uuid/dist/cjs-browser/index.d.ts +15 -0
  70. package/node_modules/uuid/dist/cjs-browser/index.js +31 -0
  71. package/node_modules/uuid/dist/cjs-browser/max.d.ts +2 -0
  72. package/node_modules/uuid/dist/cjs-browser/max.js +3 -0
  73. package/node_modules/uuid/dist/cjs-browser/md5.d.ts +2 -0
  74. package/node_modules/uuid/dist/cjs-browser/md5.js +137 -0
  75. package/node_modules/uuid/dist/cjs-browser/native.d.ts +4 -0
  76. package/node_modules/uuid/dist/cjs-browser/native.js +4 -0
  77. package/node_modules/uuid/dist/cjs-browser/nil.d.ts +2 -0
  78. package/node_modules/uuid/dist/cjs-browser/nil.js +3 -0
  79. package/node_modules/uuid/dist/cjs-browser/package.json +1 -0
  80. package/node_modules/uuid/dist/cjs-browser/parse.d.ts +2 -0
  81. package/node_modules/uuid/dist/cjs-browser/parse.js +11 -0
  82. package/node_modules/uuid/dist/cjs-browser/regex.d.ts +2 -0
  83. package/node_modules/uuid/dist/cjs-browser/regex.js +3 -0
  84. package/node_modules/uuid/dist/cjs-browser/rng.d.ts +1 -0
  85. package/node_modules/uuid/dist/cjs-browser/rng.js +14 -0
  86. package/node_modules/uuid/dist/cjs-browser/sha1.d.ts +2 -0
  87. package/node_modules/uuid/dist/cjs-browser/sha1.js +72 -0
  88. package/node_modules/uuid/dist/cjs-browser/stringify.d.ts +3 -0
  89. package/node_modules/uuid/dist/cjs-browser/stringify.js +39 -0
  90. package/node_modules/uuid/dist/cjs-browser/types.d.ts +21 -0
  91. package/node_modules/uuid/dist/cjs-browser/types.js +2 -0
  92. package/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts +1 -0
  93. package/node_modules/uuid/dist/cjs-browser/uuid-bin.js +72 -0
  94. package/node_modules/uuid/dist/cjs-browser/v1.d.ts +11 -0
  95. package/node_modules/uuid/dist/cjs-browser/v1.js +87 -0
  96. package/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts +2 -0
  97. package/node_modules/uuid/dist/cjs-browser/v1ToV6.js +13 -0
  98. package/node_modules/uuid/dist/cjs-browser/v3.d.ts +9 -0
  99. package/node_modules/uuid/dist/cjs-browser/v3.js +14 -0
  100. package/node_modules/uuid/dist/cjs-browser/v35.d.ts +7 -0
  101. package/node_modules/uuid/dist/cjs-browser/v35.js +44 -0
  102. package/node_modules/uuid/dist/cjs-browser/v4.d.ts +4 -0
  103. package/node_modules/uuid/dist/cjs-browser/v4.js +29 -0
  104. package/node_modules/uuid/dist/cjs-browser/v5.d.ts +9 -0
  105. package/node_modules/uuid/dist/cjs-browser/v5.js +14 -0
  106. package/node_modules/uuid/dist/cjs-browser/v6.d.ts +4 -0
  107. package/node_modules/uuid/dist/cjs-browser/v6.js +22 -0
  108. package/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts +2 -0
  109. package/node_modules/uuid/dist/cjs-browser/v6ToV1.js +13 -0
  110. package/node_modules/uuid/dist/cjs-browser/v7.d.ts +9 -0
  111. package/node_modules/uuid/dist/cjs-browser/v7.js +69 -0
  112. package/node_modules/uuid/dist/cjs-browser/validate.d.ts +2 -0
  113. package/node_modules/uuid/dist/cjs-browser/validate.js +7 -0
  114. package/node_modules/uuid/dist/cjs-browser/version.d.ts +2 -0
  115. package/node_modules/uuid/dist/cjs-browser/version.js +10 -0
  116. package/node_modules/uuid/dist/esm/bin/uuid +2 -0
  117. package/node_modules/uuid/dist/esm/index.d.ts +15 -0
  118. package/node_modules/uuid/dist/{esm-node → esm}/index.js +9 -4
  119. package/node_modules/uuid/dist/esm/max.d.ts +2 -0
  120. package/node_modules/uuid/dist/esm/max.js +1 -0
  121. package/node_modules/uuid/dist/esm/md5.d.ts +4 -0
  122. package/node_modules/uuid/dist/esm/md5.js +11 -0
  123. package/node_modules/uuid/dist/esm/native.d.ts +6 -0
  124. package/node_modules/uuid/dist/esm/native.js +2 -0
  125. package/node_modules/uuid/dist/esm/nil.d.ts +2 -0
  126. package/node_modules/uuid/dist/esm/nil.js +1 -0
  127. package/node_modules/uuid/dist/esm/parse.d.ts +2 -0
  128. package/node_modules/uuid/dist/esm/parse.js +9 -0
  129. package/node_modules/uuid/dist/esm/regex.d.ts +2 -0
  130. package/node_modules/uuid/dist/esm/regex.js +1 -0
  131. package/node_modules/uuid/dist/esm/rng.d.ts +1 -0
  132. package/node_modules/uuid/dist/esm/rng.js +10 -0
  133. package/node_modules/uuid/dist/esm/sha1.d.ts +4 -0
  134. package/node_modules/uuid/dist/esm/sha1.js +11 -0
  135. package/node_modules/uuid/dist/esm/stringify.d.ts +3 -0
  136. package/node_modules/uuid/dist/esm/stringify.js +35 -0
  137. package/node_modules/uuid/dist/esm/types.d.ts +21 -0
  138. package/node_modules/uuid/dist/esm/types.js +1 -0
  139. package/node_modules/uuid/dist/esm/uuid-bin.d.ts +1 -0
  140. package/node_modules/uuid/dist/esm/uuid-bin.js +70 -0
  141. package/node_modules/uuid/dist/esm/v1.d.ts +11 -0
  142. package/node_modules/uuid/dist/esm/v1.js +83 -0
  143. package/node_modules/uuid/dist/esm/v1ToV6.d.ts +2 -0
  144. package/node_modules/uuid/dist/esm/v1ToV6.js +10 -0
  145. package/node_modules/uuid/dist/esm/v3.d.ts +9 -0
  146. package/node_modules/uuid/dist/esm/v3.js +9 -0
  147. package/node_modules/uuid/dist/esm/v35.d.ts +7 -0
  148. package/node_modules/uuid/dist/esm/v35.js +39 -0
  149. package/node_modules/uuid/dist/esm/v4.d.ts +4 -0
  150. package/node_modules/uuid/dist/esm/v4.js +27 -0
  151. package/node_modules/uuid/dist/esm/v5.d.ts +9 -0
  152. package/node_modules/uuid/dist/esm/v5.js +9 -0
  153. package/node_modules/uuid/dist/esm/v6.d.ts +4 -0
  154. package/node_modules/uuid/dist/esm/v6.js +20 -0
  155. package/node_modules/uuid/dist/esm/v6ToV1.d.ts +2 -0
  156. package/node_modules/uuid/dist/esm/v6ToV1.js +10 -0
  157. package/node_modules/uuid/dist/esm/v7.d.ts +9 -0
  158. package/node_modules/uuid/dist/esm/v7.js +65 -0
  159. package/node_modules/uuid/dist/esm/validate.d.ts +2 -0
  160. package/node_modules/uuid/dist/esm/validate.js +5 -0
  161. package/node_modules/uuid/dist/esm/version.d.ts +2 -0
  162. package/node_modules/uuid/dist/esm/version.js +8 -0
  163. package/node_modules/uuid/dist/esm-browser/index.d.ts +15 -0
  164. package/node_modules/uuid/dist/esm-browser/index.js +9 -4
  165. package/node_modules/uuid/dist/esm-browser/max.d.ts +2 -0
  166. package/node_modules/uuid/dist/esm-browser/max.js +1 -0
  167. package/node_modules/uuid/dist/esm-browser/md5.d.ts +2 -0
  168. package/node_modules/uuid/dist/esm-browser/md5.js +113 -193
  169. package/node_modules/uuid/dist/esm-browser/native.d.ts +4 -0
  170. package/node_modules/uuid/dist/esm-browser/native.js +2 -0
  171. package/node_modules/uuid/dist/esm-browser/nil.d.ts +2 -0
  172. package/node_modules/uuid/dist/esm-browser/nil.js +1 -1
  173. package/node_modules/uuid/dist/esm-browser/parse.d.ts +2 -0
  174. package/node_modules/uuid/dist/esm-browser/parse.js +6 -32
  175. package/node_modules/uuid/dist/esm-browser/regex.d.ts +2 -0
  176. package/node_modules/uuid/dist/esm-browser/regex.js +1 -1
  177. package/node_modules/uuid/dist/esm-browser/rng.d.ts +1 -0
  178. package/node_modules/uuid/dist/esm-browser/rng.js +8 -16
  179. package/node_modules/uuid/dist/esm-browser/sha1.d.ts +2 -0
  180. package/node_modules/uuid/dist/esm-browser/sha1.js +62 -88
  181. package/node_modules/uuid/dist/esm-browser/stringify.d.ts +3 -0
  182. package/node_modules/uuid/dist/esm-browser/stringify.js +32 -27
  183. package/node_modules/uuid/dist/esm-browser/types.d.ts +21 -0
  184. package/node_modules/uuid/dist/esm-browser/types.js +1 -0
  185. package/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts +1 -0
  186. package/node_modules/uuid/dist/esm-browser/uuid-bin.js +70 -0
  187. package/node_modules/uuid/dist/esm-browser/v1.d.ts +11 -0
  188. package/node_modules/uuid/dist/esm-browser/v1.js +78 -90
  189. package/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts +2 -0
  190. package/node_modules/uuid/dist/esm-browser/v1ToV6.js +10 -0
  191. package/node_modules/uuid/dist/esm-browser/v3.d.ts +9 -0
  192. package/node_modules/uuid/dist/esm-browser/v3.js +8 -3
  193. package/node_modules/uuid/dist/esm-browser/v35.d.ts +7 -0
  194. package/node_modules/uuid/dist/esm-browser/v35.js +33 -58
  195. package/node_modules/uuid/dist/esm-browser/v4.d.ts +4 -0
  196. package/node_modules/uuid/dist/esm-browser/v4.js +23 -20
  197. package/node_modules/uuid/dist/esm-browser/v5.d.ts +9 -0
  198. package/node_modules/uuid/dist/esm-browser/v5.js +8 -3
  199. package/node_modules/uuid/dist/esm-browser/v6.d.ts +4 -0
  200. package/node_modules/uuid/dist/esm-browser/v6.js +20 -0
  201. package/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts +2 -0
  202. package/node_modules/uuid/dist/esm-browser/v6ToV1.js +10 -0
  203. package/node_modules/uuid/dist/esm-browser/v7.d.ts +9 -0
  204. package/node_modules/uuid/dist/esm-browser/v7.js +65 -0
  205. package/node_modules/uuid/dist/esm-browser/validate.d.ts +2 -0
  206. package/node_modules/uuid/dist/esm-browser/validate.js +2 -4
  207. package/node_modules/uuid/dist/esm-browser/version.d.ts +2 -0
  208. package/node_modules/uuid/dist/esm-browser/version.js +5 -8
  209. package/node_modules/uuid/package.json +80 -83
  210. package/package.json +5 -2
  211. package/worldmap/worldmap.js +7 -0
  212. package/worldmap.html +1 -1
  213. package/node_modules/body-parser/node_modules/qs/.editorconfig +0 -46
  214. package/node_modules/body-parser/node_modules/qs/.github/FUNDING.yml +0 -12
  215. package/node_modules/body-parser/node_modules/qs/.github/SECURITY.md +0 -11
  216. package/node_modules/body-parser/node_modules/qs/.github/THREAT_MODEL.md +0 -78
  217. package/node_modules/body-parser/node_modules/qs/.nycrc +0 -13
  218. package/node_modules/body-parser/node_modules/qs/CHANGELOG.md +0 -822
  219. package/node_modules/body-parser/node_modules/qs/LICENSE.md +0 -29
  220. package/node_modules/body-parser/node_modules/qs/README.md +0 -758
  221. package/node_modules/body-parser/node_modules/qs/dist/qs.js +0 -141
  222. package/node_modules/body-parser/node_modules/qs/eslint.config.mjs +0 -57
  223. package/node_modules/body-parser/node_modules/qs/lib/formats.js +0 -23
  224. package/node_modules/body-parser/node_modules/qs/lib/index.js +0 -11
  225. package/node_modules/body-parser/node_modules/qs/lib/parse.js +0 -403
  226. package/node_modules/body-parser/node_modules/qs/lib/stringify.js +0 -363
  227. package/node_modules/body-parser/node_modules/qs/lib/utils.js +0 -342
  228. package/node_modules/body-parser/node_modules/qs/package.json +0 -94
  229. package/node_modules/body-parser/node_modules/qs/test/empty-keys-cases.js +0 -267
  230. package/node_modules/body-parser/node_modules/qs/test/parse.js +0 -1703
  231. package/node_modules/body-parser/node_modules/qs/test/stringify.js +0 -1448
  232. package/node_modules/body-parser/node_modules/qs/test/utils.js +0 -432
  233. package/node_modules/uuid/CHANGELOG.md +0 -229
  234. package/node_modules/uuid/CONTRIBUTING.md +0 -18
  235. package/node_modules/uuid/dist/bin/uuid +0 -2
  236. package/node_modules/uuid/dist/esm-node/md5.js +0 -13
  237. package/node_modules/uuid/dist/esm-node/nil.js +0 -1
  238. package/node_modules/uuid/dist/esm-node/parse.js +0 -35
  239. package/node_modules/uuid/dist/esm-node/regex.js +0 -1
  240. package/node_modules/uuid/dist/esm-node/rng.js +0 -12
  241. package/node_modules/uuid/dist/esm-node/sha1.js +0 -13
  242. package/node_modules/uuid/dist/esm-node/stringify.js +0 -29
  243. package/node_modules/uuid/dist/esm-node/v1.js +0 -95
  244. package/node_modules/uuid/dist/esm-node/v3.js +0 -4
  245. package/node_modules/uuid/dist/esm-node/v35.js +0 -64
  246. package/node_modules/uuid/dist/esm-node/v4.js +0 -24
  247. package/node_modules/uuid/dist/esm-node/v5.js +0 -4
  248. package/node_modules/uuid/dist/esm-node/validate.js +0 -7
  249. package/node_modules/uuid/dist/esm-node/version.js +0 -11
  250. package/node_modules/uuid/dist/index.js +0 -79
  251. package/node_modules/uuid/dist/md5-browser.js +0 -223
  252. package/node_modules/uuid/dist/md5.js +0 -23
  253. package/node_modules/uuid/dist/nil.js +0 -8
  254. package/node_modules/uuid/dist/parse.js +0 -45
  255. package/node_modules/uuid/dist/regex.js +0 -8
  256. package/node_modules/uuid/dist/rng-browser.js +0 -26
  257. package/node_modules/uuid/dist/rng.js +0 -24
  258. package/node_modules/uuid/dist/sha1-browser.js +0 -104
  259. package/node_modules/uuid/dist/sha1.js +0 -23
  260. package/node_modules/uuid/dist/stringify.js +0 -39
  261. package/node_modules/uuid/dist/umd/uuid.min.js +0 -1
  262. package/node_modules/uuid/dist/umd/uuidNIL.min.js +0 -1
  263. package/node_modules/uuid/dist/umd/uuidParse.min.js +0 -1
  264. package/node_modules/uuid/dist/umd/uuidStringify.min.js +0 -1
  265. package/node_modules/uuid/dist/umd/uuidValidate.min.js +0 -1
  266. package/node_modules/uuid/dist/umd/uuidVersion.min.js +0 -1
  267. package/node_modules/uuid/dist/umd/uuidv1.min.js +0 -1
  268. package/node_modules/uuid/dist/umd/uuidv3.min.js +0 -1
  269. package/node_modules/uuid/dist/umd/uuidv4.min.js +0 -1
  270. package/node_modules/uuid/dist/umd/uuidv5.min.js +0 -1
  271. package/node_modules/uuid/dist/uuid-bin.js +0 -85
  272. package/node_modules/uuid/dist/v1.js +0 -107
  273. package/node_modules/uuid/dist/v3.js +0 -16
  274. package/node_modules/uuid/dist/v35.js +0 -78
  275. package/node_modules/uuid/dist/v4.js +0 -37
  276. package/node_modules/uuid/dist/v5.js +0 -16
  277. package/node_modules/uuid/dist/validate.js +0 -17
  278. package/node_modules/uuid/dist/version.js +0 -21
  279. package/node_modules/uuid/wrapper.mjs +0 -10
@@ -1,403 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('./utils');
4
-
5
- var has = Object.prototype.hasOwnProperty;
6
- var isArray = Array.isArray;
7
-
8
- var defaults = {
9
- allowDots: false,
10
- allowEmptyArrays: false,
11
- allowPrototypes: false,
12
- allowSparse: false,
13
- arrayLimit: 20,
14
- charset: 'utf-8',
15
- charsetSentinel: false,
16
- comma: false,
17
- decodeDotInKeys: false,
18
- decoder: utils.decode,
19
- delimiter: '&',
20
- depth: 5,
21
- duplicates: 'combine',
22
- ignoreQueryPrefix: false,
23
- interpretNumericEntities: false,
24
- parameterLimit: 1000,
25
- parseArrays: true,
26
- plainObjects: false,
27
- strictDepth: false,
28
- strictMerge: true,
29
- strictNullHandling: false,
30
- throwOnLimitExceeded: false
31
- };
32
-
33
- var interpretNumericEntities = function (str) {
34
- return str.replace(/&#(\d+);/g, function ($0, numberStr) {
35
- return String.fromCharCode(parseInt(numberStr, 10));
36
- });
37
- };
38
-
39
- var parseArrayValue = function (val, options, currentArrayLength) {
40
- if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
41
- return val.split(',');
42
- }
43
-
44
- if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
45
- throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
46
- }
47
-
48
- return val;
49
- };
50
-
51
- // This is what browsers will submit when the ✓ character occurs in an
52
- // application/x-www-form-urlencoded body and the encoding of the page containing
53
- // the form is iso-8859-1, or when the submitted form has an accept-charset
54
- // attribute of iso-8859-1. Presumably also with other charsets that do not contain
55
- // the ✓ character, such as us-ascii.
56
- var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
57
-
58
- // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
59
- var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
60
-
61
- var parseValues = function parseQueryStringValues(str, options) {
62
- var obj = { __proto__: null };
63
-
64
- var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
65
- cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
66
-
67
- var limit = options.parameterLimit === Infinity ? void undefined : options.parameterLimit;
68
- var parts = cleanStr.split(
69
- options.delimiter,
70
- options.throwOnLimitExceeded && typeof limit !== 'undefined' ? limit + 1 : limit
71
- );
72
-
73
- if (options.throwOnLimitExceeded && typeof limit !== 'undefined' && parts.length > limit) {
74
- throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
75
- }
76
-
77
- var skipIndex = -1; // Keep track of where the utf8 sentinel was found
78
- var i;
79
-
80
- var charset = options.charset;
81
- if (options.charsetSentinel) {
82
- for (i = 0; i < parts.length; ++i) {
83
- if (parts[i].indexOf('utf8=') === 0) {
84
- if (parts[i] === charsetSentinel) {
85
- charset = 'utf-8';
86
- } else if (parts[i] === isoSentinel) {
87
- charset = 'iso-8859-1';
88
- }
89
- skipIndex = i;
90
- i = parts.length; // The eslint settings do not allow break;
91
- }
92
- }
93
- }
94
-
95
- for (i = 0; i < parts.length; ++i) {
96
- if (i === skipIndex) {
97
- continue;
98
- }
99
- var part = parts[i];
100
-
101
- var bracketEqualsPos = part.indexOf(']=');
102
- var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
103
-
104
- var key;
105
- var val;
106
- if (pos === -1) {
107
- key = options.decoder(part, defaults.decoder, charset, 'key');
108
- val = options.strictNullHandling ? null : '';
109
- } else {
110
- key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
111
-
112
- if (key !== null) {
113
- val = utils.maybeMap(
114
- parseArrayValue(
115
- part.slice(pos + 1),
116
- options,
117
- isArray(obj[key]) ? obj[key].length : 0
118
- ),
119
- function (encodedVal) {
120
- return options.decoder(encodedVal, defaults.decoder, charset, 'value');
121
- }
122
- );
123
- }
124
- }
125
-
126
- if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
127
- val = interpretNumericEntities(String(val));
128
- }
129
-
130
- if (part.indexOf('[]=') > -1) {
131
- val = isArray(val) ? [val] : val;
132
- }
133
-
134
- if (options.comma && isArray(val) && val.length > options.arrayLimit) {
135
- if (options.throwOnLimitExceeded) {
136
- throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
137
- }
138
- val = utils.combine([], val, options.arrayLimit, options.plainObjects);
139
- }
140
-
141
- if (key !== null) {
142
- var existing = has.call(obj, key);
143
- if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) {
144
- obj[key] = utils.combine(
145
- obj[key],
146
- val,
147
- options.arrayLimit,
148
- options.plainObjects
149
- );
150
- } else if (!existing || options.duplicates === 'last') {
151
- obj[key] = val;
152
- }
153
- }
154
- }
155
-
156
- return obj;
157
- };
158
-
159
- var parseObject = function (chain, val, options, valuesParsed) {
160
- var currentArrayLength = 0;
161
- if (chain.length > 0 && chain[chain.length - 1] === '[]') {
162
- var parentKey = chain.slice(0, -1).join('');
163
- currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
164
- }
165
-
166
- var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
167
-
168
- for (var i = chain.length - 1; i >= 0; --i) {
169
- var obj;
170
- var root = chain[i];
171
-
172
- if (root === '[]' && options.parseArrays) {
173
- if (utils.isOverflow(leaf)) {
174
- // leaf is already an overflow object, preserve it
175
- obj = leaf;
176
- } else {
177
- obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
178
- ? []
179
- : utils.combine(
180
- [],
181
- leaf,
182
- options.arrayLimit,
183
- options.plainObjects
184
- );
185
- }
186
- } else {
187
- obj = options.plainObjects ? { __proto__: null } : {};
188
- var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
189
- var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
190
- var index = parseInt(decodedRoot, 10);
191
- var isValidArrayIndex = !isNaN(index)
192
- && root !== decodedRoot
193
- && String(index) === decodedRoot
194
- && index >= 0
195
- && options.parseArrays;
196
- if (!options.parseArrays && decodedRoot === '') {
197
- obj = { 0: leaf };
198
- } else if (isValidArrayIndex && index < options.arrayLimit) {
199
- obj = [];
200
- obj[index] = leaf;
201
- } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
202
- throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
203
- } else if (isValidArrayIndex) {
204
- obj[index] = leaf;
205
- utils.markOverflow(obj, index);
206
- } else if (decodedRoot !== '__proto__') {
207
- obj[decodedRoot] = leaf;
208
- }
209
- }
210
-
211
- leaf = obj;
212
- }
213
-
214
- return leaf;
215
- };
216
-
217
- // Split a key like "a[b][c[]]" into ['a', '[b]', '[c[]]'] while preserving
218
- // qs parse semantics for depth/prototype guards.
219
- var splitKeyIntoSegments = function splitKeyIntoSegments(originalKey, options) {
220
- var key = options.allowDots ? originalKey.replace(/\.([^.[]+)/g, '[$1]') : originalKey;
221
-
222
- // depth <= 0 keeps the whole key as one segment
223
- if (options.depth <= 0) {
224
- if (!options.plainObjects && has.call(Object.prototype, key)) {
225
- if (!options.allowPrototypes) {
226
- return;
227
- }
228
- }
229
-
230
- return [key];
231
- }
232
-
233
- var segments = [];
234
-
235
- // parent before the first '[' (may be empty if key starts with '[')
236
- var first = key.indexOf('[');
237
- var parent = first >= 0 ? key.slice(0, first) : key;
238
- if (parent) {
239
- if (!options.plainObjects && has.call(Object.prototype, parent)) {
240
- if (!options.allowPrototypes) {
241
- return;
242
- }
243
- }
244
-
245
- segments[segments.length] = parent;
246
- }
247
-
248
- var n = key.length;
249
- var open = first;
250
- var collected = 0;
251
-
252
- while (open >= 0 && collected < options.depth) {
253
- var level = 1;
254
- var i = open + 1;
255
- var close = -1;
256
-
257
- // balance nested '[' and ']' inside this bracket group using a nesting level counter
258
- while (i < n && close < 0) {
259
- var cu = key.charCodeAt(i);
260
- if (cu === 0x5B) { // '['
261
- level += 1;
262
- } else if (cu === 0x5D) { // ']'
263
- level -= 1;
264
- if (level === 0) {
265
- close = i; // found matching close; loop will exit by condition
266
- }
267
- }
268
- i += 1;
269
- }
270
-
271
- if (close < 0) {
272
- // Unterminated group: wrap the raw remainder in one bracket pair so it stays
273
- // a single literal segment (e.g. "[[]b" -> "[[]b]"); we do not infer missing ']'.
274
- segments[segments.length] = '[' + key.slice(open) + ']';
275
- return segments;
276
- }
277
-
278
- var seg = key.slice(open, close + 1);
279
- // prototype guard for the content of this group
280
- var content = seg.slice(1, -1);
281
- if (!options.plainObjects && has.call(Object.prototype, content) && !options.allowPrototypes) {
282
- return;
283
- }
284
-
285
- segments[segments.length] = seg;
286
- collected += 1;
287
-
288
- // find the next '[' after this balanced group
289
- open = key.indexOf('[', close + 1);
290
- }
291
-
292
- if (open >= 0) {
293
- if (options.strictDepth === true) {
294
- throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
295
- }
296
-
297
- segments[segments.length] = '[' + key.slice(open) + ']';
298
- }
299
-
300
- return segments;
301
- };
302
-
303
- var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
304
- if (!givenKey) {
305
- return;
306
- }
307
-
308
- var keys = splitKeyIntoSegments(givenKey, options);
309
-
310
- if (!keys) {
311
- return;
312
- }
313
-
314
- return parseObject(keys, val, options, valuesParsed);
315
- };
316
-
317
- var normalizeParseOptions = function normalizeParseOptions(opts) {
318
- if (!opts) {
319
- return defaults;
320
- }
321
-
322
- if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
323
- throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
324
- }
325
-
326
- if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
327
- throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
328
- }
329
-
330
- if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
331
- throw new TypeError('Decoder has to be a function.');
332
- }
333
-
334
- if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
335
- throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
336
- }
337
-
338
- if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
339
- throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
340
- }
341
-
342
- var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
343
-
344
- var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
345
-
346
- if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
347
- throw new TypeError('The duplicates option must be either combine, first, or last');
348
- }
349
-
350
- var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
351
-
352
- return {
353
- allowDots: allowDots,
354
- allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
355
- allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
356
- allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
357
- arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
358
- charset: charset,
359
- charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
360
- comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
361
- decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
362
- decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
363
- delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
364
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
365
- depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
366
- duplicates: duplicates,
367
- ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
368
- interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
369
- parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
370
- parseArrays: opts.parseArrays !== false,
371
- plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
372
- strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
373
- strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge,
374
- strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
375
- throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
376
- };
377
- };
378
-
379
- module.exports = function (str, opts) {
380
- var options = normalizeParseOptions(opts);
381
-
382
- if (str === '' || str === null || typeof str === 'undefined') {
383
- return options.plainObjects ? { __proto__: null } : {};
384
- }
385
-
386
- var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
387
- var obj = options.plainObjects ? { __proto__: null } : {};
388
-
389
- // Iterate over the keys and setup the new object
390
-
391
- var keys = Object.keys(tempObj);
392
- for (var i = 0; i < keys.length; ++i) {
393
- var key = keys[i];
394
- var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
395
- obj = utils.merge(obj, newObj, options);
396
- }
397
-
398
- if (options.allowSparse === true) {
399
- return obj;
400
- }
401
-
402
- return utils.compact(obj);
403
- };