Comparing version 7.2.0 to 7.2.1
'use strict'; | ||
const Limiter = require('async-limiter'); | ||
const zlib = require('zlib'); | ||
const bufferUtil = require('./buffer-util'); | ||
const Limiter = require('./limiter'); | ||
const { kStatusCode, NOOP } = require('./constants'); | ||
const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]); | ||
const EMPTY_BLOCK = Buffer.from([0x00]); | ||
const kPerMessageDeflate = Symbol('permessage-deflate'); | ||
@@ -69,3 +67,3 @@ const kTotalLength = Symbol('total-length'); | ||
: 10; | ||
zlibLimiter = new Limiter({ concurrency }); | ||
zlibLimiter = new Limiter(concurrency); | ||
} | ||
@@ -292,3 +290,3 @@ } | ||
/** | ||
* Decompress data. Concurrency limited by async-limiter. | ||
* Decompress data. Concurrency limited. | ||
* | ||
@@ -301,3 +299,3 @@ * @param {Buffer} data Compressed data | ||
decompress(data, fin, callback) { | ||
zlibLimiter.push((done) => { | ||
zlibLimiter.add((done) => { | ||
this._decompress(data, fin, (err, result) => { | ||
@@ -311,3 +309,3 @@ done(); | ||
/** | ||
* Compress data. Concurrency limited by async-limiter. | ||
* Compress data. Concurrency limited. | ||
* | ||
@@ -320,3 +318,3 @@ * @param {Buffer} data Data to compress | ||
compress(data, fin, callback) { | ||
zlibLimiter.push((done) => { | ||
zlibLimiter.add((done) => { | ||
this._compress(data, fin, (err, result) => { | ||
@@ -401,7 +399,2 @@ done(); | ||
_compress(data, fin, callback) { | ||
if (!data || data.length === 0) { | ||
process.nextTick(callback, null, EMPTY_BLOCK); | ||
return; | ||
} | ||
const endpoint = this._isServer ? 'server' : 'client'; | ||
@@ -408,0 +401,0 @@ |
{ | ||
"name": "ws", | ||
"version": "7.2.0", | ||
"version": "7.2.1", | ||
"description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", | ||
@@ -20,2 +20,5 @@ "keywords": [ | ||
"browser": "browser.js", | ||
"engines": { | ||
"node": ">=8.3.0" | ||
}, | ||
"files": [ | ||
@@ -31,5 +34,14 @@ "browser.js", | ||
}, | ||
"dependencies": { | ||
"async-limiter": "^1.0.0" | ||
"peerDependencies": { | ||
"bufferutil": "^4.0.1", | ||
"utf-8-validate": "^5.0.2" | ||
}, | ||
"peerDependenciesMeta": { | ||
"bufferutil": { | ||
"optional": true | ||
}, | ||
"utf-8-validate": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
@@ -36,0 +48,0 @@ "benchmark": "^2.1.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108109
17
3027
2
+ Addedbufferutil@4.0.8(transitive)
+ Addednode-gyp-build@4.8.2(transitive)
+ Addedutf-8-validate@5.0.10(transitive)
- Removedasync-limiter@^1.0.0
- Removedasync-limiter@1.0.1(transitive)