@torthu/jacketui-bring 0.2.2 → 0.2.3
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/bring.js
CHANGED
|
@@ -80,7 +80,7 @@ export const bring = (init) => {
|
|
|
80
80
|
});
|
|
81
81
|
onTimeout?.(timeoutError);
|
|
82
82
|
onError?.(timeoutError);
|
|
83
|
-
return resolve(failure(
|
|
83
|
+
return resolve(failure(timeoutError));
|
|
84
84
|
}
|
|
85
85
|
if (error instanceof Error) {
|
|
86
86
|
const networkError = new NetworkError(error.message, {
|
|
@@ -6,4 +6,4 @@ import { BringInitDecorator } from "../types/BringDecorator";
|
|
|
6
6
|
* @param body Any JSON serializable value
|
|
7
7
|
* @returns BringInitDecorator
|
|
8
8
|
*/
|
|
9
|
-
export declare const jsonBody: (body:
|
|
9
|
+
export declare const jsonBody: <BodyType = any>(body: BodyType) => BringInitDecorator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@torthu/jacketui-bring",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Improved fetch API with retry, timeout, and more.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"build": "rimraf ./dist && tsc",
|
|
21
21
|
"test": "vitest run"
|
|
22
22
|
},
|
|
23
|
-
"license": "
|
|
23
|
+
"license": "LGPL-3.0-only"
|
|
24
24
|
}
|
package/src/bring.ts
CHANGED
|
@@ -8,5 +8,5 @@ import { BringInitDecorator } from "../types/BringDecorator";
|
|
|
8
8
|
* @returns BringInitDecorator
|
|
9
9
|
*/
|
|
10
10
|
export const jsonBody =
|
|
11
|
-
(body:
|
|
11
|
+
<BodyType = any>(body: BodyType): BringInitDecorator =>
|
|
12
12
|
(init) => ({ ...init, body: JSON.stringify(body) });
|
package/tsconfig.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"extends": "../../tsconfig.common.json",
|
|
4
3
|
|
|
5
4
|
"compilerOptions": {
|
|
6
|
-
"outDir": "dist"
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"target": "ES2022",
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"module": "ES6",
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"noImplicitAny": true,
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"jsx": "react-jsx",
|
|
16
|
+
"declaration": true
|
|
7
17
|
},
|
|
8
18
|
|
|
9
19
|
"include": ["src/**/*.ts", "src/**/*.tsx"],
|