@vpmedia/simplify 1.28.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/eslint.config.js +2 -2
- package/package.json +20 -20
- package/pnpm-workspace.yaml +2 -0
- package/src/util/fetchRetry.js +2 -2
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @vpmedia/simplify
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/@vpmedia%2Fsimplify)
|
|
4
4
|
[](https://github.com/vpmedia/simplify/actions/workflows/ci.yml)
|
|
5
5
|
|
|
6
6
|
@vpmedia/simplify TBD
|
|
7
7
|
|
|
8
8
|
## Getting started
|
|
9
9
|
|
|
10
|
-
$
|
|
10
|
+
$ pnpm add @vpmedia/simplify
|
package/eslint.config.js
CHANGED
|
@@ -21,7 +21,7 @@ export default [
|
|
|
21
21
|
{
|
|
22
22
|
languageOptions: {
|
|
23
23
|
globals: {
|
|
24
|
-
...globals.
|
|
24
|
+
...globals.vitest,
|
|
25
25
|
...globals.browser,
|
|
26
26
|
...globals.node,
|
|
27
27
|
...globals.es2021,
|
|
@@ -50,7 +50,7 @@ export default [
|
|
|
50
50
|
rules: {
|
|
51
51
|
...js.configs.recommended.rules,
|
|
52
52
|
...jsdocPlugin.configs['flat/recommended'].rules,
|
|
53
|
-
...unicornPlugin.configs
|
|
53
|
+
...unicornPlugin.configs.recommended.rules,
|
|
54
54
|
'unicorn/filename-case': 'off',
|
|
55
55
|
'unicorn/no-null': 'off',
|
|
56
56
|
'unicorn/prevent-abbreviations': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vpmedia/simplify",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "@vpmedia/simplify",
|
|
5
5
|
"author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,24 +19,17 @@
|
|
|
19
19
|
"types": "./types/index.d.ts",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@babel/preset-env": "^7.
|
|
23
|
-
"@eslint/js": "^9.
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"eslint": "^
|
|
27
|
-
"eslint-plugin-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"typescript": "^5.8.3"
|
|
34
|
-
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --passWithNoTests",
|
|
37
|
-
"lint": "eslint \"**/*.{js,jsx}\"",
|
|
38
|
-
"typecheck": "tsc",
|
|
39
|
-
"format": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json,md,css}\""
|
|
22
|
+
"@babel/preset-env": "^7.28.3",
|
|
23
|
+
"@eslint/js": "^9.36.0",
|
|
24
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
25
|
+
"eslint": "^9.36.0",
|
|
26
|
+
"eslint-plugin-jsdoc": "^60.1.0",
|
|
27
|
+
"eslint-plugin-unicorn": "^61.0.2",
|
|
28
|
+
"globals": "^16.4.0",
|
|
29
|
+
"jsdom": "^27.0.0",
|
|
30
|
+
"prettier": "^3.6.2",
|
|
31
|
+
"typescript": "^5.9.2",
|
|
32
|
+
"vitest": "^3.2.4"
|
|
40
33
|
},
|
|
41
34
|
"browserslist": [
|
|
42
35
|
"> 0.5%",
|
|
@@ -45,6 +38,13 @@
|
|
|
45
38
|
"iOS >= 14"
|
|
46
39
|
],
|
|
47
40
|
"dependencies": {
|
|
41
|
+
"@types/node": "^24.5.2",
|
|
48
42
|
"eventemitter3": "^5.0.1"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"test": "vitest --coverage --pass-with-no-tests",
|
|
46
|
+
"lint": "eslint \"**/*.{js,jsx}\"",
|
|
47
|
+
"typecheck": "tsc",
|
|
48
|
+
"format": "prettier --write \"./**/*.{js,jsx,mjs,cjs,ts,tsx,json,md,css}\""
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
package/src/util/fetchRetry.js
CHANGED
|
@@ -38,7 +38,7 @@ export class FetchError extends Error {
|
|
|
38
38
|
*/
|
|
39
39
|
export const fetchRetry = async (resource, fetchOptions, retryOptions) => {
|
|
40
40
|
retryOptions = retryOptions ?? {};
|
|
41
|
-
retryOptions.timeout = Math.max(retryOptions.timeout ??
|
|
41
|
+
retryOptions.timeout = Math.max(retryOptions.timeout ?? 30000, 1);
|
|
42
42
|
retryOptions.delay = Math.max(retryOptions.delay ?? 500, 1);
|
|
43
43
|
retryOptions.numTries = Math.max(retryOptions.numTries ?? 3, 1);
|
|
44
44
|
retryOptions.statusExcludes = retryOptions.statusExcludes ?? [
|
|
@@ -50,7 +50,7 @@ export const fetchRetry = async (resource, fetchOptions, retryOptions) => {
|
|
|
50
50
|
while (retryOptions.numTries > 0) {
|
|
51
51
|
logger.info('request', { resource, fetchOptions, retryOptions });
|
|
52
52
|
const controller = new AbortController();
|
|
53
|
-
const timeoutId = setTimeout(() => controller.abort(), retryOptions.timeout);
|
|
53
|
+
const timeoutId = setTimeout(() => controller.abort('Fetch is timed out'), retryOptions.timeout);
|
|
54
54
|
fetchOptions.signal = controller.signal;
|
|
55
55
|
try {
|
|
56
56
|
const response = await fetch(resource, fetchOptions);
|