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

@based/client

Package Overview
Dependencies
Maintainers
7
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@based/client - npm Package Compare versions

Comparing version 6.3.1 to 6.4.0

33

dist/src/websocket/index.js

@@ -9,2 +9,19 @@ import urlLoader from './urlLoader.js';

if (typeof document !== 'undefined') {
let putToOffline = false;
window.addEventListener('offline', () => {
activityListeners.forEach((fn) => {
putToOffline = true;
fn(false, true);
});
});
window.addEventListener('online', () => {
if (putToOffline) {
putToOffline = false;
if (!document.hidden) {
activityListeners.forEach((fn) => {
fn(true, false);
});
}
}
});
document.addEventListener('visibilitychange', function () {

@@ -15,3 +32,3 @@ clearTimeout(activeTimer);

activityListeners.forEach((fn) => {
fn(false);
fn(false, false);
});

@@ -22,3 +39,3 @@ }, 30e3);

activityListeners.forEach((fn) => {
fn(true);
fn(true, false);
});

@@ -39,5 +56,11 @@ }

let isActive = true;
activityListeners.set(connection, (active) => {
activityListeners.set(connection, (active, isOffline) => {
if (!connection.disconnected) {
if (!active && isActive) {
if (!active && isOffline) {
isActive = false;
client.onClose();
ws.close();
// add online listener as well
}
else if (!active && isActive) {
if (client.functionResponseListeners.size ||

@@ -49,3 +72,3 @@ isStreaming.streaming) {

activityListeners.forEach((fn) => {
fn(false);
fn(false, false);
});

@@ -52,0 +75,0 @@ }, 10e3);

9

package.json
{
"name": "@based/client",
"version": "6.3.1",
"version": "6.4.0",
"license": "MIT",

@@ -9,3 +9,5 @@ "scripts": {

"clean": "rimraf {.turbo,dist,node_modules}",
"test": "npx ava"
"test": "npx ava",
"browser": "npx vite ./test/browser",
"browser-server": "node ./test/browser/server.js"
},

@@ -46,5 +48,4 @@ "type": "module",

"devDependencies": {
"vite": "^5.2.8",
"get-port": "7.0.0",
"@aws-sdk/lib-storage": "^3.304.0",
"@aws-sdk/client-s3": "^3.304.0",
"@based/functions": "^3.0.2",

@@ -51,0 +52,0 @@ "cross-fetch": "4.0.0",

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