Huge News!Announcing our $40M Series B led by Abstract Ventures.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 1.5.0 to 2.0.0

2

build/main/lib/MockPeer.d.ts

@@ -12,3 +12,3 @@ /// <reference types="node" />

receive(): Promise<WSData>;
popLastPeerMessage(): WSData | undefined;
popOldestPeerMessage(): WSData | undefined;
waitForPeerClosure(): Promise<CloseFrame>;

@@ -15,0 +15,0 @@ get peerCloseFrame(): CloseFrame | null;

@@ -28,10 +28,10 @@ "use strict";

this.requireConnectionStillOpen();
const lastMessage = this.popLastPeerMessage();
if (lastMessage) {
return lastMessage;
const oldestMessage = this.popOldestPeerMessage();
if (oldestMessage) {
return oldestMessage;
}
return this.peerWebSocket.getLastMessageSent();
}
popLastPeerMessage() {
return this.peerWebSocket.popLastMessage();
popOldestPeerMessage() {
return this.peerWebSocket.popOldestMessage();
}

@@ -38,0 +38,0 @@ async waitForPeerClosure() {

@@ -33,4 +33,4 @@ "use strict";

*/
popLastMessage() {
return this.messagesSent.pop();
popOldestMessage() {
return this.messagesSent.shift();
}

@@ -37,0 +37,0 @@ close(code, reason) {

@@ -12,3 +12,3 @@ /// <reference types="node" />

receive(): Promise<WSData>;
popLastPeerMessage(): WSData | undefined;
popOldestPeerMessage(): WSData | undefined;
waitForPeerClosure(): Promise<CloseFrame>;

@@ -15,0 +15,0 @@ get peerCloseFrame(): CloseFrame | null;

@@ -25,10 +25,10 @@ import { MockWebSocket } from './MockWebSocket';

this.requireConnectionStillOpen();
const lastMessage = this.popLastPeerMessage();
if (lastMessage) {
return lastMessage;
const oldestMessage = this.popOldestPeerMessage();
if (oldestMessage) {
return oldestMessage;
}
return this.peerWebSocket.getLastMessageSent();
}
popLastPeerMessage() {
return this.peerWebSocket.popLastMessage();
popOldestPeerMessage() {
return this.peerWebSocket.popOldestMessage();
}

@@ -35,0 +35,0 @@ async waitForPeerClosure() {

@@ -30,4 +30,4 @@ import { EventEmitter } from 'events';

*/
popLastMessage() {
return this.messagesSent.pop();
popOldestMessage() {
return this.messagesSent.shift();
}

@@ -34,0 +34,0 @@ close(code, reason) {

{
"name": "@relaycorp/ws-mock",
"version": "1.5.0",
"version": "2.0.0",
"author": {

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

"dependencies": {
"ws": "^7.4.4"
"ws": "^7.4.5"
},

@@ -41,3 +41,3 @@ "peerDependencies": {

"@relaycorp/shared-config": "^1.4.13",
"@types/ws": "^7.4.1",
"@types/ws": "^7.4.2",
"del-cli": "^3.0.0",

@@ -48,4 +48,4 @@ "npm-run-all": "^4.1.5",

"tslint": "^5.20.1",
"typedoc": "^0.20.35",
"typescript": "^4.1.5"
"typedoc": "^0.20.36",
"typescript": "^4.2.4"
},

@@ -52,0 +52,0 @@ "prettier": "@relaycorp/shared-config/.prettierrc.json",

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