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

appolo-utils

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appolo-utils - npm Package Compare versions

Comparing version 0.0.53 to 0.0.54

13

lib/promises/promises.js

@@ -69,2 +69,15 @@ "use strict";

}
static timeout(promise, timeout) {
return Promises.promiseTimeout(promise, timeout);
}
static async retry(fn, retires = 1) {
let [err, result] = await Promises.to(fn());
if (err == null) {
return result;
}
if (retires <= 0) {
throw err;
}
return Promises.retry(fn, --retires);
}
static promiseTimeout(promise, timeout) {

@@ -71,0 +84,0 @@ return new Promise((resolve, reject) => {

@@ -93,2 +93,20 @@ import {Deferred} from "./deferred";

public static timeout<T>(promise: Promise<T>, timeout: number): Promise<T> {
return Promises.promiseTimeout(promise, timeout)
}
public static async retry<T>(fn: () => Promise<T>, retires: number = 1): Promise<T> {
let [err, result] = await Promises.to(fn());
if (err == null) {
return result
}
if (retires <= 0) {
throw err;
}
return Promises.retry(fn, --retires);
}
public static promiseTimeout<T>(promise: Promise<T>, timeout: number): Promise<T> {

@@ -95,0 +113,0 @@ return new Promise<T>((resolve, reject) => {

2

package.json

@@ -17,3 +17,3 @@ {

"main": "./index.js",
"version": "0.0.53",
"version": "0.0.54",
"license": "MIT",

@@ -20,0 +20,0 @@ "repository": {

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