node-red-contrib-web-worldmap 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v5.3.0 - Let msg.payload.popupOptions object set Leaflet popup options so it can be customised. Issue #311
3
4
  - v5.2.0 - Allow left click send back co-ords. Let Button be replaceable more easily and take value property. Issue #308 and #309
4
5
  - v5.1.6 - Let Cot __milsym set the SIDC if present.
5
6
  - v5.1.5 - Fix links to SIDC unitgenerator so it is now local.
package/README.md CHANGED
@@ -13,6 +13,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
13
13
 
14
14
  ### Updates
15
15
 
16
+ - v5.3.0 - Let msg.payload.popupOptions object set Leaflet popup options so it can be customised. Issue #311
16
17
  - v5.2.0 - Allow left click send back co-ords. Let Button be replaceable more easily and take value property. Issue #308 and #309
17
18
  - v5.1.6 - Let Cot __milsym set the SIDC if present.
18
19
  - v5.1.5 - Fix links to SIDC unitgenerator so it is now local.
@@ -28,8 +29,7 @@ Feel free to [![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%
28
29
  - v5.0.3 - Add great context menu example flow. PR #290. Bump express lib. PR #291.
29
30
  - v5.0.2 - Fix sidcEdgeIcon docs PR #289.
30
31
  - v5.0.1 - Fix isArray error PR #288.
31
- - v5.0.0 - v5.0.0 - Feedback cleanup PR #281, edgeicons option PR #287, bump libs for vuln fixes.
32
-
32
+ - v5.0.0 - Feedback cleanup PR #281, edgeicons option PR #287, bump libs for vuln fixes.
33
33
 
34
34
  - see [CHANGELOG](https://github.com/dceejay/RedMap/blob/master/CHANGELOG.md) for full list of changes.
35
35
 
@@ -77,6 +77,7 @@ Optional properties for **msg.payload** include
77
77
  - **clickable** : Default true. Setting to false disables showing any popup.
78
78
  - **popped** : set to true to automatically open the popup info box, set to false to close it.
79
79
  - **popup** : html to fill the popup if you don't want the automatic default of the properties list. Using this overrides photourl, videourl and weblink options.
80
+ - **popupOptions** : optional object to help style the popup - See Leaflet popup docs for options - eg to add a custom class - `{className:"mySpecialPopup",width:600}`
80
81
  - **label** : displays the contents as a permanent label next to the marker, or
81
82
  - **tooltip** : displays the contents when you hover over the marker. (Mutually exclusive with label. Label has priority)
82
83
  - **tooltipOptions** : custom tooltip/label options (offset, direction, permanent, sticky, interactive, opacity, className) )
@@ -1,3 +1,9 @@
1
+ 1.8.1 / 2025-07-17
2
+ ==========
3
+
4
+ * deps: on-headers@~1.1.0
5
+ - Fix [CVE-2025-7339](https://www.cve.org/CVERecord?id=CVE-2025-7339) ([GHSA-76c9-3jph-rj3q](https://github.com/expressjs/on-headers/security/advisories/GHSA-76c9-3jph-rj3q))
6
+
1
7
  1.8.0 / 2025-02-10
2
8
  ==================
3
9
 
@@ -46,7 +46,7 @@ as compressing will transform the body.
46
46
  #### Options
47
47
 
48
48
  `compression()` accepts these properties in the options object. In addition to
49
- those listed below, [zlib](http://nodejs.org/api/zlib.html) options may be
49
+ those listed below, [zlib](https://nodejs.org/api/zlib.html) options may be
50
50
  passed in to the options object or
51
51
  [brotli](https://nodejs.org/api/zlib.html#zlib_class_brotlioptions) options.
52
52
 
@@ -55,7 +55,7 @@ passed in to the options object or
55
55
  Type: `Number`<br>
56
56
  Default: `zlib.constants.Z_DEFAULT_CHUNK`, or `16384`.
57
57
 
58
- See [Node.js documentation](http://nodejs.org/api/zlib.html#zlib_memory_usage_tuning)
58
+ See [Node.js documentation](https://nodejs.org/api/zlib.html#zlib_memory_usage_tuning)
59
59
  regarding the usage.
60
60
 
61
61
  ##### filter
@@ -107,7 +107,7 @@ This specifies how much memory should be allocated for the internal compression
107
107
  state and is an integer in the range of `1` (minimum level) and `9` (maximum
108
108
  level).
109
109
 
110
- See [Node.js documentation](http://nodejs.org/api/zlib.html#zlib_memory_usage_tuning)
110
+ See [Node.js documentation](https://nodejs.org/api/zlib.html#zlib_memory_usage_tuning)
111
111
  regarding the usage.
112
112
 
113
113
  ##### brotli
@@ -161,7 +161,7 @@ set a `Content-Length` response header.
161
161
  Type: `Number`<br>
162
162
  Default: `zlib.constants.Z_DEFAULT_WINDOWBITS`, or `15`
163
163
 
164
- See [Node.js documentation](http://nodejs.org/api/zlib.html#zlib_memory_usage_tuning)
164
+ See [Node.js documentation](https://nodejs.org/api/zlib.html#zlib_memory_usage_tuning)
165
165
  regarding the usage.
166
166
 
167
167
  ##### enforceEncoding
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "compression",
3
3
  "description": "Node.js compression middleware",
4
- "version": "1.8.0",
4
+ "version": "1.8.1",
5
5
  "contributors": [
6
6
  "Douglas Christopher Wilson <doug@somethingdoug.com>",
7
7
  "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
@@ -14,7 +14,7 @@
14
14
  "compressible": "~2.0.18",
15
15
  "debug": "2.6.9",
16
16
  "negotiator": "~0.6.4",
17
- "on-headers": "~1.0.2",
17
+ "on-headers": "~1.1.0",
18
18
  "safe-buffer": "5.2.1",
19
19
  "vary": "~1.1.2"
20
20
  },
@@ -22,14 +22,14 @@
22
22
  "after": "0.8.2",
23
23
  "eslint": "7.32.0",
24
24
  "eslint-config-standard": "14.1.1",
25
- "eslint-plugin-import": "2.26.0",
25
+ "eslint-plugin-import": "2.32.0",
26
26
  "eslint-plugin-markdown": "2.2.1",
27
27
  "eslint-plugin-node": "11.1.0",
28
28
  "eslint-plugin-promise": "5.2.0",
29
29
  "eslint-plugin-standard": "4.1.0",
30
30
  "mocha": "9.2.2",
31
31
  "nyc": "15.1.0",
32
- "supertest": "6.2.3"
32
+ "supertest": "6.3.4"
33
33
  },
34
34
  "files": [
35
35
  "LICENSE",
@@ -1,3 +1,8 @@
1
+ 1.1.0 / 2025-07-17
2
+ ==================
3
+ * - Fix [CVE-2025-7339](https://www.cve.org/CVERecord?id=CVE-2025-7339) ([GHSA-76c9-3jph-rj3q](https://github.com/expressjs/multer/security/advisories/GHSA-76c9-3jph-rj3q))
4
+
5
+
1
6
  1.0.2 / 2019-02-21
2
7
  ==================
3
8
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![NPM Version][npm-version-image]][npm-url]
4
4
  [![NPM Downloads][npm-downloads-image]][npm-url]
5
- [![Node.js Version][node-version-image]][node-version-url]
6
- [![Build Status][travis-image]][travis-url]
7
- [![Test Coverage][coveralls-image]][coveralls-url]
5
+ [![Node.js Version][node-image]][node-url]
6
+ [![Build Status][ci-image]][ci-url]
7
+ [![Coverage Status][coveralls-image]][coveralls-url]
8
8
 
9
9
  Execute a listener when a response is about to write headers.
10
10
 
@@ -70,12 +70,12 @@ $ npm test
70
70
 
71
71
  [MIT](LICENSE)
72
72
 
73
+ [ci-image]: https://badgen.net/github/checks/jshttp/on-headers/master?label=ci
74
+ [ci-url]: https://github.com/jshttp/on-headers/actions/workflows/ci.yml
73
75
  [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/on-headers/master
74
76
  [coveralls-url]: https://coveralls.io/r/jshttp/on-headers?branch=master
75
- [node-version-image]: https://badgen.net/npm/node/on-headers
76
- [node-version-url]: https://nodejs.org/en/download
77
+ [node-image]: https://badgen.net/npm/node/on-headers
78
+ [node-url]: https://nodejs.org/en/download
77
79
  [npm-downloads-image]: https://badgen.net/npm/dm/on-headers
78
80
  [npm-url]: https://npmjs.org/package/on-headers
79
81
  [npm-version-image]: https://badgen.net/npm/v/on-headers
80
- [travis-image]: https://badgen.net/travis/jshttp/on-headers/master
81
- [travis-url]: https://travis-ci.org/jshttp/on-headers
@@ -13,6 +13,12 @@
13
13
 
14
14
  module.exports = onHeaders
15
15
 
16
+ var http = require('http')
17
+
18
+ // older node versions don't have appendHeader
19
+ var isAppendHeaderSupported = typeof http.ServerResponse.prototype.appendHeader === 'function'
20
+ var set1dArray = isAppendHeaderSupported ? set1dArrayWithAppend : set1dArrayWithSet
21
+
16
22
  /**
17
23
  * Create a replacement writeHead method.
18
24
  *
@@ -74,8 +80,16 @@ function onHeaders (res, listener) {
74
80
  */
75
81
 
76
82
  function setHeadersFromArray (res, headers) {
77
- for (var i = 0; i < headers.length; i++) {
78
- res.setHeader(headers[i][0], headers[i][1])
83
+ if (headers.length && Array.isArray(headers[0])) {
84
+ // 2D
85
+ set2dArray(res, headers)
86
+ } else {
87
+ // 1D
88
+ if (headers.length % 2 !== 0) {
89
+ throw new TypeError('headers array is malformed')
90
+ }
91
+
92
+ set1dArray(res, headers)
79
93
  }
80
94
  }
81
95
 
@@ -130,3 +144,37 @@ function setWriteHeadHeaders (statusCode) {
130
144
 
131
145
  return args
132
146
  }
147
+
148
+ function set2dArray (res, headers) {
149
+ var key
150
+ for (var i = 0; i < headers.length; i++) {
151
+ key = headers[i][0]
152
+ if (key) {
153
+ res.setHeader(key, headers[i][1])
154
+ }
155
+ }
156
+ }
157
+
158
+ function set1dArrayWithAppend (res, headers) {
159
+ for (var i = 0; i < headers.length; i += 2) {
160
+ res.removeHeader(headers[i])
161
+ }
162
+
163
+ var key
164
+ for (var j = 0; j < headers.length; j += 2) {
165
+ key = headers[j]
166
+ if (key) {
167
+ res.appendHeader(key, headers[j + 1])
168
+ }
169
+ }
170
+ }
171
+
172
+ function set1dArrayWithSet (res, headers) {
173
+ var key
174
+ for (var i = 0; i < headers.length; i += 2) {
175
+ key = headers[i]
176
+ if (key) {
177
+ res.setHeader(key, headers[i + 1])
178
+ }
179
+ }
180
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "on-headers",
3
3
  "description": "Execute a listener when a response is about to write headers",
4
- "version": "1.0.2",
4
+ "version": "1.1.0",
5
5
  "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
6
6
  "license": "MIT",
7
7
  "keywords": [
@@ -12,16 +12,16 @@
12
12
  ],
13
13
  "repository": "jshttp/on-headers",
14
14
  "devDependencies": {
15
- "eslint": "5.14.1",
16
- "eslint-config-standard": "12.0.0",
17
- "eslint-plugin-import": "2.16.0",
18
- "eslint-plugin-markdown": "1.0.0",
19
- "eslint-plugin-node": "8.0.1",
20
- "eslint-plugin-promise": "4.0.1",
21
- "eslint-plugin-standard": "4.0.0",
22
- "istanbul": "0.4.5",
23
- "mocha": "6.0.1",
24
- "supertest": "3.4.2"
15
+ "eslint": "6.8.0",
16
+ "eslint-config-standard": "14.1.1",
17
+ "eslint-plugin-import": "2.21.2",
18
+ "eslint-plugin-markdown": "1.0.2",
19
+ "eslint-plugin-node": "11.1.0",
20
+ "eslint-plugin-promise": "4.2.1",
21
+ "eslint-plugin-standard": "4.0.1",
22
+ "mocha": "10.2.0",
23
+ "nyc": "15.1.0",
24
+ "supertest": "4.0.2"
25
25
  },
26
26
  "files": [
27
27
  "LICENSE",
@@ -34,9 +34,11 @@
34
34
  },
35
35
  "scripts": {
36
36
  "lint": "eslint --plugin markdown --ext js,md .",
37
- "test": "mocha --reporter spec --bail --check-leaks test/",
38
- "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
39
- "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
37
+ "test": "mocha --reporter spec --check-leaks test/test.js",
38
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
39
+ "test-cov": "nyc --reporter=html --reporter=text npm test",
40
+ "update-upstream-hashes": "node scripts/update-upstream-hashes.js",
41
+ "upstream": "mocha --reporter spec --check-leaks test/upstream.js",
40
42
  "version": "node scripts/version-history.js && git add HISTORY.md"
41
43
  }
42
44
  }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "node-red-contrib-web-worldmap",
3
- "version": "5.2.0",
3
+ "version": "5.3.0",
4
4
  "description": "A Node-RED node to provide a web page of a world map for plotting things on.",
5
5
  "dependencies": {
6
6
  "@turf/bezier-spline": "~7.2.0",
7
7
  "cgi": "0.3.1",
8
- "compression": "^1.8.0",
8
+ "compression": "^1.8.1",
9
9
  "express": "^4.21.2",
10
10
  "sockjs": "~0.3.24"
11
11
  },
@@ -2358,31 +2358,37 @@ function setMarker(data) {
2358
2358
  if (data.hasOwnProperty("radius")) { delete data.radius; }
2359
2359
  if (data.hasOwnProperty("greatcircle")) { delete data.greatcircle; }
2360
2360
 
2361
- // then any remaining properties to the info box
2362
- var longline = 0;
2363
- if (data.popup) { words = data.popup; }
2364
- else {
2365
- words += '<table>';
2366
- for (var i in data) {
2367
- if ((i != "name") && (i != "length") && (i != "clickable")) {
2368
- if (typeof data[i] === "object") {
2369
- words += '<tr><td valign="top">'+ i +'</td><td>' + JSON.stringify(data[i]) + '</td></tr>';
2370
- }
2371
- else {
2372
- // words += i +" : "+data[i]+"<br/>";
2373
- if (data[i].length > longline) { longline = data[i].length; }
2374
- words += '<tr><td valign="top">'+ i +'</td><td>' + data[i] + '</td></tr>';
2361
+ if (!data.hasOwnProperty("clickable") && data.clickable != false) {
2362
+ var wopt = { autoClose:false, closeButton:true, closeOnClick:false, minWidth:200 };
2363
+ if (words.indexOf('<video ') >=0 || words.indexOf('<img ') >=0 ) { wopt.maxWidth="640"; } // make popup wider if it has an image or video
2364
+ if (data?.popupOptions) { // allow user to override popup options eg to add className
2365
+ wopt = data.popupOptions;
2366
+ delete data.popupOptions;
2367
+ }
2368
+
2369
+ // then any remaining properties to the info box
2370
+ var longline = 0;
2371
+ if (data.popup) { words = data.popup; }
2372
+ else {
2373
+ words += '<table>';
2374
+ for (var i in data) {
2375
+ if ((i != "name") && (i != "length") && (i != "clickable")) {
2376
+ if (typeof data[i] === "object") {
2377
+ words += '<tr><td valign="top">'+ i +'</td><td>' + JSON.stringify(data[i]) + '</td></tr>';
2378
+ }
2379
+ else {
2380
+ // words += i +" : "+data[i]+"<br/>";
2381
+ if (data[i].length > longline) { longline = data[i].length; }
2382
+ words += '<tr><td valign="top">'+ i +'</td><td>' + data[i] + '</td></tr>';
2383
+ }
2375
2384
  }
2376
2385
  }
2386
+ words += '<tr><td>lat, lon</td><td>'+ marker.getLatLng().toString().replace('LatLng(','').replace(')','') + '</td></tr>';
2387
+ words += '</table>';
2377
2388
  }
2378
- words += '<tr><td>lat, lon</td><td>'+ marker.getLatLng().toString().replace('LatLng(','').replace(')','') + '</td></tr>';
2379
- words += '</table>';
2380
- }
2381
- words = "<b>"+data["name"]+"</b><br/>" + words.replace(/\${name}/g,data["name"]); //"<button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
2382
- var wopt = {autoClose:false, closeButton:true, closeOnClick:false, minWidth:200};
2383
- if (words.indexOf('<video ') >=0 || words.indexOf('<img ') >=0 ) { wopt.maxWidth="640"; } // make popup wider if it has an image or video
2384
- if (longline > 100) { wopt.minWidth="640"; } // make popup wider if it has a long line
2385
- if (!data.hasOwnProperty("clickable") && data.clickable != false) {
2389
+ words = "<b>"+data["name"]+"</b><br/>" + words.replace(/\${name}/g,data["name"]); //"<button style=\"border-radius:4px; float:right; background-color:lightgrey;\" onclick='popped=false;popmark.closePopup();'>X</button><br/>" + words;
2390
+
2391
+ if (longline > 100) { wopt.minWidth="640"; } // make popup wider if it has a long line
2386
2392
  marker.bindPopup(words, wopt);
2387
2393
  marker._popup.dname = data["name"];
2388
2394
  }