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

@libsql/hrana-client

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libsql/hrana-client - npm Package Compare versions

Comparing version 0.3.10 to 0.3.11

15

lib-cjs/client.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = exports.protocolVersions = void 0;
const isomorphic_ws_1 = require("@libsql/isomorphic-ws");
const id_alloc_js_1 = require("./id_alloc.js");

@@ -19,2 +18,4 @@ const errors_js_1 = require("./errors.js");

#openCallbacks;
// Have we already transitioned from CONNECTING to OPEN and fired the callbacks in #openCallbacks?
#opened;
// Stores the error that caused us to close the client (and the socket). If we are not closed, this is

@@ -44,2 +45,3 @@ // `undefined`.

this.#openCallbacks = [];
this.#opened = false;
this.#closed = undefined;

@@ -64,3 +66,3 @@ this.#recvdHello = false;

}
if (this.#socket.readyState >= isomorphic_ws_1.WebSocket.OPEN) {
if (this.#opened) {
this.#sendToSocket(msg);

@@ -90,2 +92,3 @@ }

this.#openCallbacks.length = 0;
this.#opened = true;
}

@@ -102,9 +105,9 @@ #sendToSocket(msg) {

}
else if (this.#version !== undefined) {
versionCallback(this.#version);
}
else {
else if (!this.#opened) {
const openCallback = () => versionCallback(this.#version);
this.#openCallbacks.push({ openCallback, errorCallback });
}
else {
versionCallback(this.#version);
}
});

@@ -111,0 +114,0 @@ }

@@ -1,2 +0,1 @@

import { WebSocket } from "@libsql/isomorphic-ws";
import { IdAlloc } from "./id_alloc.js";

@@ -16,2 +15,4 @@ import { ClientError, ProtoError, ClosedError, WebSocketError, ProtocolVersionError } from "./errors.js";

#openCallbacks;
// Have we already transitioned from CONNECTING to OPEN and fired the callbacks in #openCallbacks?
#opened;
// Stores the error that caused us to close the client (and the socket). If we are not closed, this is

@@ -41,2 +42,3 @@ // `undefined`.

this.#openCallbacks = [];
this.#opened = false;
this.#closed = undefined;

@@ -61,3 +63,3 @@ this.#recvdHello = false;

}
if (this.#socket.readyState >= WebSocket.OPEN) {
if (this.#opened) {
this.#sendToSocket(msg);

@@ -87,2 +89,3 @@ }

this.#openCallbacks.length = 0;
this.#opened = true;
}

@@ -99,9 +102,9 @@ #sendToSocket(msg) {

}
else if (this.#version !== undefined) {
versionCallback(this.#version);
}
else {
else if (!this.#opened) {
const openCallback = () => versionCallback(this.#version);
this.#openCallbacks.push({ openCallback, errorCallback });
}
else {
versionCallback(this.#version);
}
});

@@ -108,0 +111,0 @@ }

2

package.json
{
"name": "@libsql/hrana-client",
"version": "0.3.10",
"version": "0.3.11",
"keywords": [

@@ -5,0 +5,0 @@ "hrana",

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