New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@relaycorp/ws-mock

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@relaycorp/ws-mock - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

2

build/main/lib/CloseFrame.d.ts
/// <reference types="node" />
export interface CloseFrame {
readonly code?: number;
readonly reason?: Buffer;
readonly reason?: Buffer | string;
}

@@ -6,3 +6,2 @@ "use strict";

const MockWebSocket_1 = require("./MockWebSocket");
const MockWSError_1 = require("./MockWSError");
class MockServer extends MockPeer_1.MockPeer {

@@ -29,6 +28,6 @@ get client() {

if (clientResult.status === 'rejected') {
throw new MockWSError_1.MockWSError(clientResult.reason, 'Client promise rejected');
throw clientResult.reason;
}
if (serverResult.status === 'rejected') {
throw new MockWSError_1.MockWSError(serverResult.reason, 'Mock server failed');
throw serverResult.reason;
}

@@ -35,0 +34,0 @@ return clientResult.value;

@@ -118,4 +118,8 @@ "use strict";

this.on('message', (message) => duplex.push(message));
this.once('close', () => duplex.destroy());
this.ownEvents.once('termination', () => duplex.destroy());
const closeReadableStream = () => {
duplex.push(null); // Prevent ERR_STREAM_PREMATURE_CLOSE on Node.js 18+
duplex.destroy();
};
this.once('close', closeReadableStream);
this.ownEvents.once('termination', closeReadableStream);
this.once('error', (error) => duplex.destroy(error));

@@ -122,0 +126,0 @@ return duplex;

/// <reference types="node" />
export interface CloseFrame {
readonly code?: number;
readonly reason?: Buffer;
readonly reason?: Buffer | string;
}
import { MockPeer } from './MockPeer';
import { MockWebSocket } from './MockWebSocket';
import { MockWSError } from './MockWSError';
export class MockServer extends MockPeer {

@@ -25,6 +24,6 @@ get client() {

if (clientResult.status === 'rejected') {
throw new MockWSError(clientResult.reason, 'Client promise rejected');
throw clientResult.reason;
}
if (serverResult.status === 'rejected') {
throw new MockWSError(serverResult.reason, 'Mock server failed');
throw serverResult.reason;
}

@@ -31,0 +30,0 @@ return clientResult.value;

@@ -120,4 +120,8 @@ // tslint:disable:readonly-keyword readonly-array no-object-mutation

this.on('message', (message) => duplex.push(message));
this.once('close', () => duplex.destroy());
this.ownEvents.once('termination', () => duplex.destroy());
const closeReadableStream = () => {
duplex.push(null); // Prevent ERR_STREAM_PREMATURE_CLOSE on Node.js 18+
duplex.destroy();
};
this.once('close', closeReadableStream);
this.ownEvents.once('termination', closeReadableStream);
this.once('error', (error) => duplex.destroy(error));

@@ -124,0 +128,0 @@ return duplex;

{
"name": "@relaycorp/ws-mock",
"version": "5.1.0",
"version": "5.2.0",
"author": {

@@ -36,3 +36,2 @@ "email": "no-reply@relaycorp.tech",

"buffer-to-arraybuffer": "0.0.6",
"verror": "^1.10.1",
"ws": "^7.5.3"

@@ -45,3 +44,2 @@ },

"@relaycorp/shared-config": "^1.7.0",
"@types/verror": "^1.10.5",
"@types/ws": "^8.5.3",

@@ -48,0 +46,0 @@ "del-cli": "^4.0.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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