@torthu/jacketui-bring 0.2.1 → 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 +1 -1
- package/dist/request-builder-pipe/headers.d.ts +1 -1
- package/dist/request-builder-pipe/jsonBody.d.ts +1 -1
- package/package.json +2 -2
- package/src/bring.ts +1 -1
- package/src/request-builder-pipe/headers.ts +1 -1
- package/src/request-builder-pipe/jsonBody.ts +1 -1
- package/tsconfig.json +12 -2
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, {
|
|
@@ -10,4 +10,4 @@ import { BringInitDecorator } from "../types/BringDecorator";
|
|
|
10
10
|
* @param headers A record of headers to set or a Headers object.
|
|
11
11
|
* @returns BringDecorator
|
|
12
12
|
*/
|
|
13
|
-
export declare const headers: (headers: Record<string, string> | Headers) => BringInitDecorator;
|
|
13
|
+
export declare const headers: (headers: Record<string, string | number> | Headers) => BringInitDecorator;
|
|
@@ -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
|
@@ -12,7 +12,7 @@ import { BringInitDecorator } from "../types/BringDecorator";
|
|
|
12
12
|
* @returns BringDecorator
|
|
13
13
|
*/
|
|
14
14
|
export const headers = (
|
|
15
|
-
headers: Record<string, string> | Headers
|
|
15
|
+
headers: Record<string, string | number> | Headers
|
|
16
16
|
): BringInitDecorator => {
|
|
17
17
|
return (init) => {
|
|
18
18
|
init.headers ??= new Headers();
|
|
@@ -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"],
|