X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-client-pool%2Fsrc%2Fworker.ts;h=1e89761f9439cb019e271de8620f1d52b0f1e67d;hb=7a483900c5ff3c20c9f08c633b805caf9ffd8ab1;hp=63f77fd753ae02f7e5ac4d29b74a2065487347f5;hpb=76a3a76becd6ac41efb3271c708431a666828c30;p=poolifier.git diff --git a/examples/typescript/http-client-pool/src/worker.ts b/examples/typescript/http-client-pool/src/worker.ts index 63f77fd7..1e89761f 100644 --- a/examples/typescript/http-client-pool/src/worker.ts +++ b/examples/typescript/http-client-pool/src/worker.ts @@ -11,7 +11,7 @@ class HttpClientWorker extends ThreadWorker { super({ node_fetch: async (workerData?: WorkerData) => { const response = await nodeFetch( - (workerData as WorkerData).input as URL | NodeFetchRequestInfo, + workerData!.input as URL | NodeFetchRequestInfo, workerData?.init as NodeFetchRequestInit ) // The response is not structured-cloneable, so we return the response text body instead. @@ -21,7 +21,7 @@ class HttpClientWorker extends ThreadWorker { }, fetch: async (workerData?: WorkerData) => { const response = await fetch( - (workerData as WorkerData).input as URL | RequestInfo, + workerData!.input as URL | RequestInfo, workerData?.init as RequestInit ) // The response is not structured-cloneable, so we return the response text body instead. @@ -32,7 +32,7 @@ class HttpClientWorker extends ThreadWorker { axios: async (workerData?: WorkerData) => { const response = await axios({ method: 'get', - url: (workerData as WorkerData).input as string, + url: workerData!.input as string, ...workerData?.axiosRequestConfig }) return {