async-await-retry
Advanced tools
Comparing version 1.1.0 to 1.1.2
{ | ||
"name": "async-await-retry", | ||
"version": "1.1.0", | ||
"version": "1.1.2", | ||
"description": "Simple module to retry a function with async/await syntax !", | ||
"main": "index.js", | ||
"bin": "./index.js", | ||
"types": "./index.d.ts", | ||
"exports": { | ||
"require": "./index.js", | ||
"import": "./index.js" | ||
}, | ||
"files": [ | ||
"src/**" | ||
], | ||
"engines": { | ||
@@ -16,9 +26,13 @@ "node": ">=7.6.0" | ||
"promises", | ||
"retries" | ||
"retries", | ||
"error" | ||
], | ||
"homepage": "https://github.com/VoodooTeam/async-await-retry", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/VoodooTeam/async-await-retry.git" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/.bin/jest", | ||
"lint": "./node_modules/.bin/eslint -c ./.eslintrc ./", | ||
"linter": "./node_modules/.bin/eslint -c ./.eslintrc ./", | ||
"all": "npm run lint && npm run test" | ||
@@ -34,5 +48,5 @@ }, | ||
"devDependencies": { | ||
"eslint": "^7.5.0", | ||
"jest": "^26.1.0" | ||
"eslint": "^7.15.0", | ||
"jest": "^26.3.0" | ||
} | ||
} |
<div align="center"> | ||
<b>Async / Await exponential retry</b><br/> | ||
<br/><br/> | ||
<a href="https://badge.fury.io/js/async-await-retry"> | ||
<img src="https://badge.fury.io/js/async-await-retry.svg" alt="npm version" height="18"> | ||
</a> | ||
</div> | ||
[![GitHub release](https://badge.fury.io/js/async-await-retry.svg)](https://github.com/VoodooTeam/async-await-retry/releases/) | ||
[![GitHub license](https://img.shields.io/github/license/VoodooTeam/async-await-retry)](https://github.com/VoodooTeam/async-await-retry/blob/master/LICENSE) | ||
[![CI pipeline](https://github.com/VoodooTeam/async-await-retry/workflows/Node.js%20CI/badge.svg)](https://github.com/VoodooTeam/async-await-retry/actions?query=workflow%3A%22Node.js+CI%22) | ||
[![Opened issues](https://img.shields.io/github/issues-raw/VoodooTeam/async-await-retry)](https://github.com/VoodooTeam/async-await-retry/issues) | ||
[![Opened PR](https://img.shields.io/github/issues-pr-raw/VoodooTeam/async-await-retry)](https://github.com/VoodooTeam/async-await-retry/pulls) | ||
# Purpose | ||
@@ -12,0 +14,0 @@ |
@@ -53,3 +53,3 @@ const getPromise = (fn, args) => { | ||
let interval = config.interval || 0; | ||
const exponential = config.hasOwnProperty('exponential') ? config.exponential : true; | ||
const exponential = Object.prototype.hasOwnProperty.call(config, 'exponential') ? config.exponential : true; | ||
const factor = config.factor || 2; | ||
@@ -68,3 +68,3 @@ const onAttemptFail = typeof config.onAttemptFail === 'function' ? config.onAttemptFail : onAttemptFailFallback; | ||
} catch (error) { | ||
if(retriesMax === i+1 || (error.hasOwnProperty('retryable') && !error.retryable)) throw error; | ||
if(retriesMax === i+1 || (Object.prototype.hasOwnProperty.call(error, 'retryable') && !error.retryable)) throw error; | ||
const result = await onAttemptFail({ | ||
@@ -71,0 +71,0 @@ error, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
172
0
10375
5
75