node-red-contrib-web-worldmap 2.28.3 → 2.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/.github/FUNDING.yml +13 -0
  2. package/CHANGELOG.md +10 -0
  3. package/README.md +5 -3
  4. package/node_modules/array-flatten/package.json +6 -9
  5. package/node_modules/body-parser/HISTORY.md +18 -0
  6. package/node_modules/body-parser/README.md +9 -1
  7. package/node_modules/body-parser/SECURITY.md +25 -0
  8. package/node_modules/body-parser/lib/read.js +26 -2
  9. package/node_modules/body-parser/lib/types/json.js +10 -4
  10. package/node_modules/body-parser/package.json +24 -20
  11. package/node_modules/call-bind/.eslintignore +1 -0
  12. package/node_modules/call-bind/.eslintrc +17 -0
  13. package/node_modules/call-bind/.github/FUNDING.yml +12 -0
  14. package/node_modules/call-bind/.nycrc +13 -0
  15. package/node_modules/call-bind/CHANGELOG.md +42 -0
  16. package/node_modules/call-bind/LICENSE +21 -0
  17. package/node_modules/call-bind/README.md +2 -0
  18. package/node_modules/call-bind/callBound.js +15 -0
  19. package/node_modules/call-bind/index.js +47 -0
  20. package/node_modules/call-bind/package.json +108 -0
  21. package/node_modules/call-bind/test/callBound.js +55 -0
  22. package/node_modules/call-bind/test/index.js +66 -0
  23. package/node_modules/cookie/HISTORY.md +8 -0
  24. package/node_modules/cookie/README.md +50 -34
  25. package/node_modules/cookie/SECURITY.md +25 -0
  26. package/node_modules/cookie/index.js +83 -15
  27. package/node_modules/cookie/package.json +17 -15
  28. package/node_modules/cookie-signature/package.json +6 -9
  29. package/node_modules/depd/History.md +7 -0
  30. package/node_modules/depd/LICENSE +1 -1
  31. package/node_modules/depd/Readme.md +8 -8
  32. package/node_modules/depd/index.js +29 -13
  33. package/node_modules/depd/package.json +25 -24
  34. package/node_modules/destroy/LICENSE +1 -0
  35. package/node_modules/destroy/README.md +15 -12
  36. package/node_modules/destroy/index.js +147 -13
  37. package/node_modules/destroy/package.json +29 -20
  38. package/node_modules/ee-first/package.json +6 -9
  39. package/node_modules/encodeurl/package.json +11 -14
  40. package/node_modules/escape-html/package.json +11 -14
  41. package/node_modules/etag/package.json +11 -14
  42. package/node_modules/express/History.md +54 -0
  43. package/node_modules/express/Readme.md +39 -31
  44. package/node_modules/express/lib/application.js +18 -1
  45. package/node_modules/express/lib/response.js +40 -18
  46. package/node_modules/express/lib/router/index.js +20 -15
  47. package/node_modules/express/lib/router/route.js +9 -0
  48. package/node_modules/express/lib/utils.js +1 -0
  49. package/node_modules/express/lib/view.js +1 -1
  50. package/node_modules/express/package.json +25 -26
  51. package/node_modules/finalhandler/HISTORY.md +8 -0
  52. package/node_modules/finalhandler/LICENSE +1 -1
  53. package/node_modules/finalhandler/README.md +5 -6
  54. package/node_modules/finalhandler/SECURITY.md +25 -0
  55. package/node_modules/finalhandler/index.js +8 -3
  56. package/node_modules/finalhandler/package.json +30 -32
  57. package/node_modules/fresh/package.json +6 -9
  58. package/node_modules/function-bind/.editorconfig +20 -0
  59. package/node_modules/function-bind/.eslintrc +15 -0
  60. package/node_modules/function-bind/.jscs.json +176 -0
  61. package/node_modules/function-bind/.npmignore +22 -0
  62. package/node_modules/function-bind/.travis.yml +168 -0
  63. package/node_modules/function-bind/LICENSE +20 -0
  64. package/node_modules/function-bind/README.md +48 -0
  65. package/node_modules/function-bind/implementation.js +52 -0
  66. package/node_modules/function-bind/index.js +5 -0
  67. package/node_modules/function-bind/package.json +96 -0
  68. package/node_modules/function-bind/test/.eslintrc +9 -0
  69. package/node_modules/function-bind/test/index.js +252 -0
  70. package/node_modules/get-intrinsic/.eslintrc +37 -0
  71. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  72. package/node_modules/get-intrinsic/.nycrc +9 -0
  73. package/node_modules/get-intrinsic/CHANGELOG.md +98 -0
  74. package/node_modules/get-intrinsic/LICENSE +21 -0
  75. package/node_modules/get-intrinsic/README.md +71 -0
  76. package/node_modules/get-intrinsic/index.js +334 -0
  77. package/node_modules/get-intrinsic/package.json +120 -0
  78. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  79. package/node_modules/has/LICENSE-MIT +22 -0
  80. package/node_modules/has/README.md +18 -0
  81. package/node_modules/has/package.json +73 -0
  82. package/node_modules/has/src/index.js +5 -0
  83. package/node_modules/has/test/index.js +10 -0
  84. package/node_modules/has-symbols/.eslintrc +11 -0
  85. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  86. package/node_modules/has-symbols/.nycrc +9 -0
  87. package/node_modules/has-symbols/CHANGELOG.md +75 -0
  88. package/node_modules/has-symbols/LICENSE +21 -0
  89. package/node_modules/has-symbols/README.md +46 -0
  90. package/node_modules/has-symbols/index.js +13 -0
  91. package/node_modules/has-symbols/package.json +126 -0
  92. package/node_modules/has-symbols/shams.js +42 -0
  93. package/node_modules/has-symbols/test/index.js +22 -0
  94. package/node_modules/has-symbols/test/shams/core-js.js +28 -0
  95. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +28 -0
  96. package/node_modules/has-symbols/test/tests.js +56 -0
  97. package/node_modules/http-errors/HISTORY.md +15 -0
  98. package/node_modules/http-errors/README.md +2 -2
  99. package/node_modules/http-errors/index.js +15 -25
  100. package/node_modules/http-errors/package.json +22 -20
  101. package/node_modules/media-typer/package.json +6 -9
  102. package/node_modules/merge-descriptors/package.json +6 -9
  103. package/node_modules/methods/package.json +11 -14
  104. package/node_modules/object-inspect/.eslintrc +53 -0
  105. package/node_modules/object-inspect/.github/FUNDING.yml +12 -0
  106. package/node_modules/object-inspect/.nycrc +13 -0
  107. package/node_modules/object-inspect/CHANGELOG.md +360 -0
  108. package/node_modules/object-inspect/LICENSE +21 -0
  109. package/node_modules/object-inspect/example/all.js +23 -0
  110. package/node_modules/object-inspect/example/circular.js +6 -0
  111. package/node_modules/object-inspect/example/fn.js +5 -0
  112. package/node_modules/object-inspect/example/inspect.js +10 -0
  113. package/node_modules/object-inspect/index.js +512 -0
  114. package/node_modules/object-inspect/package-support.json +20 -0
  115. package/node_modules/object-inspect/package.json +122 -0
  116. package/node_modules/object-inspect/readme.markdown +86 -0
  117. package/node_modules/object-inspect/test/bigint.js +58 -0
  118. package/node_modules/object-inspect/test/browser/dom.js +15 -0
  119. package/node_modules/object-inspect/test/circular.js +16 -0
  120. package/node_modules/object-inspect/test/deep.js +12 -0
  121. package/node_modules/object-inspect/test/element.js +53 -0
  122. package/node_modules/object-inspect/test/err.js +48 -0
  123. package/node_modules/object-inspect/test/fakes.js +29 -0
  124. package/node_modules/object-inspect/test/fn.js +76 -0
  125. package/node_modules/object-inspect/test/has.js +15 -0
  126. package/node_modules/object-inspect/test/holes.js +15 -0
  127. package/node_modules/object-inspect/test/indent-option.js +271 -0
  128. package/node_modules/object-inspect/test/inspect.js +139 -0
  129. package/node_modules/object-inspect/test/lowbyte.js +12 -0
  130. package/node_modules/object-inspect/test/number.js +58 -0
  131. package/node_modules/object-inspect/test/quoteStyle.js +17 -0
  132. package/node_modules/object-inspect/test/toStringTag.js +40 -0
  133. package/node_modules/object-inspect/test/undef.js +12 -0
  134. package/node_modules/object-inspect/test/values.js +211 -0
  135. package/node_modules/object-inspect/test-core-js.js +26 -0
  136. package/node_modules/object-inspect/util.inspect.js +1 -0
  137. package/node_modules/on-finished/HISTORY.md +10 -0
  138. package/node_modules/on-finished/README.md +28 -20
  139. package/node_modules/on-finished/index.js +51 -13
  140. package/node_modules/on-finished/package.json +25 -20
  141. package/node_modules/path-to-regexp/package.json +6 -9
  142. package/node_modules/qs/CHANGELOG.md +22 -5
  143. package/node_modules/qs/README.md +7 -0
  144. package/node_modules/qs/dist/qs.js +1207 -5
  145. package/node_modules/qs/lib/parse.js +6 -0
  146. package/node_modules/qs/lib/stringify.js +33 -3
  147. package/node_modules/qs/package.json +16 -13
  148. package/node_modules/qs/test/parse.js +9 -0
  149. package/node_modules/qs/test/stringify.js +62 -1
  150. package/node_modules/raw-body/HISTORY.md +14 -0
  151. package/node_modules/raw-body/LICENSE +1 -1
  152. package/node_modules/raw-body/README.md +4 -0
  153. package/node_modules/raw-body/SECURITY.md +24 -0
  154. package/node_modules/raw-body/index.js +45 -2
  155. package/node_modules/raw-body/package.json +16 -15
  156. package/node_modules/send/HISTORY.md +15 -0
  157. package/node_modules/send/LICENSE +1 -1
  158. package/node_modules/send/README.md +2 -2
  159. package/node_modules/send/SECURITY.md +24 -0
  160. package/node_modules/send/index.js +37 -27
  161. package/node_modules/send/package.json +22 -21
  162. package/node_modules/serve-static/HISTORY.md +12 -0
  163. package/node_modules/serve-static/README.md +1 -1
  164. package/node_modules/serve-static/package.json +16 -16
  165. package/node_modules/side-channel/.eslintignore +1 -0
  166. package/node_modules/side-channel/.eslintrc +11 -0
  167. package/node_modules/side-channel/.github/FUNDING.yml +12 -0
  168. package/node_modules/side-channel/.nycrc +13 -0
  169. package/node_modules/side-channel/CHANGELOG.md +65 -0
  170. package/node_modules/side-channel/LICENSE +21 -0
  171. package/node_modules/side-channel/README.md +2 -0
  172. package/node_modules/side-channel/index.js +124 -0
  173. package/node_modules/side-channel/package.json +95 -0
  174. package/node_modules/side-channel/test/index.js +78 -0
  175. package/node_modules/statuses/HISTORY.md +17 -0
  176. package/node_modules/statuses/README.md +51 -42
  177. package/node_modules/statuses/codes.json +2 -3
  178. package/node_modules/statuses/index.js +52 -19
  179. package/node_modules/statuses/package.json +29 -31
  180. package/node_modules/unpipe/package.json +7 -9
  181. package/node_modules/utils-merge/package.json +6 -9
  182. package/package.json +2 -2
  183. package/worldmap/worldmap.js +90 -42
  184. package/worldmap.html +16 -2
  185. package/worldmap.js +553 -551
  186. package/node_modules/depd/lib/compat/callsite-tostring.js +0 -103
  187. package/node_modules/depd/lib/compat/event-listener-count.js +0 -22
  188. package/node_modules/depd/lib/compat/index.js +0 -79
@@ -0,0 +1,13 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [dceejay]
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: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
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
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
package/CHANGELOG.md CHANGED
@@ -1,17 +1,27 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v2.30.1 - Don't resend bounds if not changed. Issue #209
4
+ - v2.30.0 - Add show/hide ruler option. PR #206
5
+
6
+ - v2.29.0 - Change locate to be a toggle and add command (trackme) to set style. Issue #202
7
+
3
8
  - v2.28.3 - Let button declaration be an array
4
9
  - v2.28.1 - Fix layer command bug for non-core layers. Issue #195
5
10
  - v2.28.0 - Better Handling of sidc icons in geojson
11
+
6
12
  - v2.27.3 - Try to handle greatcircles crossing antimeridian
7
13
  - v2.27.1 - Reload existing markers for late joiners
14
+
8
15
  - v2.26.1 - Add QTH/Maidenhead option also
9
16
  - v2.26.0 - Add UTM and MGRS to coordinate display options.
17
+
10
18
  - v2.25.0 - Add bounds command to set overall map bounds.
19
+
11
20
  - v2.24.3 - Fix geojson incorrect fill.
12
21
  - v2.24.2 - Changes to drawing colours to be more visible.
13
22
  - v2.24.1 - Fix ellipse accuracy.
14
23
  - v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193
24
+
15
25
  - v2.23.5 - Fix addtoheatmap. Issue #192
16
26
  - v2.23.4 - Fix opacity of area borders
17
27
  - v2.23.3 - Fix initial load of maps
package/README.md CHANGED
@@ -11,6 +11,9 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.30.1 - Don't resend bounds if not changed. Issue #209
15
+ - v2.30.0 - Add show/hide ruler option. PR #206
16
+ - v2.29.0 - Change locate to be a toggle and add command (trackme) to set style. Issue #202
14
17
  - v2.28.3 - Let button declaration be an array
15
18
  - v2.28.1 - Fix layer command bug for non-core layers. Issue #195
16
19
  - v2.28.0 - Better Handling of sidc icons in geojson
@@ -29,9 +32,6 @@ map web page for plotting "things" on.
29
32
  - v2.23.2 - Add convex-hull example
30
33
  - v2.23.1 - Fix saving of custom map layer
31
34
  - v2.23.0 - Give logo an id so it can be overridden by toplogo command. PR #188.
32
- - v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island.
33
- - v2.22.2 - Be more tolerant of speed string types
34
- - v2.22.0 - Separate out layer events in worldmap in
35
35
 
36
36
  - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
37
37
 
@@ -420,11 +420,13 @@ Optional properties include
420
420
  - **zoomlock** - locks the zoom control to the current value and removes zoom control - `{"command":{"zoomlock":true}}`
421
421
  - **hiderightclick** - disables the right click that allows adding or deleting points on the map - `{"command":{"hiderightclick":true}}`
422
422
  - **coords** - turns on and off a display of the current mouse co-ordinates. Values can be "deg", "dms", or "none" (default). - `{"command":{"coords":"deg"}}`
423
+ - **showruler** - turns on and off a display of the ruler control. Values can be "true" or "false". - `{"command":{"showruler":true}}`
423
424
  - **button** - if supplied with a `name` and `icon` property - adds a button to provide user input - sends
424
425
  a msg `{"action":"button", "name":"the_button_name"}` to the worldmap in node. If supplied with a `name` property only, it will remove the button. Optional `position` property can be 'bottomright', 'bottomleft', 'topleft' or 'topright' (default). button can also be an array of button objects.
425
426
  - **contextmenu** - html string to define the right click menu when not on a marker. Defaults to the simple add marker input. Empty string `""` disables this right click.
426
427
  - **toptitle** - Words to replace title in title bar (if not in iframe)
427
428
  - **toplogo** - URL to logo image for top tile bar (if not in iframe) - ideally 60px by 24px.
429
+ - **trackme** - Turns on/off the browser self locating. Boolean false = off, true = cyan circle showing accuracy error, or an object like `{"command":{"trackme":{"name":"Dave","icon":"car","iconColor":"blue","layer":"mytrack","accuracy":false}}}`. Usual marker options can be applied.
428
430
 
429
431
  #### To switch layer, move map and zoom
430
432
 
@@ -1,14 +1,8 @@
1
1
  {
2
- "_args": [
3
- [
4
- "array-flatten@1.1.1",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
2
  "_from": "array-flatten@1.1.1",
9
3
  "_id": "array-flatten@1.1.1",
10
4
  "_inBundle": false,
11
- "_integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=",
5
+ "_integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
12
6
  "_location": "/array-flatten",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
@@ -25,8 +19,9 @@
25
19
  "/express"
26
20
  ],
27
21
  "_resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
28
- "_spec": "1.1.1",
29
- "_where": "/Users/conway/Projects/worldmap",
22
+ "_shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
23
+ "_spec": "array-flatten@1.1.1",
24
+ "_where": "/Users/conway/Projects/worldmap/node_modules/express",
30
25
  "author": {
31
26
  "name": "Blake Embrey",
32
27
  "email": "hello@blakeembrey.com",
@@ -35,6 +30,8 @@
35
30
  "bugs": {
36
31
  "url": "https://github.com/blakeembrey/array-flatten/issues"
37
32
  },
33
+ "bundleDependencies": false,
34
+ "deprecated": false,
38
35
  "description": "Flatten an array of nested arrays into a single flat array",
39
36
  "devDependencies": {
40
37
  "istanbul": "^0.3.13",
@@ -1,3 +1,21 @@
1
+ 1.20.0 / 2022-04-02
2
+ ===================
3
+
4
+ * Fix error message for json parse whitespace in `strict`
5
+ * Fix internal error when inflated body exceeds limit
6
+ * Prevent loss of async hooks context
7
+ * Prevent hanging when request already read
8
+ * deps: depd@2.0.0
9
+ - Replace internal `eval` usage with `Function` constructor
10
+ - Use instance methods on `process` to check for listeners
11
+ * deps: http-errors@2.0.0
12
+ - deps: depd@2.0.0
13
+ - deps: statuses@2.0.1
14
+ * deps: on-finished@2.4.1
15
+ * deps: qs@6.10.3
16
+ * deps: raw-body@2.5.1
17
+ - deps: http-errors@2.0.0
18
+
1
19
  1.19.2 / 2022-02-15
2
20
  ===================
3
21
 
@@ -342,6 +342,14 @@ to this middleware. This module operates directly on bytes only and you cannot
342
342
  call `req.setEncoding` when using this module. The `status` property is set to
343
343
  `500` and the `type` property is set to `'stream.encoding.set'`.
344
344
 
345
+ ### stream is not readable
346
+
347
+ This error will occur when the request is no longer readable when this middleware
348
+ attempts to read it. This typically means something other than a middleware from
349
+ this module read the reqest body already and the middleware was also configured to
350
+ read the same request. The `status` property is set to `500` and the `type`
351
+ property is set to `'stream.not.readable'`.
352
+
345
353
  ### too many parameters
346
354
 
347
355
  This error will occur when the content of the request exceeds the configured
@@ -453,4 +461,4 @@ app.use(bodyParser.text({ type: 'text/html' }))
453
461
  [downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
454
462
  [downloads-url]: https://npmjs.org/package/body-parser
455
463
  [github-actions-ci-image]: https://img.shields.io/github/workflow/status/expressjs/body-parser/ci/master?label=ci
456
- [github-actions-ci-url]: https://github.com/expressjs/body-parser?query=workflow%3Aci
464
+ [github-actions-ci-url]: https://github.com/expressjs/body-parser/actions/workflows/ci.yml
@@ -0,0 +1,25 @@
1
+ # Security Policies and Procedures
2
+
3
+ ## Reporting a Bug
4
+
5
+ The Express team and community take all security bugs seriously. Thank you
6
+ for improving the security of Express. We appreciate your efforts and
7
+ responsible disclosure and will make every effort to acknowledge your
8
+ contributions.
9
+
10
+ Report security bugs by emailing the current owner(s) of `body-parser`. This
11
+ information can be found in the npm registry using the command
12
+ `npm owner ls body-parser`.
13
+ If unsure or unable to get the information from the above, open an issue
14
+ in the [project issue tracker](https://github.com/expressjs/body-parser/issues)
15
+ asking for the current contact information.
16
+
17
+ To ensure the timely response to your report, please ensure that the entirety
18
+ of the report is contained within the email body and not solely behind a web
19
+ link or an attachment.
20
+
21
+ At least one owner will acknowledge your email within 48 hours, and will send a
22
+ more detailed response within 48 hours indicating the next steps in handling
23
+ your report. After the initial reply to your report, the owners will
24
+ endeavor to keep you informed of the progress towards a fix and full
25
+ announcement, and may ask for additional information or guidance.
@@ -12,9 +12,11 @@
12
12
  */
13
13
 
14
14
  var createError = require('http-errors')
15
+ var destroy = require('destroy')
15
16
  var getBody = require('raw-body')
16
17
  var iconv = require('iconv-lite')
17
18
  var onFinished = require('on-finished')
19
+ var unpipe = require('unpipe')
18
20
  var zlib = require('zlib')
19
21
 
20
22
  /**
@@ -89,9 +91,14 @@ function read (req, res, next, parse, debug, options) {
89
91
  _error = createError(400, error)
90
92
  }
91
93
 
94
+ // unpipe from stream and destroy
95
+ if (stream !== req) {
96
+ unpipe(req)
97
+ destroy(stream, true)
98
+ }
99
+
92
100
  // read off entire request
93
- stream.resume()
94
- onFinished(req, function onfinished () {
101
+ dump(req, function onfinished () {
95
102
  next(createError(400, _error))
96
103
  })
97
104
  return
@@ -179,3 +186,20 @@ function contentstream (req, debug, inflate) {
179
186
 
180
187
  return stream
181
188
  }
189
+
190
+ /**
191
+ * Dump the contents of a request.
192
+ *
193
+ * @param {object} req
194
+ * @param {function} callback
195
+ * @api private
196
+ */
197
+
198
+ function dump (req, callback) {
199
+ if (onFinished.isFinished(req)) {
200
+ callback(null)
201
+ } else {
202
+ onFinished(req, callback)
203
+ req.resume()
204
+ }
205
+ }
@@ -37,7 +37,7 @@ module.exports = json
37
37
  * %x0D ) ; Carriage return
38
38
  */
39
39
 
40
- var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*(.)/ // eslint-disable-line no-control-regex
40
+ var FIRST_CHAR_REGEXP = /^[\x20\x09\x0a\x0d]*([^\x20\x09\x0a\x0d])/ // eslint-disable-line no-control-regex
41
41
 
42
42
  /**
43
43
  * Create a middleware to parse JSON bodies.
@@ -122,7 +122,7 @@ function json (options) {
122
122
 
123
123
  // assert charset per RFC 7159 sec 8.1
124
124
  var charset = getCharset(req) || 'utf-8'
125
- if (charset.substr(0, 4) !== 'utf-') {
125
+ if (charset.slice(0, 4) !== 'utf-') {
126
126
  debug('invalid charset')
127
127
  next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
128
128
  charset: charset,
@@ -152,7 +152,9 @@ function json (options) {
152
152
 
153
153
  function createStrictSyntaxError (str, char) {
154
154
  var index = str.indexOf(char)
155
- var partial = str.substring(0, index) + '#'
155
+ var partial = index !== -1
156
+ ? str.substring(0, index) + '#'
157
+ : ''
156
158
 
157
159
  try {
158
160
  JSON.parse(partial); /* istanbul ignore next */ throw new SyntaxError('strict violation')
@@ -173,7 +175,11 @@ function createStrictSyntaxError (str, char) {
173
175
  */
174
176
 
175
177
  function firstchar (str) {
176
- return FIRST_CHAR_REGEXP.exec(str)[1]
178
+ var match = FIRST_CHAR_REGEXP.exec(str)
179
+
180
+ return match
181
+ ? match[1]
182
+ : undefined
177
183
  }
178
184
 
179
185
  /**
@@ -1,26 +1,26 @@
1
1
  {
2
- "_from": "body-parser@1.19.2",
3
- "_id": "body-parser@1.19.2",
2
+ "_from": "body-parser@1.20.0",
3
+ "_id": "body-parser@1.20.0",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==",
6
- "_location": "/node-red-contrib-web-worldmap/body-parser",
5
+ "_integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
6
+ "_location": "/body-parser",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "version",
10
10
  "registry": true,
11
- "raw": "body-parser@1.19.2",
11
+ "raw": "body-parser@1.20.0",
12
12
  "name": "body-parser",
13
13
  "escapedName": "body-parser",
14
- "rawSpec": "1.19.2",
14
+ "rawSpec": "1.20.0",
15
15
  "saveSpec": null,
16
- "fetchSpec": "1.19.2"
16
+ "fetchSpec": "1.20.0"
17
17
  },
18
18
  "_requiredBy": [
19
- "/node-red-contrib-web-worldmap/express"
19
+ "/express"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz",
22
- "_shasum": "4714ccd9c157d44797b8b5607d72c0b89952f26e",
23
- "_spec": "body-parser@1.19.2",
21
+ "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
22
+ "_shasum": "3de69bd89011c11573d7bfee6a64f11b6bd27cc5",
23
+ "_spec": "body-parser@1.20.0",
24
24
  "_where": "/Users/conway/Projects/worldmap/node_modules/express",
25
25
  "bugs": {
26
26
  "url": "https://github.com/expressjs/body-parser/issues"
@@ -41,13 +41,15 @@
41
41
  "bytes": "3.1.2",
42
42
  "content-type": "~1.0.4",
43
43
  "debug": "2.6.9",
44
- "depd": "~1.1.2",
45
- "http-errors": "1.8.1",
44
+ "depd": "2.0.0",
45
+ "destroy": "1.2.0",
46
+ "http-errors": "2.0.0",
46
47
  "iconv-lite": "0.4.24",
47
- "on-finished": "~2.3.0",
48
- "qs": "6.9.7",
49
- "raw-body": "2.4.3",
50
- "type-is": "~1.6.18"
48
+ "on-finished": "2.4.1",
49
+ "qs": "6.10.3",
50
+ "raw-body": "2.5.1",
51
+ "type-is": "~1.6.18",
52
+ "unpipe": "1.0.0"
51
53
  },
52
54
  "deprecated": false,
53
55
  "description": "Node.js body parsing middleware",
@@ -60,18 +62,20 @@
60
62
  "eslint-plugin-promise": "5.2.0",
61
63
  "eslint-plugin-standard": "4.1.0",
62
64
  "methods": "1.1.2",
63
- "mocha": "9.2.0",
65
+ "mocha": "9.2.2",
64
66
  "nyc": "15.1.0",
65
67
  "safe-buffer": "5.2.1",
66
68
  "supertest": "6.2.2"
67
69
  },
68
70
  "engines": {
69
- "node": ">= 0.8"
71
+ "node": ">= 0.8",
72
+ "npm": "1.2.8000 || >= 1.4.16"
70
73
  },
71
74
  "files": [
72
75
  "lib/",
73
76
  "LICENSE",
74
77
  "HISTORY.md",
78
+ "SECURITY.md",
75
79
  "index.js"
76
80
  ],
77
81
  "homepage": "https://github.com/expressjs/body-parser#readme",
@@ -87,5 +91,5 @@
87
91
  "test-ci": "nyc --reporter=lcov --reporter=text npm test",
88
92
  "test-cov": "nyc --reporter=html --reporter=text npm test"
89
93
  },
90
- "version": "1.19.2"
94
+ "version": "1.20.0"
91
95
  }
@@ -0,0 +1 @@
1
+ coverage/
@@ -0,0 +1,17 @@
1
+ {
2
+ "root": true,
3
+
4
+ "extends": "@ljharb",
5
+
6
+ "rules": {
7
+ "func-name-matching": 0,
8
+ "id-length": 0,
9
+ "new-cap": [2, {
10
+ "capIsNewExceptions": [
11
+ "GetIntrinsic",
12
+ ],
13
+ }],
14
+ "no-magic-numbers": 0,
15
+ "operator-linebreak": [2, "before"],
16
+ },
17
+ }
@@ -0,0 +1,12 @@
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/call-bind
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 up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,13 @@
1
+ {
2
+ "all": true,
3
+ "check-coverage": false,
4
+ "reporter": ["text-summary", "text", "html", "json"],
5
+ "lines": 86,
6
+ "statements": 85.93,
7
+ "functions": 82.43,
8
+ "branches": 76.06,
9
+ "exclude": [
10
+ "coverage",
11
+ "test"
12
+ ]
13
+ }
@@ -0,0 +1,42 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11
9
+
10
+ ### Commits
11
+
12
+ - [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d)
13
+
14
+ ## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08
15
+
16
+ ### Commits
17
+
18
+ - [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1)
19
+ - [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e)
20
+ - [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb)
21
+ - [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8)
22
+ - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71)
23
+ - [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee)
24
+ - [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2)
25
+ - [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8)
26
+ - [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532)
27
+ - [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6)
28
+
29
+ ## v1.0.0 - 2020-10-30
30
+
31
+ ### Commits
32
+
33
+ - Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50)
34
+ - Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df)
35
+ - Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65)
36
+ - npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249)
37
+ - [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13)
38
+ - [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4)
39
+ - [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717)
40
+ - [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af)
41
+ - Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650)
42
+ - [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Jordan Harband
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ # call-bind
2
+ Robustly `.call.bind()` a function.
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var GetIntrinsic = require('get-intrinsic');
4
+
5
+ var callBind = require('./');
6
+
7
+ var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
8
+
9
+ module.exports = function callBoundIntrinsic(name, allowMissing) {
10
+ var intrinsic = GetIntrinsic(name, !!allowMissing);
11
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
12
+ return callBind(intrinsic);
13
+ }
14
+ return intrinsic;
15
+ };
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ var bind = require('function-bind');
4
+ var GetIntrinsic = require('get-intrinsic');
5
+
6
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
7
+ var $call = GetIntrinsic('%Function.prototype.call%');
8
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
9
+
10
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
11
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
12
+ var $max = GetIntrinsic('%Math.max%');
13
+
14
+ if ($defineProperty) {
15
+ try {
16
+ $defineProperty({}, 'a', { value: 1 });
17
+ } catch (e) {
18
+ // IE 8 has a broken defineProperty
19
+ $defineProperty = null;
20
+ }
21
+ }
22
+
23
+ module.exports = function callBind(originalFunction) {
24
+ var func = $reflectApply(bind, $call, arguments);
25
+ if ($gOPD && $defineProperty) {
26
+ var desc = $gOPD(func, 'length');
27
+ if (desc.configurable) {
28
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
29
+ $defineProperty(
30
+ func,
31
+ 'length',
32
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
33
+ );
34
+ }
35
+ }
36
+ return func;
37
+ };
38
+
39
+ var applyBind = function applyBind() {
40
+ return $reflectApply(bind, $apply, arguments);
41
+ };
42
+
43
+ if ($defineProperty) {
44
+ $defineProperty(module.exports, 'apply', { value: applyBind });
45
+ } else {
46
+ module.exports.apply = applyBind;
47
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "_from": "call-bind@^1.0.0",
3
+ "_id": "call-bind@1.0.2",
4
+ "_inBundle": false,
5
+ "_integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
6
+ "_location": "/call-bind",
7
+ "_phantomChildren": {},
8
+ "_requested": {
9
+ "type": "range",
10
+ "registry": true,
11
+ "raw": "call-bind@^1.0.0",
12
+ "name": "call-bind",
13
+ "escapedName": "call-bind",
14
+ "rawSpec": "^1.0.0",
15
+ "saveSpec": null,
16
+ "fetchSpec": "^1.0.0"
17
+ },
18
+ "_requiredBy": [
19
+ "/side-channel"
20
+ ],
21
+ "_resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
22
+ "_shasum": "b1d4e89e688119c3c9a903ad30abb2f6a919be3c",
23
+ "_spec": "call-bind@^1.0.0",
24
+ "_where": "/Users/conway/Projects/worldmap/node_modules/side-channel",
25
+ "author": {
26
+ "name": "Jordan Harband",
27
+ "email": "ljharb@gmail.com"
28
+ },
29
+ "auto-changelog": {
30
+ "output": "CHANGELOG.md",
31
+ "template": "keepachangelog",
32
+ "unreleased": false,
33
+ "commitLimit": false,
34
+ "backfillLimit": false,
35
+ "hideCredit": true
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/ljharb/call-bind/issues"
39
+ },
40
+ "bundleDependencies": false,
41
+ "dependencies": {
42
+ "function-bind": "^1.1.1",
43
+ "get-intrinsic": "^1.0.2"
44
+ },
45
+ "deprecated": false,
46
+ "description": "Robustly `.call.bind()` a function",
47
+ "devDependencies": {
48
+ "@ljharb/eslint-config": "^17.3.0",
49
+ "aud": "^1.1.3",
50
+ "auto-changelog": "^2.2.1",
51
+ "eslint": "^7.17.0",
52
+ "nyc": "^10.3.2",
53
+ "safe-publish-latest": "^1.1.4",
54
+ "tape": "^5.1.1"
55
+ },
56
+ "exports": {
57
+ ".": [
58
+ {
59
+ "default": "./index.js"
60
+ },
61
+ "./index.js"
62
+ ],
63
+ "./callBound": [
64
+ {
65
+ "default": "./callBound.js"
66
+ },
67
+ "./callBound.js"
68
+ ],
69
+ "./package.json": "./package.json"
70
+ },
71
+ "funding": {
72
+ "url": "https://github.com/sponsors/ljharb"
73
+ },
74
+ "homepage": "https://github.com/ljharb/call-bind#readme",
75
+ "keywords": [
76
+ "javascript",
77
+ "ecmascript",
78
+ "es",
79
+ "js",
80
+ "callbind",
81
+ "callbound",
82
+ "call",
83
+ "bind",
84
+ "bound",
85
+ "call-bind",
86
+ "call-bound",
87
+ "function",
88
+ "es-abstract"
89
+ ],
90
+ "license": "MIT",
91
+ "main": "index.js",
92
+ "name": "call-bind",
93
+ "repository": {
94
+ "type": "git",
95
+ "url": "git+https://github.com/ljharb/call-bind.git"
96
+ },
97
+ "scripts": {
98
+ "lint": "eslint --ext=.js,.mjs .",
99
+ "posttest": "aud --production",
100
+ "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"",
101
+ "prepublish": "safe-publish-latest",
102
+ "pretest": "npm run lint",
103
+ "test": "npm run tests-only",
104
+ "tests-only": "nyc tape 'test/*'",
105
+ "version": "auto-changelog && git add CHANGELOG.md"
106
+ },
107
+ "version": "1.0.2"
108
+ }