node-red-contrib-web-worldmap 2.26.1 → 2.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +6 -0
  3. package/node_modules/accepts/HISTORY.md +7 -0
  4. package/node_modules/accepts/README.md +3 -5
  5. package/node_modules/accepts/package.json +31 -34
  6. package/node_modules/body-parser/HISTORY.md +9 -0
  7. package/node_modules/body-parser/node_modules/bytes/History.md +5 -0
  8. package/node_modules/body-parser/node_modules/bytes/index.js +4 -0
  9. package/node_modules/body-parser/node_modules/bytes/package.json +11 -11
  10. package/node_modules/body-parser/package.json +16 -16
  11. package/node_modules/compressible/HISTORY.md +7 -0
  12. package/node_modules/compressible/package.json +26 -29
  13. package/node_modules/cookie/HISTORY.md +6 -0
  14. package/node_modules/cookie/README.md +49 -20
  15. package/node_modules/cookie/index.js +11 -11
  16. package/node_modules/cookie/package.json +18 -16
  17. package/node_modules/express/History.md +15 -0
  18. package/node_modules/express/lib/response.js +1 -1
  19. package/node_modules/express/lib/utils.js +2 -1
  20. package/node_modules/express/package.json +16 -15
  21. package/node_modules/mime-db/HISTORY.md +82 -0
  22. package/node_modules/mime-db/README.md +15 -9
  23. package/node_modules/mime-db/db.json +689 -52
  24. package/node_modules/mime-db/package.json +29 -31
  25. package/node_modules/mime-types/HISTORY.md +82 -2
  26. package/node_modules/mime-types/README.md +8 -8
  27. package/node_modules/mime-types/package.json +29 -31
  28. package/node_modules/negotiator/HISTORY.md +5 -0
  29. package/node_modules/negotiator/README.md +3 -3
  30. package/node_modules/negotiator/index.js +4 -46
  31. package/node_modules/negotiator/lib/language.js +3 -3
  32. package/node_modules/negotiator/package.json +22 -25
  33. package/node_modules/qs/.editorconfig +1 -0
  34. package/node_modules/qs/.eslintrc +6 -3
  35. package/node_modules/qs/CHANGELOG.md +12 -0
  36. package/node_modules/qs/README.md +31 -19
  37. package/node_modules/qs/dist/qs.js +16 -6
  38. package/node_modules/qs/lib/parse.js +1 -1
  39. package/node_modules/qs/lib/stringify.js +14 -5
  40. package/node_modules/qs/lib/utils.js +1 -0
  41. package/node_modules/qs/package.json +22 -21
  42. package/node_modules/qs/test/parse.js +60 -0
  43. package/node_modules/qs/test/stringify.js +23 -12
  44. package/node_modules/raw-body/HISTORY.md +5 -0
  45. package/node_modules/raw-body/README.md +5 -3
  46. package/node_modules/raw-body/node_modules/bytes/History.md +5 -0
  47. package/node_modules/raw-body/node_modules/bytes/index.js +4 -0
  48. package/node_modules/raw-body/node_modules/bytes/package.json +11 -11
  49. package/node_modules/raw-body/package.json +14 -14
  50. package/package.json +1 -1
  51. package/worldmap/index.html +1 -0
  52. package/worldmap/index3d.html +2 -2
  53. package/worldmap/leaflet/leaflet.antimeridian-src.js +254 -0
  54. package/worldmap/worldmap.js +12 -7
  55. package/worldmap.html +2 -0
  56. package/worldmap.js +10 -0
  57. package/node_modules/qs/.eslintignore +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ### Change Log for Node-RED Worldmap
2
2
 
3
+ - v2.27.2 - Try to handle greatcircles crossing antimeridian
4
+ - v2.27.1 - Reload existing markers for late joiners
5
+ - v2.26.1 - Add QTH/Maidenhead option also
3
6
  - v2.26.0 - Add UTM and MGRS to coordinate display options.
4
7
  - v2.25.0 - Add bounds command to set overall map bounds.
5
8
  - v2.24.3 - Fix geojson incorrect fill.
package/README.md CHANGED
@@ -11,6 +11,9 @@ map web page for plotting "things" on.
11
11
 
12
12
  ### Updates
13
13
 
14
+ - v2.27.2 - Try to handle greatcircles crossing antimeridian
15
+ - v2.27.1 - Reload existing markers for late joiners
16
+ - v2.26.1 - Add QTH/Maidenhead option also
14
17
  - v2.26.0 - Add UTM and MGRS to coordinate display options.
15
18
  - v2.25.0 - Add bounds command to set overall map bounds.
16
19
  - v2.24.3 - Fix geojson incorrect fill.
@@ -141,6 +144,8 @@ following the great circle between the two co-ordinates is plotted.
141
144
 
142
145
  msg.payload = {name:"GC1", color:"#ff00ff", greatcircle:[ [51.464,0], [25.76,-80.18] ] }
143
146
 
147
+ Shapes can also have a **popup** property containing html, but you MUST also set a property `clickable:true` in order to allow it to be seen.
148
+
144
149
  There are extra optional properties you can specify - see Options below.
145
150
 
146
151
 
@@ -255,6 +260,7 @@ Areas, Rectangles, Lines, Circles and Ellipses can also specify more optional pr
255
260
 
256
261
  Other properties can be found in the leaflet documentation.
257
262
 
263
+ Shapes can also have a **popup** property containing html, but you MUST also set a property `clickable:true` in order to allow it to be seen.
258
264
 
259
265
  ### Drawing
260
266
 
@@ -1,3 +1,10 @@
1
+ 1.3.8 / 2022-02-02
2
+ ==================
3
+
4
+ * deps: mime-types@~2.1.34
5
+ - deps: mime-db@~1.51.0
6
+ * deps: negotiator@0.6.3
7
+
1
8
  1.3.7 / 2019-04-29
2
9
  ==================
3
10
 
@@ -3,7 +3,7 @@
3
3
  [![NPM Version][npm-version-image]][npm-url]
4
4
  [![NPM Downloads][npm-downloads-image]][npm-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
  Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
@@ -29,8 +29,6 @@ $ npm install accepts
29
29
 
30
30
  ## API
31
31
 
32
- <!-- eslint-disable no-unused-vars -->
33
-
34
32
  ```js
35
33
  var accepts = require('accepts')
36
34
  ```
@@ -133,10 +131,10 @@ curl -I -H'Accept: text/html' http://localhost:3000/
133
131
 
134
132
  [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
135
133
  [coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
134
+ [github-actions-ci-image]: https://badgen.net/github/checks/jshttp/accepts/master?label=ci
135
+ [github-actions-ci-url]: https://github.com/jshttp/accepts/actions/workflows/ci.yml
136
136
  [node-version-image]: https://badgen.net/npm/node/accepts
137
137
  [node-version-url]: https://nodejs.org/en/download
138
138
  [npm-downloads-image]: https://badgen.net/npm/dm/accepts
139
139
  [npm-url]: https://npmjs.org/package/accepts
140
140
  [npm-version-image]: https://badgen.net/npm/v/accepts
141
- [travis-image]: https://badgen.net/travis/jshttp/accepts/master
142
- [travis-url]: https://travis-ci.org/jshttp/accepts
@@ -1,36 +1,32 @@
1
1
  {
2
- "_args": [
3
- [
4
- "accepts@1.3.7",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
- "_from": "accepts@1.3.7",
9
- "_id": "accepts@1.3.7",
2
+ "_from": "accepts@~1.3.5",
3
+ "_id": "accepts@1.3.8",
10
4
  "_inBundle": false,
11
- "_integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
12
- "_location": "/accepts",
5
+ "_integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
6
+ "_location": "/node-red-contrib-web-worldmap/accepts",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
- "type": "version",
9
+ "type": "range",
16
10
  "registry": true,
17
- "raw": "accepts@1.3.7",
11
+ "raw": "accepts@~1.3.5",
18
12
  "name": "accepts",
19
13
  "escapedName": "accepts",
20
- "rawSpec": "1.3.7",
14
+ "rawSpec": "~1.3.5",
21
15
  "saveSpec": null,
22
- "fetchSpec": "1.3.7"
16
+ "fetchSpec": "~1.3.5"
23
17
  },
24
18
  "_requiredBy": [
25
- "/compression",
26
- "/express"
19
+ "/node-red-contrib-web-worldmap/compression",
20
+ "/node-red-contrib-web-worldmap/express"
27
21
  ],
28
- "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
29
- "_spec": "1.3.7",
30
- "_where": "/Users/conway/Projects/worldmap",
22
+ "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
23
+ "_shasum": "0bf0be125b67014adcb0b0921e62db7bffe16b2e",
24
+ "_spec": "accepts@~1.3.5",
25
+ "_where": "/Users/conway/Projects/worldmap/node_modules/compression",
31
26
  "bugs": {
32
27
  "url": "https://github.com/jshttp/accepts/issues"
33
28
  },
29
+ "bundleDependencies": false,
34
30
  "contributors": [
35
31
  {
36
32
  "name": "Douglas Christopher Wilson",
@@ -43,21 +39,22 @@
43
39
  }
44
40
  ],
45
41
  "dependencies": {
46
- "mime-types": "~2.1.24",
47
- "negotiator": "0.6.2"
42
+ "mime-types": "~2.1.34",
43
+ "negotiator": "0.6.3"
48
44
  },
45
+ "deprecated": false,
49
46
  "description": "Higher-level content negotiation",
50
47
  "devDependencies": {
51
48
  "deep-equal": "1.0.1",
52
- "eslint": "5.16.0",
53
- "eslint-config-standard": "12.0.0",
54
- "eslint-plugin-import": "2.17.2",
55
- "eslint-plugin-markdown": "1.0.0",
56
- "eslint-plugin-node": "8.0.1",
57
- "eslint-plugin-promise": "4.1.1",
58
- "eslint-plugin-standard": "4.0.0",
59
- "mocha": "6.1.4",
60
- "nyc": "14.0.0"
49
+ "eslint": "7.32.0",
50
+ "eslint-config-standard": "14.1.1",
51
+ "eslint-plugin-import": "2.25.4",
52
+ "eslint-plugin-markdown": "2.2.1",
53
+ "eslint-plugin-node": "11.1.0",
54
+ "eslint-plugin-promise": "4.3.1",
55
+ "eslint-plugin-standard": "4.1.0",
56
+ "mocha": "9.2.0",
57
+ "nyc": "15.1.0"
61
58
  },
62
59
  "engines": {
63
60
  "node": ">= 0.6"
@@ -81,10 +78,10 @@
81
78
  "url": "git+https://github.com/jshttp/accepts.git"
82
79
  },
83
80
  "scripts": {
84
- "lint": "eslint --plugin markdown --ext js,md .",
81
+ "lint": "eslint .",
85
82
  "test": "mocha --reporter spec --check-leaks --bail test/",
86
- "test-cov": "nyc --reporter=html --reporter=text npm test",
87
- "test-travis": "nyc --reporter=text npm test"
83
+ "test-ci": "nyc --reporter=lcov --reporter=text npm test",
84
+ "test-cov": "nyc --reporter=html --reporter=text npm test"
88
85
  },
89
- "version": "1.3.7"
86
+ "version": "1.3.8"
90
87
  }
@@ -1,3 +1,12 @@
1
+ 1.19.2 / 2022-02-15
2
+ ===================
3
+
4
+ * deps: bytes@3.1.2
5
+ * deps: qs@6.9.7
6
+ * Fix handling of `__proto__` keys
7
+ * deps: raw-body@2.4.3
8
+ - deps: bytes@3.1.2
9
+
1
10
  1.19.1 / 2021-12-10
2
11
  ===================
3
12
 
@@ -1,3 +1,8 @@
1
+ 3.1.2 / 2022-01-27
2
+ ==================
3
+
4
+ * Fix return value for un-parsable strings
5
+
1
6
  3.1.1 / 2021-11-15
2
7
  ==================
3
8
 
@@ -162,5 +162,9 @@ function parse(val) {
162
162
  unit = results[4].toLowerCase();
163
163
  }
164
164
 
165
+ if (isNaN(floatValue)) {
166
+ return null;
167
+ }
168
+
165
169
  return Math.floor(map[unit] * floatValue);
166
170
  }
@@ -1,26 +1,26 @@
1
1
  {
2
- "_from": "bytes@3.1.1",
3
- "_id": "bytes@3.1.1",
2
+ "_from": "bytes@3.1.2",
3
+ "_id": "bytes@3.1.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg==",
5
+ "_integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
6
6
  "_location": "/node-red-contrib-web-worldmap/body-parser/bytes",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "version",
10
10
  "registry": true,
11
- "raw": "bytes@3.1.1",
11
+ "raw": "bytes@3.1.2",
12
12
  "name": "bytes",
13
13
  "escapedName": "bytes",
14
- "rawSpec": "3.1.1",
14
+ "rawSpec": "3.1.2",
15
15
  "saveSpec": null,
16
- "fetchSpec": "3.1.1"
16
+ "fetchSpec": "3.1.2"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/node-red-contrib-web-worldmap/body-parser"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz",
22
- "_shasum": "3f018291cb4cbad9accb6e6970bca9c8889e879a",
23
- "_spec": "bytes@3.1.1",
21
+ "_resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
22
+ "_shasum": "8b0beeb98605adf1b128fa4386403c009e0221a5",
23
+ "_spec": "bytes@3.1.2",
24
24
  "_where": "/Users/conway/Projects/worldmap/node_modules/body-parser",
25
25
  "author": {
26
26
  "name": "TJ Holowaychuk",
@@ -46,7 +46,7 @@
46
46
  "devDependencies": {
47
47
  "eslint": "7.32.0",
48
48
  "eslint-plugin-markdown": "2.2.1",
49
- "mocha": "9.1.3",
49
+ "mocha": "9.2.0",
50
50
  "nyc": "15.1.0"
51
51
  },
52
52
  "engines": {
@@ -80,5 +80,5 @@
80
80
  "test-ci": "nyc --reporter=lcov --reporter=text npm test",
81
81
  "test-cov": "nyc --reporter=html --reporter=text npm test"
82
82
  },
83
- "version": "3.1.1"
83
+ "version": "3.1.2"
84
84
  }
@@ -1,26 +1,26 @@
1
1
  {
2
- "_from": "body-parser@1.19.1",
3
- "_id": "body-parser@1.19.1",
2
+ "_from": "body-parser@1.19.2",
3
+ "_id": "body-parser@1.19.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA==",
5
+ "_integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==",
6
6
  "_location": "/node-red-contrib-web-worldmap/body-parser",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
9
9
  "type": "version",
10
10
  "registry": true,
11
- "raw": "body-parser@1.19.1",
11
+ "raw": "body-parser@1.19.2",
12
12
  "name": "body-parser",
13
13
  "escapedName": "body-parser",
14
- "rawSpec": "1.19.1",
14
+ "rawSpec": "1.19.2",
15
15
  "saveSpec": null,
16
- "fetchSpec": "1.19.1"
16
+ "fetchSpec": "1.19.2"
17
17
  },
18
18
  "_requiredBy": [
19
19
  "/node-red-contrib-web-worldmap/express"
20
20
  ],
21
- "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz",
22
- "_shasum": "1499abbaa9274af3ecc9f6f10396c995943e31d4",
23
- "_spec": "body-parser@1.19.1",
21
+ "_resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz",
22
+ "_shasum": "4714ccd9c157d44797b8b5607d72c0b89952f26e",
23
+ "_spec": "body-parser@1.19.2",
24
24
  "_where": "/Users/conway/Projects/worldmap/node_modules/express",
25
25
  "bugs": {
26
26
  "url": "https://github.com/expressjs/body-parser/issues"
@@ -38,15 +38,15 @@
38
38
  }
39
39
  ],
40
40
  "dependencies": {
41
- "bytes": "3.1.1",
41
+ "bytes": "3.1.2",
42
42
  "content-type": "~1.0.4",
43
43
  "debug": "2.6.9",
44
44
  "depd": "~1.1.2",
45
45
  "http-errors": "1.8.1",
46
46
  "iconv-lite": "0.4.24",
47
47
  "on-finished": "~2.3.0",
48
- "qs": "6.9.6",
49
- "raw-body": "2.4.2",
48
+ "qs": "6.9.7",
49
+ "raw-body": "2.4.3",
50
50
  "type-is": "~1.6.18"
51
51
  },
52
52
  "deprecated": false,
@@ -54,16 +54,16 @@
54
54
  "devDependencies": {
55
55
  "eslint": "7.32.0",
56
56
  "eslint-config-standard": "14.1.1",
57
- "eslint-plugin-import": "2.25.3",
57
+ "eslint-plugin-import": "2.25.4",
58
58
  "eslint-plugin-markdown": "2.2.1",
59
59
  "eslint-plugin-node": "11.1.0",
60
60
  "eslint-plugin-promise": "5.2.0",
61
61
  "eslint-plugin-standard": "4.1.0",
62
62
  "methods": "1.1.2",
63
- "mocha": "9.1.3",
63
+ "mocha": "9.2.0",
64
64
  "nyc": "15.1.0",
65
65
  "safe-buffer": "5.2.1",
66
- "supertest": "6.1.6"
66
+ "supertest": "6.2.2"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">= 0.8"
@@ -87,5 +87,5 @@
87
87
  "test-ci": "nyc --reporter=lcov --reporter=text npm test",
88
88
  "test-cov": "nyc --reporter=html --reporter=text npm test"
89
89
  },
90
- "version": "1.19.1"
90
+ "version": "1.19.2"
91
91
  }
@@ -1,3 +1,10 @@
1
+ 2.0.18 / 2020-01-05
2
+ ===================
3
+
4
+ * deps: mime-db@'>= 1.43.0 < 2'
5
+ - Mark `font/ttf` as compressible
6
+ - Remove compressible from `multipart/mixed`
7
+
1
8
  2.0.17 / 2019-04-24
2
9
  ===================
3
10
 
@@ -1,35 +1,31 @@
1
1
  {
2
- "_args": [
3
- [
4
- "compressible@2.0.17",
5
- "/Users/conway/Projects/worldmap"
6
- ]
7
- ],
8
- "_from": "compressible@2.0.17",
9
- "_id": "compressible@2.0.17",
2
+ "_from": "compressible@~2.0.16",
3
+ "_id": "compressible@2.0.18",
10
4
  "_inBundle": false,
11
- "_integrity": "sha512-BGHeLCK1GV7j1bSmQQAi26X+GgWcTjLr/0tzSvMCl3LH1w1IJ4PFSPoV5316b30cneTziC+B1a+3OjoSUcQYmw==",
12
- "_location": "/compressible",
5
+ "_integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==",
6
+ "_location": "/node-red-contrib-web-worldmap/compressible",
13
7
  "_phantomChildren": {},
14
8
  "_requested": {
15
- "type": "version",
9
+ "type": "range",
16
10
  "registry": true,
17
- "raw": "compressible@2.0.17",
11
+ "raw": "compressible@~2.0.16",
18
12
  "name": "compressible",
19
13
  "escapedName": "compressible",
20
- "rawSpec": "2.0.17",
14
+ "rawSpec": "~2.0.16",
21
15
  "saveSpec": null,
22
- "fetchSpec": "2.0.17"
16
+ "fetchSpec": "~2.0.16"
23
17
  },
24
18
  "_requiredBy": [
25
- "/compression"
19
+ "/node-red-contrib-web-worldmap/compression"
26
20
  ],
27
- "_resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz",
28
- "_spec": "2.0.17",
29
- "_where": "/Users/conway/Projects/worldmap",
21
+ "_resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz",
22
+ "_shasum": "af53cca6b070d4c3c0750fbd77286a6d7cc46fba",
23
+ "_spec": "compressible@~2.0.16",
24
+ "_where": "/Users/conway/Projects/worldmap/node_modules/compression",
30
25
  "bugs": {
31
26
  "url": "https://github.com/jshttp/compressible/issues"
32
27
  },
28
+ "bundleDependencies": false,
33
29
  "contributors": [
34
30
  {
35
31
  "name": "Douglas Christopher Wilson",
@@ -47,19 +43,20 @@
47
43
  }
48
44
  ],
49
45
  "dependencies": {
50
- "mime-db": ">= 1.40.0 < 2"
46
+ "mime-db": ">= 1.43.0 < 2"
51
47
  },
48
+ "deprecated": false,
52
49
  "description": "Compressible Content-Type / mime checking",
53
50
  "devDependencies": {
54
- "eslint": "5.15.2",
55
- "eslint-config-standard": "12.0.0",
56
- "eslint-plugin-import": "2.16.0",
57
- "eslint-plugin-markdown": "1.0.0",
58
- "eslint-plugin-node": "8.0.1",
59
- "eslint-plugin-promise": "4.0.1",
60
- "eslint-plugin-standard": "4.0.0",
61
- "mocha": "6.1.4",
62
- "nyc": "14.0.0"
51
+ "eslint": "6.8.0",
52
+ "eslint-config-standard": "14.1.0",
53
+ "eslint-plugin-import": "2.19.1",
54
+ "eslint-plugin-markdown": "1.0.1",
55
+ "eslint-plugin-node": "11.0.0",
56
+ "eslint-plugin-promise": "4.2.1",
57
+ "eslint-plugin-standard": "4.0.1",
58
+ "mocha": "7.0.0",
59
+ "nyc": "15.0.0"
63
60
  },
64
61
  "engines": {
65
62
  "node": ">= 0.6"
@@ -90,5 +87,5 @@
90
87
  "test-travis": "nyc --reporter=text npm test",
91
88
  "version": "node scripts/version-history.js && git add HISTORY.md"
92
89
  },
93
- "version": "2.0.17"
90
+ "version": "2.0.18"
94
91
  }
@@ -1,3 +1,9 @@
1
+ 0.4.2 / 2022-02-02
2
+ ==================
3
+
4
+ * pref: read value only when assigning in parse
5
+ * pref: remove unnecessary regexp in parse
6
+
1
7
  0.4.1 / 2020-04-21
2
8
  ==================
3
9
 
@@ -3,7 +3,7 @@
3
3
  [![NPM Version][npm-version-image]][npm-url]
4
4
  [![NPM Downloads][npm-downloads-image]][npm-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
  Basic HTTP cookie parser and serializer for HTTP servers.
@@ -198,32 +198,61 @@ $ npm test
198
198
  ```
199
199
  $ npm run bench
200
200
 
201
- > cookie@0.3.1 bench cookie
201
+ > cookie@0.4.1 bench
202
202
  > node benchmark/index.js
203
203
 
204
- http_parser@2.8.0
205
- node@6.14.2
206
- v8@5.1.281.111
207
- uv@1.16.1
204
+ node@16.13.1
205
+ v8@9.4.146.24-node.14
206
+ uv@1.42.0
208
207
  zlib@1.2.11
209
- ares@1.10.1-DEV
210
- icu@58.2
211
- modules@48
212
- napi@3
213
- openssl@1.0.2o
208
+ brotli@1.0.9
209
+ ares@1.18.1
210
+ modules@93
211
+ nghttp2@1.45.1
212
+ napi@8
213
+ llhttp@6.0.4
214
+ openssl@1.1.1l+quic
215
+ cldr@39.0
216
+ icu@69.1
217
+ tz@2021a
218
+ unicode@13.0
219
+ ngtcp2@0.1.0-DEV
220
+ nghttp3@0.1.0-DEV
221
+
222
+ > node benchmark/parse-top.js
223
+
224
+ cookie.parse - top sites
225
+
226
+ 15 tests completed.
227
+
228
+ parse accounts.google.com x 504,358 ops/sec ±6.55% (171 runs sampled)
229
+ parse apple.com x 1,369,991 ops/sec ±0.84% (189 runs sampled)
230
+ parse cloudflare.com x 360,669 ops/sec ±3.75% (182 runs sampled)
231
+ parse docs.google.com x 521,496 ops/sec ±4.90% (180 runs sampled)
232
+ parse drive.google.com x 553,514 ops/sec ±0.59% (189 runs sampled)
233
+ parse en.wikipedia.org x 286,052 ops/sec ±0.62% (188 runs sampled)
234
+ parse linkedin.com x 178,817 ops/sec ±0.61% (192 runs sampled)
235
+ parse maps.google.com x 284,585 ops/sec ±0.68% (188 runs sampled)
236
+ parse microsoft.com x 161,230 ops/sec ±0.56% (192 runs sampled)
237
+ parse play.google.com x 352,144 ops/sec ±1.01% (181 runs sampled)
238
+ parse plus.google.com x 275,204 ops/sec ±7.78% (156 runs sampled)
239
+ parse support.google.com x 339,493 ops/sec ±1.02% (191 runs sampled)
240
+ parse www.google.com x 286,110 ops/sec ±0.90% (191 runs sampled)
241
+ parse youtu.be x 548,557 ops/sec ±0.60% (184 runs sampled)
242
+ parse youtube.com x 545,293 ops/sec ±0.65% (191 runs sampled)
214
243
 
215
244
  > node benchmark/parse.js
216
245
 
217
- cookie.parse
246
+ cookie.parse - generic
218
247
 
219
248
  6 tests completed.
220
249
 
221
- simple x 1,200,691 ops/sec ±1.12% (189 runs sampled)
222
- decode x 1,012,994 ops/sec ±0.97% (186 runs sampled)
223
- unquote x 1,074,174 ops/sec ±2.43% (186 runs sampled)
224
- duplicates x 438,424 ops/sec ±2.17% (184 runs sampled)
225
- 10 cookies x 147,154 ops/sec ±1.01% (186 runs sampled)
226
- 100 cookies x 14,274 ops/sec ±1.07% (187 runs sampled)
250
+ simple x 1,266,646 ops/sec ±0.65% (191 runs sampled)
251
+ decode x 838,413 ops/sec ±0.60% (191 runs sampled)
252
+ unquote x 877,820 ops/sec ±0.72% (189 runs sampled)
253
+ duplicates x 516,680 ops/sec ±0.61% (191 runs sampled)
254
+ 10 cookies x 156,874 ops/sec ±0.52% (189 runs sampled)
255
+ 100 cookies x 14,663 ops/sec ±0.53% (191 runs sampled)
227
256
  ```
228
257
 
229
258
  ## References
@@ -248,10 +277,10 @@ $ npm run bench
248
277
 
249
278
  [coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master
250
279
  [coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master
280
+ [github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/cookie/ci/master?label=ci
281
+ [github-actions-ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml
251
282
  [node-version-image]: https://badgen.net/npm/node/cookie
252
283
  [node-version-url]: https://nodejs.org/en/download
253
284
  [npm-downloads-image]: https://badgen.net/npm/dm/cookie
254
285
  [npm-url]: https://npmjs.org/package/cookie
255
286
  [npm-version-image]: https://badgen.net/npm/v/cookie
256
- [travis-image]: https://badgen.net/travis/jshttp/cookie/master
257
- [travis-url]: https://travis-ci.org/jshttp/cookie
@@ -22,7 +22,6 @@ exports.serialize = serialize;
22
22
 
23
23
  var decode = decodeURIComponent;
24
24
  var encode = encodeURIComponent;
25
- var pairSplitRegExp = /; */;
26
25
 
27
26
  /**
28
27
  * RegExp to match field-content in RFC 7230 sec 3.2
@@ -53,28 +52,29 @@ function parse(str, options) {
53
52
 
54
53
  var obj = {}
55
54
  var opt = options || {};
56
- var pairs = str.split(pairSplitRegExp);
55
+ var pairs = str.split(';')
57
56
  var dec = opt.decode || decode;
58
57
 
59
58
  for (var i = 0; i < pairs.length; i++) {
60
59
  var pair = pairs[i];
61
- var eq_idx = pair.indexOf('=');
60
+ var index = pair.indexOf('=')
62
61
 
63
62
  // skip things that don't look like key=value
64
- if (eq_idx < 0) {
63
+ if (index < 0) {
65
64
  continue;
66
65
  }
67
66
 
68
- var key = pair.substr(0, eq_idx).trim()
69
- var val = pair.substr(++eq_idx, pair.length).trim();
70
-
71
- // quoted values
72
- if ('"' == val[0]) {
73
- val = val.slice(1, -1);
74
- }
67
+ var key = pair.substring(0, index).trim()
75
68
 
76
69
  // only assign once
77
70
  if (undefined == obj[key]) {
71
+ var val = pair.substring(index + 1, pair.length).trim()
72
+
73
+ // quoted values
74
+ if (val[0] === '"') {
75
+ val = val.slice(1, -1)
76
+ }
77
+
78
78
  obj[key] = tryDecode(val, dec);
79
79
  }
80
80
  }