New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gamla

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gamla - npm Package Compare versions

Comparing version 41.0.0 to 42.0.0

9

esm/src/io.js

@@ -69,3 +69,5 @@ import { juxt, pairRight, stack } from "./juxt.js";

});
export const retry = (waitMs, times, f) =>
export const conditionalRetry =
// deno-lint-ignore no-explicit-any
(predicate) => (waitMs, times, f) =>
// @ts-expect-error cannot infer

@@ -78,6 +80,9 @@ times

catch (e) {
if (!predicate(e))
throw e;
console.error(`failed. retries left: ${times}`, e);
return sleep(waitMs).then(() => retry(waitMs, times - 1, f)(...x));
return sleep(waitMs).then(() => conditionalRetry(predicate)(waitMs, times - 1, f)(...x));
}
}
: f;
export const retry = conditionalRetry(() => true);

@@ -6,3 +6,3 @@ {

"name": "gamla",
"version": "41.0.0",
"version": "42.0.0",
"description": "Functional programming with async and type safety",

@@ -9,0 +9,0 @@ "license": "MIT",

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.retry = exports.timeout = exports.batch = void 0;
exports.retry = exports.conditionalRetry = exports.timeout = exports.batch = void 0;
const juxt_js_1 = require("./juxt.js");

@@ -74,3 +74,5 @@ const operator_js_1 = require("./operator.js");

exports.timeout = timeout;
const retry = (waitMs, times, f) =>
const conditionalRetry =
// deno-lint-ignore no-explicit-any
(predicate) => (waitMs, times, f) =>
// @ts-expect-error cannot infer

@@ -83,7 +85,10 @@ times

catch (e) {
if (!predicate(e))
throw e;
console.error(`failed. retries left: ${times}`, e);
return (0, time_js_1.sleep)(waitMs).then(() => (0, exports.retry)(waitMs, times - 1, f)(...x));
return (0, time_js_1.sleep)(waitMs).then(() => (0, exports.conditionalRetry)(predicate)(waitMs, times - 1, f)(...x));
}
}
: f;
exports.retry = retry;
exports.conditionalRetry = conditionalRetry;
exports.retry = (0, exports.conditionalRetry)(() => true);

@@ -9,3 +9,4 @@ import { AsyncFunction, ElementOf } from "./typing.js";

export declare const timeout: <F extends AsyncFunction>(ms: number, f: F) => F;
export declare const conditionalRetry: (predicate: (e: Error) => any) => <F extends AsyncFunction>(waitMs: number, times: number, f: F) => F;
export declare const retry: <F extends AsyncFunction>(waitMs: number, times: number, f: F) => F;
export {};
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