mqtt 5.1.3 → 5.2.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mqtt",
3
3
  "description": "A library for the MQTT protocol",
4
- "version": "5.1.3",
4
+ "version": "5.2.0",
5
5
  "contributors": [
6
6
  "Adam Rudd <adamvrr@gmail.com>",
7
7
  "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
@@ -53,11 +53,11 @@
53
53
  "lint": "eslint --ext .ts .",
54
54
  "lint-fix": "eslint --fix --ext .ts .",
55
55
  "build:ts": "rimraf build/ && tsc -p tsconfig.build.json",
56
- "build:browser": "rimraf dist/ && mkdirp dist/ && browserify build/mqtt.js --standalone mqtt > dist/mqtt.js && terser dist/mqtt.js --compress --mangle --output dist/mqtt.min.js",
56
+ "build:browser": "node esbuild.js",
57
57
  "build": "npm run build:ts && npm run build:browser",
58
58
  "prepare": "npm run build",
59
59
  "unit-test:node": "node_modules/.bin/nyc --reporter=lcov --reporter=text node -r esbuild-register test/runTests.ts",
60
- "unit-test:browser": "airtap --server test/browser/server.js test/browser/test.js",
60
+ "unit-test:browser": "wtr",
61
61
  "test:node": "npm run unit-test:node && codecov",
62
62
  "test:browser": "npm run build && npm run unit-test:browser",
63
63
  "test": "npm run test:node",
@@ -101,47 +101,50 @@
101
101
  "net": false
102
102
  },
103
103
  "dependencies": {
104
- "@types/readable-stream": "^4.0.1",
105
- "@types/ws": "^8.5.5",
104
+ "@types/readable-stream": "^4.0.5",
105
+ "@types/ws": "^8.5.9",
106
106
  "commist": "^3.2.0",
107
107
  "concat-stream": "^2.0.0",
108
108
  "debug": "^4.3.4",
109
109
  "duplexify": "^4.1.2",
110
110
  "help-me": "^4.2.0",
111
- "lru-cache": "^7.18.3",
111
+ "lru-cache": "^10.0.1",
112
112
  "minimist": "^1.2.8",
113
- "mqtt-packet": "^8.2.1",
113
+ "mqtt-packet": "^9.0.0",
114
114
  "number-allocator": "^1.0.14",
115
115
  "readable-stream": "^4.4.2",
116
116
  "reinterval": "^1.1.0",
117
117
  "rfdc": "^1.3.0",
118
118
  "split2": "^4.2.0",
119
- "ws": "^8.13.0"
119
+ "ws": "^8.14.2"
120
120
  },
121
121
  "devDependencies": {
122
- "@release-it/conventional-changelog": "^7.0.0",
123
- "@types/chai": "^4.3.5",
124
- "@types/duplexify": "^3.6.1",
125
- "@types/node": "^20.5.0",
126
- "@types/sinon": "^10.0.16",
127
- "@types/tape": "^5.6.0",
128
- "@typescript-eslint/eslint-plugin": "^6.2.1",
129
- "@typescript-eslint/parser": "^6.2.1",
130
- "airtap": "^4.0.4",
131
- "airtap-playwright": "^1.0.1",
132
- "browserify": "^17.0.0",
133
- "chai": "^4.3.7",
122
+ "@esm-bundle/chai": "^4.3.4-fix.0",
123
+ "@release-it/conventional-changelog": "^7.0.2",
124
+ "@types/chai": "^4.3.10",
125
+ "@types/duplexify": "^3.6.4",
126
+ "@types/node": "^20.9.0",
127
+ "@types/sinon": "^17.0.1",
128
+ "@types/tape": "^5.6.4",
129
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
130
+ "@typescript-eslint/parser": "^6.10.0",
131
+ "@web/test-runner": "^0.18.0",
132
+ "@web/test-runner-playwright": "^0.11.0",
133
+ "aedes-cli": "^0.8.0",
134
+ "chai": "^4.3.10",
134
135
  "chokidar": "^3.5.3",
135
136
  "codecov": "^3.8.2",
136
- "conventional-changelog-cli": "^3.0.0",
137
+ "conventional-changelog-cli": "^4.1.0",
137
138
  "end-of-stream": "^1.4.4",
139
+ "esbuild": "^0.19.5",
140
+ "esbuild-plugin-polyfill-node": "^0.3.0",
138
141
  "esbuild-register": "^3.5.0",
139
- "eslint": "^8.46.0",
142
+ "eslint": "^8.53.0",
140
143
  "eslint-config-airbnb-base": "^15.0.0",
141
144
  "eslint-config-airbnb-typescript": "^17.1.0",
142
- "eslint-config-prettier": "^8.9.0",
143
- "eslint-plugin-import": "^2.28.0",
144
- "eslint-plugin-prettier": "^5.0.0",
145
+ "eslint-config-prettier": "^9.0.0",
146
+ "eslint-plugin-import": "^2.29.0",
147
+ "eslint-plugin-prettier": "^5.0.1",
145
148
  "global": "^4.4.0",
146
149
  "leaked-handles": "^5.2.0",
147
150
  "mkdirp": "^3.0.1",
@@ -149,15 +152,14 @@
149
152
  "mqtt-level-store": "^3.1.0",
150
153
  "nyc": "^15.1.0",
151
154
  "pre-commit": "^1.2.2",
152
- "prettier": "^3.0.0",
153
- "release-it": "^16.1.3",
154
- "rimraf": "^5.0.1",
155
+ "prettier": "^3.0.3",
156
+ "release-it": "^16.2.1",
157
+ "rimraf": "^5.0.5",
155
158
  "should": "^13.2.3",
156
- "sinon": "^15.2.0",
159
+ "sinon": "^17.0.1",
157
160
  "snazzy": "^9.0.0",
158
- "tape": "^5.6.6",
159
- "terser": "^5.19.2",
161
+ "tape": "^5.7.2",
160
162
  "ts-node": "^10.9.1",
161
- "typescript": "^5.1.6"
163
+ "typescript": "^5.2.2"
162
164
  }
163
165
  }
@@ -1,6 +1,11 @@
1
1
  const isBrowser =
2
2
  (typeof window !== 'undefined' && typeof window.document !== 'undefined') ||
3
3
  // eslint-disable-next-line no-restricted-globals
4
- (typeof self !== 'undefined' && typeof self.postMessage === 'function') // is web worker
4
+ (typeof self === 'object' &&
5
+ // eslint-disable-next-line no-restricted-globals
6
+ self.constructor &&
7
+ // eslint-disable-next-line no-restricted-globals
8
+ self.constructor.name === 'DedicatedWorkerGlobalScope') || // is web worker
9
+ (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') // while navigator.product is deprecated
5
10
 
6
11
  export default isBrowser
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Module dependencies
3
3
  */
4
- import LRUCache from 'lru-cache'
4
+ import { LRUCache } from 'lru-cache'
5
5
  import { NumberAllocator } from 'number-allocator'
6
6
 
7
7
  /**