is-retry-allowed
Advanced tools
Comparing version 2.2.0 to 3.0.0
@@ -8,3 +8,3 @@ /** | ||
``` | ||
import isRetryAllowed = require('is-retry-allowed'); | ||
import isRetryAllowed from 'is-retry-allowed'; | ||
@@ -21,4 +21,2 @@ isRetryAllowed({code: 'ETIMEDOUT'}); | ||
*/ | ||
declare function isRetryAllowed(error?: Error | Record<string, unknown>): boolean; | ||
export = isRetryAllowed; | ||
export default function isRetryAllowed(error?: Error | Record<string, unknown>): boolean; |
@@ -1,3 +0,1 @@ | ||
'use strict'; | ||
const denyList = new Set([ | ||
@@ -39,2 +37,4 @@ 'ENOTFOUND', | ||
// TODO: Use `error?.code` when targeting Node.js 14 | ||
module.exports = error => !denyList.has(error && error.code); | ||
export default function isRetryAllowed(error) { | ||
return !denyList.has(error && error.code); | ||
} |
{ | ||
"name": "is-retry-allowed", | ||
"version": "2.2.0", | ||
"version": "3.0.0", | ||
"description": "Check whether a request can be retried based on the `error.code`", | ||
"license": "MIT", | ||
"repository": "sindresorhus/is-retry-allowed", | ||
"funding": { | ||
"url": "https://github.com/sponsors/sindresorhus" | ||
}, | ||
"funding": "https://github.com/sponsors/sindresorhus", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"type": "module", | ||
"exports": "./index.js", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12" | ||
}, | ||
@@ -36,6 +36,6 @@ "scripts": { | ||
"devDependencies": { | ||
"ava": "^3.14.0", | ||
"ava": "^3.15.0", | ||
"tsd": "^0.14.0", | ||
"xo": "^0.36.1" | ||
"xo": "^0.38.2" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # is-retry-allowed | ||
``` | ||
$ npm install --save is-retry-allowed | ||
$ npm install is-retry-allowed | ||
``` | ||
@@ -15,3 +15,3 @@ | ||
```js | ||
const isRetryAllowed = require('is-retry-allowed'); | ||
import isRetryAllowed from 'is-retry-allowed'; | ||
@@ -18,0 +18,0 @@ isRetryAllowed({code: 'ETIMEDOUT'}); |
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
4444
Yes