xsfetch 0.1.0-beta.4 → 0.1.0-beta.6
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/dist/index.js +7 -4
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
// ../utils-stream/src/_sleep.ts
|
|
2
|
+
var sleep = async (delay) => delay === 0 ? Promise.resolve() : new Promise((resolve) => setTimeout(resolve, delay));
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
// src/index.ts
|
|
5
|
+
var createFetch = (userOptions) => {
|
|
4
6
|
const options = {
|
|
5
7
|
retry: 3,
|
|
6
8
|
retryCount: 0,
|
|
@@ -28,5 +30,6 @@ const createFetch = (userOptions) => {
|
|
|
28
30
|
return res;
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
export {
|
|
34
|
+
createFetch
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xsfetch",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-beta.
|
|
4
|
+
"version": "0.1.0-beta.6",
|
|
5
5
|
"description": "extra-small Fetch API with auto retry.",
|
|
6
6
|
"author": "Moeru AI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
".": {
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
23
|
"default": "./dist/index.js"
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
25
26
|
},
|
|
26
|
-
"main": "./dist/index.js",
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
28
27
|
"files": [
|
|
29
28
|
"dist"
|
|
30
29
|
],
|
|
31
30
|
"scripts": {
|
|
32
|
-
"build": "
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
"build": "tsup"
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist/index.js",
|
|
34
|
+
"types": "./dist/index.d.ts"
|
|
35
35
|
}
|