X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Ftypescript%2Fhttp-client-pool%2Fsrc%2Fworker.ts;h=63f77fd753ae02f7e5ac4d29b74a2065487347f5;hb=ef083f7bb73616d1bd9d9069471edcf6dbaec0c7;hp=d9298e3fa6b8fc3a76fc0b291c92d1471e667b6d;hpb=facb41d7d33bd6c11970da5e946c51347824fd54;p=poolifier.git diff --git a/examples/typescript/http-client-pool/src/worker.ts b/examples/typescript/http-client-pool/src/worker.ts index d9298e3f..63f77fd7 100644 --- a/examples/typescript/http-client-pool/src/worker.ts +++ b/examples/typescript/http-client-pool/src/worker.ts @@ -4,14 +4,14 @@ import nodeFetch, { type ResponseInit as NodeFetchRequestInit } from 'node-fetch' import axios from 'axios' -import { type WorkerData, type WorkerResponse } from './types.js' +import type { WorkerData, WorkerResponse } from './types.js' class HttpClientWorker extends ThreadWorker { public constructor () { super({ node_fetch: async (workerData?: WorkerData) => { const response = await nodeFetch( - (workerData as WorkerData).input, + (workerData as WorkerData).input as URL | NodeFetchRequestInfo, workerData?.init as NodeFetchRequestInit ) // The response is not structured-cloneable, so we return the response text body instead.