@putkoff/abstract-utilities 0.1.190 → 0.1.191
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/functions/fetch_utils/imports.d.ts +1 -1
- package/dist/functions/fetch_utils/src/fetch_utils.d.ts +0 -15
- package/dist/functions/fetch_utils/src/index.d.ts +1 -0
- package/dist/functions/fetch_utils/src/utils.d.ts +15 -5
- package/package.json +1 -1
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function
|
|
1
|
+
import { FetchVariables } from './../imports';
|
|
2
|
+
/**
|
|
3
|
+
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getResult<T>(obj: unknown): T;
|
|
6
|
+
export declare function getMethod(method?: string | null, body?: unknown): string;
|
|
7
|
+
export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
8
|
+
export declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
9
|
+
export declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
|
|
10
|
+
export declare function parseResult(res: Response): Promise<unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Intercept 401/403 and force a clean redirect to login
|
|
13
|
+
* without ever showing an alert.
|
|
14
|
+
*/
|
|
15
|
+
export declare function checkResponse(res: Response): Response;
|