@torthu/jacketui-bring 0.2.2 → 0.2.4

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(error));
83
+ return resolve(failure(timeoutError));
84
84
  }
85
85
  if (error instanceof Error) {
86
86
  const networkError = new NetworkError(error.message, {
package/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from "./tryFetch";
3
3
  export * from "./errors";
4
4
  export * from "./request-builder-pipe";
5
5
  export * from "./response-pipe";
6
+ export type { BringInit } from "./types/BringInit";
@@ -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: any) => BringInitDecorator;
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.2",
3
+ "version": "0.2.4",
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": "GPL-3.0-only"
23
+ "license": "LGPL-3.0-only"
24
24
  }
package/src/bring.ts CHANGED
@@ -126,7 +126,7 @@ export const bring = (init: BringInit | BringError) => {
126
126
 
127
127
  onTimeout?.(timeoutError);
128
128
  onError?.(timeoutError);
129
- return resolve(failure(error));
129
+ return resolve(failure(timeoutError));
130
130
  }
131
131
 
132
132
  if (error instanceof Error) {
package/src/index.ts CHANGED
@@ -3,3 +3,5 @@ export * from "./tryFetch";
3
3
  export * from "./errors";
4
4
  export * from "./request-builder-pipe";
5
5
  export * from "./response-pipe";
6
+
7
+ export type { BringInit } from "./types/BringInit";
@@ -8,5 +8,5 @@ import { BringInitDecorator } from "../types/BringDecorator";
8
8
  * @returns BringInitDecorator
9
9
  */
10
10
  export const jsonBody =
11
- (body: any): BringInitDecorator =>
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"],