Socket
Socket
Sign inDemoInstall

ws

Package Overview
Dependencies
Maintainers
4
Versions
169
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ws - npm Package Compare versions

Comparing version 7.2.0 to 7.2.1

lib/limiter.js

19

lib/permessage-deflate.js
'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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc