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

@loki/core

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loki/core - npm Package Compare versions

Comparing version 0.28.0 to 0.29.0

4

package.json
{
"name": "@loki/core",
"version": "0.28.0",
"version": "0.29.0",
"description": "Loki Chrome target core lib",

@@ -28,3 +28,3 @@ "keywords": [

},
"gitHead": "6cbab143b2367fbf4dddca561c593257c503ff11"
"gitHead": "4be00352e8554d7aff69c49f670fc247a9d22e6e"
}

@@ -34,27 +34,28 @@ const { TimeoutError } = require('./errors');

const withRetries = (maxRetries = 3, backoff = 0) => (fn) => async (
...args
) => {
let tries = 0;
let lastError;
while (tries <= maxRetries) {
tries++;
try {
const result = await fn(...args);
return result;
} catch (err) {
lastError = err;
const withRetries =
(maxRetries = 3, backoff = 0) =>
(fn) =>
async (...args) => {
let tries = 0;
let lastError;
while (tries <= maxRetries) {
tries++;
try {
const result = await fn(...args);
return result;
} catch (err) {
lastError = err;
}
if (backoff && tries <= maxRetries) {
await sleep(backoff);
}
}
if (backoff && tries <= maxRetries) {
await sleep(backoff);
if (tries === 1) {
throw lastError;
}
}
if (tries === 1) {
throw lastError;
}
const message = lastError.message || lastError.toString();
const error = new Error(`Failed with "${message}" after ${tries} tries`);
error.originalError = lastError;
throw error;
};
const message = lastError.message || lastError.toString();
const error = new Error(`Failed with "${message}" after ${tries} tries`);
error.originalError = lastError;
throw error;
};

@@ -61,0 +62,0 @@ function unwrapError(rawError) {

@@ -29,3 +29,3 @@ const { withRetries } = require('./failure-handling');

const retries = 3;
jest.useFakeTimers();
jest.useFakeTimers('legacy');
const callback = jest.fn();

@@ -32,0 +32,0 @@ const mockFn = jest.fn(() => {

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