@hkdigital/lib-sveltekit 0.0.69 → 0.0.70
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.
@@ -85,12 +85,4 @@ export function httpPost({ url, body, headers, requestHandler, timeoutMs }: stri
|
|
85
85
|
* @returns {Promise<*>} responsePromise
|
86
86
|
*/
|
87
87
|
export function httpRequest({ method, url, urlSearchParams, body, headers, requestHandler, timeoutMs }: string | URL): Promise<any>;
|
88
|
-
/**
|
89
|
-
* Get the response size from the content-length response header
|
90
|
-
*
|
91
|
-
* @param {Response} response
|
92
|
-
*
|
93
|
-
* @returns {number} response size or 0 if unknown
|
94
|
-
*/
|
95
|
-
export function getResponseSize(response: Response): number;
|
96
88
|
export type requestHandler = (controller: AbortController, abort: (reason?: Error) => void, timeout: (delayMs: number) => void) => any;
|
@@ -268,20 +268,3 @@ export async function httpRequest({
|
|
268
268
|
// response promise
|
269
269
|
return promise;
|
270
270
|
}
|
271
|
-
|
272
|
-
/**
|
273
|
-
* Get the response size from the content-length response header
|
274
|
-
*
|
275
|
-
* @param {Response} response
|
276
|
-
*
|
277
|
-
* @returns {number} response size or 0 if unknown
|
278
|
-
*/
|
279
|
-
export function getResponseSize(response) {
|
280
|
-
const sizeStr = response.headers.get(CONTENT_LENGTH);
|
281
|
-
|
282
|
-
if (!sizeStr) {
|
283
|
-
return 0;
|
284
|
-
}
|
285
|
-
|
286
|
-
return parseInt(sizeStr, 10);
|
287
|
-
}
|