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