node-red-contrib-web-worldmap 2.23.5 → 2.24.3

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 (195) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/README.md +11 -2
  3. package/node_modules/body-parser/HISTORY.md +15 -0
  4. package/node_modules/body-parser/README.md +25 -12
  5. package/node_modules/body-parser/node_modules/bytes/History.md +5 -0
  6. package/node_modules/body-parser/node_modules/bytes/Readme.md +42 -16
  7. package/node_modules/body-parser/node_modules/bytes/index.js +5 -1
  8. package/node_modules/body-parser/node_modules/bytes/package.json +20 -22
  9. package/node_modules/body-parser/package.json +34 -37
  10. package/node_modules/content-disposition/HISTORY.md +5 -0
  11. package/node_modules/content-disposition/README.md +3 -9
  12. package/node_modules/content-disposition/index.js +1 -1
  13. package/node_modules/content-disposition/node_modules/safe-buffer/LICENSE +21 -0
  14. package/node_modules/content-disposition/node_modules/safe-buffer/README.md +584 -0
  15. package/node_modules/content-disposition/node_modules/safe-buffer/index.d.ts +187 -0
  16. package/node_modules/content-disposition/node_modules/safe-buffer/index.js +65 -0
  17. package/node_modules/content-disposition/node_modules/safe-buffer/package.json +76 -0
  18. package/node_modules/content-disposition/package.json +27 -30
  19. package/node_modules/cookie/HISTORY.md +5 -0
  20. package/node_modules/cookie/README.md +4 -0
  21. package/node_modules/cookie/index.js +5 -1
  22. package/node_modules/cookie/package.json +22 -25
  23. package/node_modules/express/History.md +33 -0
  24. package/node_modules/express/Readme.md +8 -5
  25. package/node_modules/express/lib/application.js +1 -1
  26. package/node_modules/express/lib/request.js +1 -1
  27. package/node_modules/express/lib/response.js +16 -11
  28. package/node_modules/express/lib/router/index.js +6 -0
  29. package/node_modules/express/lib/utils.js +2 -6
  30. package/node_modules/express/node_modules/safe-buffer/LICENSE +21 -0
  31. package/node_modules/express/node_modules/safe-buffer/README.md +584 -0
  32. package/node_modules/express/node_modules/safe-buffer/index.d.ts +187 -0
  33. package/node_modules/express/node_modules/safe-buffer/index.js +65 -0
  34. package/node_modules/express/node_modules/safe-buffer/package.json +76 -0
  35. package/node_modules/express/package.json +37 -39
  36. package/node_modules/faye-websocket/CHANGELOG.md +5 -0
  37. package/node_modules/faye-websocket/LICENSE.md +1 -1
  38. package/node_modules/faye-websocket/README.md +13 -13
  39. package/node_modules/faye-websocket/lib/faye/websocket/api.js +10 -8
  40. package/node_modules/faye-websocket/lib/faye/websocket/client.js +4 -4
  41. package/node_modules/faye-websocket/lib/faye/websocket.js +1 -1
  42. package/node_modules/faye-websocket/package.json +16 -19
  43. package/node_modules/forwarded/HISTORY.md +5 -0
  44. package/node_modules/forwarded/README.md +3 -3
  45. package/node_modules/forwarded/index.js +15 -1
  46. package/node_modules/forwarded/package.json +27 -28
  47. package/node_modules/http-errors/HISTORY.md +16 -0
  48. package/node_modules/http-errors/README.md +12 -6
  49. package/node_modules/http-errors/index.js +35 -2
  50. package/node_modules/http-errors/package.json +32 -35
  51. package/node_modules/inherits/inherits.js +2 -0
  52. package/node_modules/inherits/inherits_browser.js +18 -14
  53. package/node_modules/inherits/package.json +17 -20
  54. package/node_modules/ipaddr.js/README.md +1 -1
  55. package/node_modules/ipaddr.js/lib/ipaddr.js.d.ts +6 -9
  56. package/node_modules/ipaddr.js/package.json +17 -19
  57. package/node_modules/proxy-addr/HISTORY.md +11 -0
  58. package/node_modules/proxy-addr/README.md +3 -19
  59. package/node_modules/proxy-addr/index.js +1 -1
  60. package/node_modules/proxy-addr/package.json +30 -33
  61. package/node_modules/qs/.editorconfig +9 -0
  62. package/node_modules/qs/.eslintignore +2 -1
  63. package/node_modules/qs/.eslintrc +15 -1
  64. package/node_modules/qs/.github/FUNDING.yml +12 -0
  65. package/node_modules/qs/.nycrc +13 -0
  66. package/node_modules/qs/CHANGELOG.md +103 -0
  67. package/node_modules/qs/LICENSE.md +29 -0
  68. package/node_modules/qs/README.md +34 -0
  69. package/node_modules/qs/dist/qs.js +117 -67
  70. package/node_modules/qs/lib/formats.js +9 -4
  71. package/node_modules/qs/lib/parse.js +29 -14
  72. package/node_modules/qs/lib/stringify.js +55 -46
  73. package/node_modules/qs/lib/utils.js +23 -2
  74. package/node_modules/qs/package.json +42 -34
  75. package/node_modules/qs/test/parse.js +97 -1
  76. package/node_modules/qs/test/stringify.js +115 -1
  77. package/node_modules/qs/test/utils.js +1 -1
  78. package/node_modules/raw-body/HISTORY.md +14 -0
  79. package/node_modules/raw-body/README.md +3 -5
  80. package/node_modules/raw-body/node_modules/bytes/History.md +5 -0
  81. package/node_modules/raw-body/node_modules/bytes/Readme.md +42 -16
  82. package/node_modules/raw-body/node_modules/bytes/index.js +5 -1
  83. package/node_modules/raw-body/node_modules/bytes/package.json +20 -22
  84. package/node_modules/raw-body/package.json +32 -35
  85. package/node_modules/send/HISTORY.md +10 -0
  86. package/node_modules/send/README.md +4 -6
  87. package/node_modules/send/index.js +7 -3
  88. package/node_modules/send/node_modules/ms/index.js +3 -3
  89. package/node_modules/send/node_modules/ms/license.md +1 -1
  90. package/node_modules/send/node_modules/ms/package.json +21 -23
  91. package/node_modules/send/node_modules/ms/readme.md +1 -2
  92. package/node_modules/send/package.json +31 -34
  93. package/node_modules/serve-static/HISTORY.md +8 -0
  94. package/node_modules/serve-static/README.md +9 -11
  95. package/node_modules/serve-static/package.json +30 -33
  96. package/node_modules/setprototypeof/README.md +1 -1
  97. package/node_modules/setprototypeof/index.js +1 -1
  98. package/node_modules/setprototypeof/package.json +20 -21
  99. package/node_modules/sockjs/Changelog +12 -0
  100. package/node_modules/sockjs/lib/transport.js +1 -1
  101. package/node_modules/sockjs/package.json +16 -19
  102. package/node_modules/toidentifier/HISTORY.md +9 -0
  103. package/node_modules/toidentifier/README.md +3 -3
  104. package/node_modules/toidentifier/index.js +2 -0
  105. package/node_modules/toidentifier/package.json +30 -29
  106. package/node_modules/uuid/CHANGELOG.md +154 -44
  107. package/node_modules/uuid/CONTRIBUTING.md +18 -0
  108. package/node_modules/uuid/LICENSE.md +4 -16
  109. package/node_modules/uuid/README.md +384 -155
  110. package/node_modules/uuid/dist/bin/uuid +2 -0
  111. package/node_modules/uuid/dist/esm-browser/index.js +9 -0
  112. package/node_modules/uuid/{lib/md5-browser.js → dist/esm-browser/md5.js} +70 -71
  113. package/node_modules/uuid/dist/esm-browser/nil.js +1 -0
  114. package/node_modules/uuid/dist/esm-browser/parse.js +35 -0
  115. package/node_modules/uuid/dist/esm-browser/regex.js +1 -0
  116. package/node_modules/uuid/dist/esm-browser/rng.js +19 -0
  117. package/node_modules/uuid/dist/esm-browser/sha1.js +96 -0
  118. package/node_modules/uuid/dist/esm-browser/stringify.js +30 -0
  119. package/node_modules/uuid/{v1.js → dist/esm-browser/v1.js} +36 -50
  120. package/node_modules/uuid/dist/esm-browser/v3.js +4 -0
  121. package/node_modules/uuid/dist/esm-browser/v35.js +64 -0
  122. package/node_modules/uuid/dist/esm-browser/v4.js +24 -0
  123. package/node_modules/uuid/dist/esm-browser/v5.js +4 -0
  124. package/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  125. package/node_modules/uuid/dist/esm-browser/version.js +11 -0
  126. package/node_modules/uuid/dist/esm-node/index.js +9 -0
  127. package/node_modules/uuid/dist/esm-node/md5.js +13 -0
  128. package/node_modules/uuid/dist/esm-node/nil.js +1 -0
  129. package/node_modules/uuid/dist/esm-node/parse.js +35 -0
  130. package/node_modules/uuid/dist/esm-node/regex.js +1 -0
  131. package/node_modules/uuid/dist/esm-node/rng.js +12 -0
  132. package/node_modules/uuid/dist/esm-node/sha1.js +13 -0
  133. package/node_modules/uuid/dist/esm-node/stringify.js +29 -0
  134. package/node_modules/uuid/dist/esm-node/v1.js +95 -0
  135. package/node_modules/uuid/dist/esm-node/v3.js +4 -0
  136. package/node_modules/uuid/dist/esm-node/v35.js +64 -0
  137. package/node_modules/uuid/dist/esm-node/v4.js +24 -0
  138. package/node_modules/uuid/dist/esm-node/v5.js +4 -0
  139. package/node_modules/uuid/dist/esm-node/validate.js +7 -0
  140. package/node_modules/uuid/dist/esm-node/version.js +11 -0
  141. package/node_modules/uuid/dist/index.js +79 -0
  142. package/node_modules/uuid/dist/md5-browser.js +223 -0
  143. package/node_modules/uuid/dist/md5.js +23 -0
  144. package/node_modules/uuid/dist/nil.js +8 -0
  145. package/node_modules/uuid/dist/parse.js +45 -0
  146. package/node_modules/uuid/dist/regex.js +8 -0
  147. package/node_modules/uuid/dist/rng-browser.js +26 -0
  148. package/node_modules/uuid/dist/rng.js +24 -0
  149. package/node_modules/uuid/dist/sha1-browser.js +104 -0
  150. package/node_modules/uuid/dist/sha1.js +23 -0
  151. package/node_modules/uuid/dist/stringify.js +39 -0
  152. package/node_modules/uuid/dist/umd/uuid.min.js +1 -0
  153. package/node_modules/uuid/dist/umd/uuidNIL.min.js +1 -0
  154. package/node_modules/uuid/dist/umd/uuidParse.min.js +1 -0
  155. package/node_modules/uuid/dist/umd/uuidStringify.min.js +1 -0
  156. package/node_modules/uuid/dist/umd/uuidValidate.min.js +1 -0
  157. package/node_modules/uuid/dist/umd/uuidVersion.min.js +1 -0
  158. package/node_modules/uuid/dist/umd/uuidv1.min.js +1 -0
  159. package/node_modules/uuid/dist/umd/uuidv3.min.js +1 -0
  160. package/node_modules/uuid/dist/umd/uuidv4.min.js +1 -0
  161. package/node_modules/uuid/dist/umd/uuidv5.min.js +1 -0
  162. package/node_modules/uuid/dist/uuid-bin.js +85 -0
  163. package/node_modules/uuid/dist/v1.js +107 -0
  164. package/node_modules/uuid/dist/v3.js +16 -0
  165. package/node_modules/uuid/dist/v35.js +78 -0
  166. package/node_modules/uuid/dist/v4.js +37 -0
  167. package/node_modules/uuid/dist/v5.js +16 -0
  168. package/node_modules/uuid/dist/validate.js +17 -0
  169. package/node_modules/uuid/dist/version.js +21 -0
  170. package/node_modules/uuid/package.json +118 -57
  171. package/node_modules/uuid/wrapper.mjs +10 -0
  172. package/node_modules/websocket-driver/node_modules/http-parser-js/package.json +4 -4
  173. package/package.json +3 -3
  174. package/worldmap/css/worldmap.css +7 -5
  175. package/worldmap/index.html +1 -0
  176. package/worldmap/leaflet/leaflet-arc.min.js +1 -0
  177. package/worldmap/worldmap.js +44 -27
  178. package/worldmap.html +1 -1
  179. package/worldmap.js +2 -2
  180. package/node_modules/qs/LICENSE +0 -28
  181. package/node_modules/qs/test/.eslintrc +0 -17
  182. package/node_modules/qs/test/index.js +0 -7
  183. package/node_modules/uuid/AUTHORS +0 -5
  184. package/node_modules/uuid/bin/uuid +0 -65
  185. package/node_modules/uuid/index.js +0 -8
  186. package/node_modules/uuid/lib/bytesToUuid.js +0 -26
  187. package/node_modules/uuid/lib/md5.js +0 -25
  188. package/node_modules/uuid/lib/rng-browser.js +0 -34
  189. package/node_modules/uuid/lib/rng.js +0 -8
  190. package/node_modules/uuid/lib/sha1-browser.js +0 -89
  191. package/node_modules/uuid/lib/sha1.js +0 -25
  192. package/node_modules/uuid/lib/v35.js +0 -57
  193. package/node_modules/uuid/v3.js +0 -4
  194. package/node_modules/uuid/v4.js +0 -29
  195. package/node_modules/uuid/v5.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,11 +1,15 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v2.24.3 - Fix geojson incorrect fill.
4
+ - v2.24.2 - Changes to drawing colours to be more visible.
5
+ - v2.24.1 - Fix ellipse accuracy.
6
+ - v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193
3
7
  - v2.23.5 - Fix addtoheatmap. Issue #192
4
8
  - v2.23.4 - Fix opacity of area borders
5
9
  - v2.23.3 - Fix initial load of maps
6
10
  - v2.23.2 - Add convex-hull example
7
11
  - v2.23.1 - Fix saving of custom map layer
8
- - v2.23.0 - Give logo and id so it can be overridden by toplogo command. PR #188.
12
+ - v2.23.0 - Give logo an id so it can be overridden by toplogo command. PR #188.
9
13
 
10
14
  - v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island.
11
15
  - v2.22.2 - Be more tolerant of speed string types
package/README.md CHANGED
@@ -11,12 +11,16 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.24.3 - Fix geojson incorrect fill.
15
+ - v2.24.2 - Changes to drawing colours to be more visible.
16
+ - v2.24.1 - Fix ellipse accuracy
17
+ - v2.24.0 - Add greatcircle option, fix non default httpRoot. Issue #193
14
18
  - v2.23.5 - Fix addtoheatmap. Issue #192
15
19
  - v2.23.4 - Fix opacity of area borders
16
20
  - v2.23.3 - Fix initial load of maps
17
21
  - v2.23.2 - Add convex-hull example
18
22
  - v2.23.1 - Fix saving of custom map layer
19
- - v2.23.0 - Give logo and id so it can be overridden by toplogo command. PR #188.
23
+ - v2.23.0 - Give logo an id so it can be overridden by toplogo command. PR #188.
20
24
  - v2.22.3 - Don't show empty popup for geojson object. Issue #186. Add wobble to null island.
21
25
  - v2.22.2 - Be more tolerant of speed string types
22
26
  - v2.22.0 - Separate out layer events in worldmap in
@@ -118,7 +122,7 @@ SIDC codes can be generated using the online tool - https://spatialillusions.com
118
122
 
119
123
  There are lots of extra options you can specify as `msg.payload.options` - see the <a href="https://spatialillusions.com/milsymbol/documentation.html" target="mapinfo">milsymbol docs here</a>.
120
124
 
121
- ### Areas, Lines and Rectangles
125
+ ### Areas, Rectangles, Lines, and GreatCircles
122
126
 
123
127
  If the msg.payload contains an **area** property - that is an array of co-ordinates, e.g.
124
128
 
@@ -130,6 +134,11 @@ elements, then it assumes this is a bounding box for a rectangle and draws a rec
130
134
  Likewise if it contains a **line** property it will draw the polyline.
131
135
  If the payload also includes a property `fit:true` the map will zoom to fit the line or area.
132
136
 
137
+ Finally if a **greatcircle** property is set containing an array of two coordinates then an arc
138
+ following the great circle between the two co-ordinates is plotted.
139
+
140
+ msg.payload = {name:"GC1", color:"#ff00ff", greatcircle:[ [51.464,0], [25.76,-80.18] ] }
141
+
133
142
  There are extra optional properties you can specify - see Options below.
134
143
 
135
144
 
@@ -1,3 +1,18 @@
1
+ 1.19.1 / 2021-12-10
2
+ ===================
3
+
4
+ * deps: bytes@3.1.1
5
+ * deps: http-errors@1.8.1
6
+ - deps: inherits@2.0.4
7
+ - deps: toidentifier@1.0.1
8
+ - deps: setprototypeof@1.2.0
9
+ * deps: qs@6.9.6
10
+ * deps: raw-body@2.4.2
11
+ - deps: bytes@3.1.1
12
+ - deps: http-errors@1.8.1
13
+ * deps: safe-buffer@5.2.1
14
+ * deps: type-is@~1.6.18
15
+
1
16
  1.19.0 / 2019-04-25
2
17
  ===================
3
18
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![NPM Version][npm-image]][npm-url]
4
4
  [![NPM Downloads][downloads-image]][downloads-url]
5
- [![Build Status][travis-image]][travis-url]
5
+ [![Build Status][github-actions-ci-image]][github-actions-ci-url]
6
6
  [![Test Coverage][coveralls-image]][coveralls-url]
7
7
 
8
8
  Node.js body parsing middleware.
@@ -49,8 +49,6 @@ $ npm install body-parser
49
49
 
50
50
  ## API
51
51
 
52
- <!-- eslint-disable no-unused-vars -->
53
-
54
52
  ```js
55
53
  var bodyParser = require('body-parser')
56
54
  ```
@@ -281,14 +279,15 @@ encoding of the request. The parsing can be aborted by throwing an error.
281
279
 
282
280
  ## Errors
283
281
 
284
- The middlewares provided by this module create errors depending on the error
285
- condition during parsing. The errors will typically have a `status`/`statusCode`
286
- property that contains the suggested HTTP response code, an `expose` property
287
- to determine if the `message` property should be displayed to the client, a
288
- `type` property to determine the type of error without matching against the
289
- `message`, and a `body` property containing the read body, if available.
282
+ The middlewares provided by this module create errors using the
283
+ [`http-errors` module](https://www.npmjs.com/package/http-errors). The errors
284
+ will typically have a `status`/`statusCode` property that contains the suggested
285
+ HTTP response code, an `expose` property to determine if the `message` property
286
+ should be displayed to the client, a `type` property to determine the type of
287
+ error without matching against the `message`, and a `body` property containing
288
+ the read body, if available.
290
289
 
291
- The following are the common errors emitted, though any error can come through
290
+ The following are the common errors created, though any error can come through
292
291
  for various reasons.
293
292
 
294
293
  ### content encoding unsupported
@@ -299,6 +298,20 @@ contained an encoding but the "inflation" option was set to `false`. The
299
298
  `'encoding.unsupported'`, and the `charset` property will be set to the
300
299
  encoding that is unsupported.
301
300
 
301
+ ### entity parse failed
302
+
303
+ This error will occur when the request contained an entity that could not be
304
+ parsed by the middleware. The `status` property is set to `400`, the `type`
305
+ property is set to `'entity.parse.failed'`, and the `body` property is set to
306
+ the entity value that failed parsing.
307
+
308
+ ### entity verify failed
309
+
310
+ This error will occur when the request contained an entity that could not be
311
+ failed verification by the defined `verify` option. The `status` property is
312
+ set to `403`, the `type` property is set to `'entity.verify.failed'`, and the
313
+ `body` property is set to the entity value that failed verification.
314
+
302
315
  ### request aborted
303
316
 
304
317
  This error will occur when the request is aborted by the client before reading
@@ -435,9 +448,9 @@ app.use(bodyParser.text({ type: 'text/html' }))
435
448
 
436
449
  [npm-image]: https://img.shields.io/npm/v/body-parser.svg
437
450
  [npm-url]: https://npmjs.org/package/body-parser
438
- [travis-image]: https://img.shields.io/travis/expressjs/body-parser/master.svg
439
- [travis-url]: https://travis-ci.org/expressjs/body-parser
440
451
  [coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg
441
452
  [coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master
442
453
  [downloads-image]: https://img.shields.io/npm/dm/body-parser.svg
443
454
  [downloads-url]: https://npmjs.org/package/body-parser
455
+ [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
@@ -1,3 +1,8 @@
1
+ 3.1.1 / 2021-11-15
2
+ ==================
3
+
4
+ * Fix "thousandsSeparator" incorrecting formatting fractional part
5
+
1
6
  3.1.0 / 2019-01-22
2
7
  ==================
3
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![NPM Version][npm-image]][npm-url]
4
4
  [![NPM Downloads][downloads-image]][downloads-url]
5
- [![Build Status][travis-image]][travis-url]
5
+ [![Build Status][ci-image]][ci-url]
6
6
  [![Test Coverage][coveralls-image]][coveralls-url]
7
7
 
8
8
  Utility to parse a string bytes (ex: `1TB`) to bytes (`1099511627776`) and vice-versa.
@@ -23,6 +23,33 @@ $ npm install bytes
23
23
  var bytes = require('bytes');
24
24
  ```
25
25
 
26
+ #### bytes(number|string value, [options]): number|string|null
27
+
28
+ Default export function. Delegates to either `bytes.format` or `bytes.parse` based on the type of `value`.
29
+
30
+ **Arguments**
31
+
32
+ | Name | Type | Description |
33
+ |---------|----------|--------------------|
34
+ | value | `number`|`string` | Number value to format or string value to parse |
35
+ | options | `Object` | Conversion options for `format` |
36
+
37
+ **Returns**
38
+
39
+ | Name | Type | Description |
40
+ |---------|------------------|-------------------------------------------------|
41
+ | results | `string`|`number`|`null` | Return null upon error. Numeric value in bytes, or string value otherwise. |
42
+
43
+ **Example**
44
+
45
+ ```js
46
+ bytes(1024);
47
+ // output: '1KB'
48
+
49
+ bytes('1KB');
50
+ // output: 1024
51
+ ```
52
+
26
53
  #### bytes.format(number value, [options]): string|null
27
54
 
28
55
  Format the given value in bytes into a string. If the value is negative, it is kept as such. If it is a float, it is
@@ -41,7 +68,7 @@ Format the given value in bytes into a string. If the value is negative, it is k
41
68
  |-------------------|--------|-----------------------------------------------------------------------------------------|
42
69
  | decimalPlaces | `number`|`null` | Maximum number of decimal places to include in output. Default value to `2`. |
43
70
  | fixedDecimals | `boolean`|`null` | Whether to always display the maximum number of decimal places. Default value to `false` |
44
- | thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `.`... Default value to `''`. |
71
+ | thousandsSeparator | `string`|`null` | Example of values: `' '`, `','` and `'.'`... Default value to `''`. |
45
72
  | unit | `string`|`null` | The unit in which the result will be returned (B/KB/MB/GB/TB). Default value to `''` (which means auto detect). |
46
73
  | unitSeparator | `string`|`null` | Separator to use between number and unit. Default value to `''`. |
47
74
 
@@ -54,21 +81,20 @@ Format the given value in bytes into a string. If the value is negative, it is k
54
81
  **Example**
55
82
 
56
83
  ```js
57
- bytes(1024);
84
+ bytes.format(1024);
58
85
  // output: '1KB'
59
86
 
60
- bytes(1000);
87
+ bytes.format(1000);
61
88
  // output: '1000B'
62
89
 
63
- bytes(1000, {thousandsSeparator: ' '});
90
+ bytes.format(1000, {thousandsSeparator: ' '});
64
91
  // output: '1 000B'
65
92
 
66
- bytes(1024 * 1.7, {decimalPlaces: 0});
93
+ bytes.format(1024 * 1.7, {decimalPlaces: 0});
67
94
  // output: '2KB'
68
95
 
69
- bytes(1024, {unitSeparator: ' '});
96
+ bytes.format(1024, {unitSeparator: ' '});
70
97
  // output: '1 KB'
71
-
72
98
  ```
73
99
 
74
100
  #### bytes.parse(string|number value): number|null
@@ -102,25 +128,25 @@ The units are in powers of two, not ten. This means 1kb = 1024b according to thi
102
128
  **Example**
103
129
 
104
130
  ```js
105
- bytes('1KB');
131
+ bytes.parse('1KB');
106
132
  // output: 1024
107
133
 
108
- bytes('1024');
134
+ bytes.parse('1024');
109
135
  // output: 1024
110
136
 
111
- bytes(1024);
112
- // output: 1KB
137
+ bytes.parse(1024);
138
+ // output: 1024
113
139
  ```
114
140
 
115
- ## License
141
+ ## License
116
142
 
117
143
  [MIT](LICENSE)
118
144
 
145
+ [ci-image]: https://badgen.net/github/checks/visionmedia/bytes.js/master?label=ci
146
+ [ci-url]: https://github.com/visionmedia/bytes.js/actions?query=workflow%3Aci
119
147
  [coveralls-image]: https://badgen.net/coveralls/c/github/visionmedia/bytes.js/master
120
148
  [coveralls-url]: https://coveralls.io/r/visionmedia/bytes.js?branch=master
121
149
  [downloads-image]: https://badgen.net/npm/dm/bytes
122
150
  [downloads-url]: https://npmjs.org/package/bytes
123
- [npm-image]: https://badgen.net/npm/node/bytes
151
+ [npm-image]: https://badgen.net/npm/v/bytes
124
152
  [npm-url]: https://npmjs.org/package/bytes
125
- [travis-image]: https://badgen.net/travis/visionmedia/bytes.js/master
126
- [travis-url]: https://travis-ci.org/visionmedia/bytes.js
@@ -117,7 +117,11 @@ function format(value, options) {
117
117
  }
118
118
 
119
119
  if (thousandsSeparator) {
120
- str = str.replace(formatThousandsRegExp, thousandsSeparator);
120
+ str = str.split('.').map(function (s, i) {
121
+ return i === 0
122
+ ? s.replace(formatThousandsRegExp, thousandsSeparator)
123
+ : s
124
+ }).join('.');
121
125
  }
122
126
 
123
127
  return str + unitSeparator + unit;
@@ -1,32 +1,27 @@
1
1
  {
2
- "_args": [
3
- [
4
- "bytes@3.1.0",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
- "_from": "bytes@3.1.0",
9
- "_id": "bytes@3.1.0",
2
+ "_from": "bytes@3.1.1",
3
+ "_id": "bytes@3.1.1",
10
4
  "_inBundle": false,
11
- "_integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==",
12
- "_location": "/body-parser/bytes",
5
+ "_integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==",
6
+ "_location": "/node-red-contrib-web-worldmap/body-parser/bytes",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
9
  "type": "version",
16
10
  "registry": true,
17
- "raw": "bytes@3.1.0",
11
+ "raw": "bytes@3.1.1",
18
12
  "name": "bytes",
19
13
  "escapedName": "bytes",
20
- "rawSpec": "3.1.0",
14
+ "rawSpec": "3.1.1",
21
15
  "saveSpec": null,
22
- "fetchSpec": "3.1.0"
16
+ "fetchSpec": "3.1.1"
23
17
  },
24
18
  "_requiredBy": [
25
- "/body-parser"
19
+ "/node-red-contrib-web-worldmap/body-parser"
26
20
  ],
27
- "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
28
- "_spec": "3.1.0",
29
- "_where": "/Users/conway/Projects/worldmap",
21
+ "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz",
22
+ "_shasum": "3f018291cb4cbad9accb6e6970bca9c8889e879a",
23
+ "_spec": "bytes@3.1.1",
24
+ "_where": "/Users/conway/Projects/worldmap/node_modules/body-parser",
30
25
  "author": {
31
26
  "name": "TJ Holowaychuk",
32
27
  "email": "tj@vision-media.ca",
@@ -35,6 +30,7 @@
35
30
  "bugs": {
36
31
  "url": "https://github.com/visionmedia/bytes.js/issues"
37
32
  },
33
+ "bundleDependencies": false,
38
34
  "contributors": [
39
35
  {
40
36
  "name": "Jed Watson",
@@ -45,11 +41,13 @@
45
41
  "email": "theo.fidry@gmail.com"
46
42
  }
47
43
  ],
44
+ "deprecated": false,
48
45
  "description": "Utility to parse a string bytes to bytes and vice-versa",
49
46
  "devDependencies": {
50
- "eslint": "5.12.1",
51
- "mocha": "5.2.0",
52
- "nyc": "13.1.0"
47
+ "eslint": "7.32.0",
48
+ "eslint-plugin-markdown": "2.2.1",
49
+ "mocha": "9.1.3",
50
+ "nyc": "15.1.0"
53
51
  },
54
52
  "engines": {
55
53
  "node": ">= 0.8"
@@ -79,8 +77,8 @@
79
77
  "scripts": {
80
78
  "lint": "eslint .",
81
79
  "test": "mocha --check-leaks --reporter spec",
82
- "test-ci": "nyc --reporter=text npm test",
80
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
83
81
  "test-cov": "nyc --reporter=html --reporter=text npm test"
84
82
  },
85
- "version": "3.1.0"
83
+ "version": "3.1.1"
86
84
  }
@@ -1,35 +1,31 @@
1
1
  {
2
- "_args": [
3
- [
4
- "body-parser@1.19.0",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
- "_from": "body-parser@1.19.0",
9
- "_id": "body-parser@1.19.0",
2
+ "_from": "body-parser@1.19.1",
3
+ "_id": "body-parser@1.19.1",
10
4
  "_inBundle": false,
11
- "_integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
12
- "_location": "/body-parser",
5
+ "_integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==",
6
+ "_location": "/node-red-contrib-web-worldmap/body-parser",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
9
  "type": "version",
16
10
  "registry": true,
17
- "raw": "body-parser@1.19.0",
11
+ "raw": "body-parser@1.19.1",
18
12
  "name": "body-parser",
19
13
  "escapedName": "body-parser",
20
- "rawSpec": "1.19.0",
14
+ "rawSpec": "1.19.1",
21
15
  "saveSpec": null,
22
- "fetchSpec": "1.19.0"
16
+ "fetchSpec": "1.19.1"
23
17
  },
24
18
  "_requiredBy": [
25
- "/express"
19
+ "/node-red-contrib-web-worldmap/express"
26
20
  ],
27
- "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
28
- "_spec": "1.19.0",
29
- "_where": "/Users/conway/Projects/worldmap",
21
+ "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz",
22
+ "_shasum": "1499abbaa9274af3ecc9f6f10396c995943e31d4",
23
+ "_spec": "body-parser@1.19.1",
24
+ "_where": "/Users/conway/Projects/worldmap/node_modules/express",
30
25
  "bugs": {
31
26
  "url": "https://github.com/expressjs/body-parser/issues"
32
27
  },
28
+ "bundleDependencies": false,
33
29
  "contributors": [
34
30
  {
35
31
  "name": "Douglas Christopher Wilson",
@@ -42,31 +38,32 @@
42
38
  }
43
39
  ],
44
40
  "dependencies": {
45
- "bytes": "3.1.0",
41
+ "bytes": "3.1.1",
46
42
  "content-type": "~1.0.4",
47
43
  "debug": "2.6.9",
48
44
  "depd": "~1.1.2",
49
- "http-errors": "1.7.2",
45
+ "http-errors": "1.8.1",
50
46
  "iconv-lite": "0.4.24",
51
47
  "on-finished": "~2.3.0",
52
- "qs": "6.7.0",
53
- "raw-body": "2.4.0",
54
- "type-is": "~1.6.17"
48
+ "qs": "6.9.6",
49
+ "raw-body": "2.4.2",
50
+ "type-is": "~1.6.18"
55
51
  },
52
+ "deprecated": false,
56
53
  "description": "Node.js body parsing middleware",
57
54
  "devDependencies": {
58
- "eslint": "5.16.0",
59
- "eslint-config-standard": "12.0.0",
60
- "eslint-plugin-import": "2.17.2",
61
- "eslint-plugin-markdown": "1.0.0",
62
- "eslint-plugin-node": "8.0.1",
63
- "eslint-plugin-promise": "4.1.1",
64
- "eslint-plugin-standard": "4.0.0",
65
- "istanbul": "0.4.5",
55
+ "eslint": "7.32.0",
56
+ "eslint-config-standard": "14.1.1",
57
+ "eslint-plugin-import": "2.25.3",
58
+ "eslint-plugin-markdown": "2.2.1",
59
+ "eslint-plugin-node": "11.1.0",
60
+ "eslint-plugin-promise": "5.2.0",
61
+ "eslint-plugin-standard": "4.1.0",
66
62
  "methods": "1.1.2",
67
- "mocha": "6.1.4",
68
- "safe-buffer": "5.1.2",
69
- "supertest": "4.0.2"
63
+ "mocha": "9.1.3",
64
+ "nyc": "15.1.0",
65
+ "safe-buffer": "5.2.1",
66
+ "supertest": "6.1.6"
70
67
  },
71
68
  "engines": {
72
69
  "node": ">= 0.8"
@@ -85,10 +82,10 @@
85
82
  "url": "git+https://github.com/expressjs/body-parser.git"
86
83
  },
87
84
  "scripts": {
88
- "lint": "eslint --plugin markdown --ext js,md .",
85
+ "lint": "eslint .",
89
86
  "test": "mocha --require test/support/env --reporter spec --check-leaks --bail test/",
90
- "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/",
91
- "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/"
87
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
88
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
92
89
  },
93
- "version": "1.19.0"
90
+ "version": "1.19.1"
94
91
  }
@@ -1,3 +1,8 @@
1
+ 0.5.4 / 2021-12-10
2
+ ==================
3
+
4
+ * deps: safe-buffer@5.2.1
5
+
1
6
  0.5.3 / 2018-12-17
2
7
  ==================
3
8
 
@@ -3,7 +3,7 @@
3
3
  [![NPM Version][npm-image]][npm-url]
4
4
  [![NPM Downloads][downloads-image]][downloads-url]
5
5
  [![Node.js Version][node-version-image]][node-version-url]
6
- [![Build Status][travis-image]][travis-url]
6
+ [![Build Status][github-actions-ci-image]][github-actions-ci-url]
7
7
  [![Test Coverage][coveralls-image]][coveralls-url]
8
8
 
9
9
  Create and parse HTTP `Content-Disposition` header
@@ -16,8 +16,6 @@ $ npm install content-disposition
16
16
 
17
17
  ## API
18
18
 
19
- <!-- eslint-disable no-unused-vars -->
20
-
21
19
  ```js
22
20
  var contentDisposition = require('content-disposition')
23
21
  ```
@@ -28,8 +26,6 @@ Create an attachment `Content-Disposition` header value using the given file nam
28
26
  if supplied. The `filename` is optional and if no file name is desired, but you
29
27
  want to specify `options`, set `filename` to `undefined`.
30
28
 
31
- <!-- eslint-disable no-undef -->
32
-
33
29
  ```js
34
30
  res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf'))
35
31
  ```
@@ -70,8 +66,6 @@ it). The type is normalized to lower-case.
70
66
 
71
67
  ### contentDisposition.parse(string)
72
68
 
73
- <!-- eslint-disable no-undef, no-unused-vars -->
74
-
75
69
  ```js
76
70
  var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt')
77
71
  ```
@@ -140,9 +134,9 @@ $ npm test
140
134
  [npm-url]: https://npmjs.org/package/content-disposition
141
135
  [node-version-image]: https://img.shields.io/node/v/content-disposition.svg
142
136
  [node-version-url]: https://nodejs.org/en/download
143
- [travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg
144
- [travis-url]: https://travis-ci.org/jshttp/content-disposition
145
137
  [coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg
146
138
  [coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master
147
139
  [downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg
148
140
  [downloads-url]: https://npmjs.org/package/content-disposition
141
+ [github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/content-disposition/ci/master?label=ci
142
+ [github-actions-ci-url]: https://github.com/jshttp/content-disposition?query=workflow%3Aci
@@ -255,7 +255,7 @@ function format (obj) {
255
255
  }
256
256
 
257
257
  /**
258
- * Decode a RFC 6987 field value (gracefully).
258
+ * Decode a RFC 5987 field value (gracefully).
259
259
  *
260
260
  * @param {string} str
261
261
  * @return {string}
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Feross Aboukhadijeh
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
13
+ all 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
21
+ THE SOFTWARE.