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.5.2 to 6.6.0

11

dist/src/index.js

@@ -282,4 +282,7 @@ import connectWebsocket from './websocket/index.js';

let retries = 0;
const retryReject = (err) => {
const newTime = retryStrategy(err, time, retries);
const retryReject = async (err) => {
const result = await retryStrategy(err, time, retries);
const isObj = typeof result === 'object';
const newPayload = (isObj ? result.payload : payload) ?? payload;
const newTime = isObj ? result.time : result;
retries++;

@@ -289,7 +292,7 @@ if (typeof newTime === 'number' && !isNaN(newTime)) {

if (newTime === 0) {
addToFunctionQueue(this, payload, name, resolve, retryReject);
addToFunctionQueue(this, newPayload, name, resolve, retryReject);
}
else {
setTimeout(() => {
addToFunctionQueue(this, payload, name, resolve, retryReject);
addToFunctionQueue(this, newPayload, name, resolve, retryReject);
}, newTime);

@@ -296,0 +299,0 @@ }

@@ -9,4 +9,9 @@ import { GenericObject } from './generic.js';

export type FunctionQueue = FunctionQueueItem[];
export type RetryResult = {
payload?: any;
time?: number;
};
export type RetryResultAll = RetryResult | null | undefined | false | number;
export type CallOptions = {
retryStrategy: (err: Error, time: number, retries: number) => 0 | null | undefined | false | number;
retryStrategy: (err: Error, time: number, retries: number) => Promise<RetryResultAll> | RetryResultAll;
};

@@ -13,0 +18,0 @@ export type QueryOptions = {

{
"name": "@based/client",
"version": "6.5.2",
"version": "6.6.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "scripts": {

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