mirror of
https://github.com/LukeHagar/crossws.git
synced 2025-12-06 04:19:26 +00:00
attempting to resolve type issues
This commit is contained in:
@@ -66,11 +66,14 @@ export class AdapterHookable {
|
||||
};
|
||||
}
|
||||
} catch (error) {
|
||||
const errResponse = (error as { response: Response }).response || error;
|
||||
if (errResponse instanceof Response) {
|
||||
if (
|
||||
error instanceof Response ||
|
||||
(error && typeof error === "object" && "response" in error && typeof error.response === "function")
|
||||
) {
|
||||
const response = error instanceof Response ? error : (error as { response: () => Response }).response();
|
||||
return {
|
||||
context,
|
||||
endResponse: errResponse,
|
||||
endResponse: response,
|
||||
};
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noEmit": true,
|
||||
"types": ["node", "@cloudflare/workers-types", "deno"]
|
||||
},
|
||||
"include": ["src", "test"]
|
||||
}
|
||||
"types": [
|
||||
"node",
|
||||
"@cloudflare/workers-types",
|
||||
"deno"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user