Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

newsware

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newsware - npm Package Compare versions

Comparing version 10.0.0-beta.10 to 10.0.0-beta.11

2

lib/src/wsApi.d.ts

@@ -7,3 +7,3 @@ /// <reference types="ws" />

private readonly websocketEndpoint;
socket: WebSocket;
socket?: WebSocket;
reconnectMessages: WebsocketRequest[];

@@ -10,0 +10,0 @@ private options;

@@ -26,4 +26,5 @@ "use strict";

changeApikey(apikey) {
var _a;
this.apikey = apikey;
if (this.socket.readyState === isomorphic_ws_1.default.OPEN) {
if (((_a = this.socket) === null || _a === void 0 ? void 0 : _a.readyState) === isomorphic_ws_1.default.OPEN) {
this.closeConnection();

@@ -104,3 +105,4 @@ }

sendSocketMessage(message, resendOnReconnect = false) {
this.socket.send(JSON.stringify(message));
var _a;
(_a = this.socket) === null || _a === void 0 ? void 0 : _a.send(JSON.stringify(message));
if (resendOnReconnect)

@@ -110,3 +112,4 @@ this.reconnectMessages.push(message);

closeConnection() {
this.socket.close();
var _a;
(_a = this.socket) === null || _a === void 0 ? void 0 : _a.close();
}

@@ -113,0 +116,0 @@ }

{
"name": "newsware",
"version": "10.0.0-beta.10",
"version": "10.0.0-beta.11",
"description": "Typescript client for interacting with the Newsware API",

@@ -5,0 +5,0 @@ "main": "lib/src/index.js",

@@ -17,3 +17,3 @@ import { ConnectOptions, SubscribeOptions, WebsocketRequest, WebsocketResponse, } from "./types";

private readonly websocketEndpoint: string
socket!: WebSocket
socket?: WebSocket
reconnectMessages: WebsocketRequest[] = []

@@ -32,3 +32,3 @@ private options: Required<ConnectOptions>

this.apikey = apikey
if (this.socket.readyState === WebSocket.OPEN) {
if (this.socket?.readyState === WebSocket.OPEN) {
this.closeConnection()

@@ -116,3 +116,3 @@ }

sendSocketMessage(message: WebsocketRequest, resendOnReconnect: boolean = false) {
this.socket.send(JSON.stringify(message))
this.socket?.send(JSON.stringify(message))
if (resendOnReconnect)

@@ -123,4 +123,4 @@ this.reconnectMessages.push(message)

closeConnection() {
this.socket.close()
this.socket?.close()
}
}

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