File tree Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Expand file tree Collapse file tree 4 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1- import { IncomingMessage , ServerResponse } from "http" ;
1+ // remove type imports from http for Deno compatibility
2+ // see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
3+ // import { IncomingMessage, ServerResponse } from "http";
4+ type IncomingMessage = any ;
5+ type ServerResponse = any ;
26
37import { parseRequest } from "./parse-request" ;
48
Original file line number Diff line number Diff line change 1- import { IncomingMessage , ServerResponse } from "http" ;
1+ // remove type imports from http for Deno compatibility
2+ // see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
3+ // import { IncomingMessage, ServerResponse } from "http";
4+ type IncomingMessage = any ;
5+ type ServerResponse = any ;
26
37export function onUnhandledRequestDefault (
48 request : IncomingMessage ,
Original file line number Diff line number Diff line change 1- import { IncomingMessage } from "http" ;
1+ // remove type imports from http for Deno compatibility
2+ // see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
3+ // import { IncomingMessage } from "http";
4+ type IncomingMessage = any ;
25
36// @ts -ignore remove once Node 10 is out maintenance. Replace with Object.fromEntries
47import fromEntries from "fromentries" ;
@@ -41,7 +44,7 @@ export async function parseRequest(
4144 let bodyChunks : Uint8Array [ ] = [ ] ;
4245 request
4346 . on ( "error" , reject )
44- . on ( "data" , ( chunk ) => bodyChunks . push ( chunk ) )
47+ . on ( "data" , ( chunk : Uint8Array ) => bodyChunks . push ( chunk ) )
4548 . on ( "end" , async ( ) => {
4649 const bodyString = Buffer . concat ( bodyChunks ) . toString ( ) ;
4750 if ( ! bodyString ) return resolve ( { headers, query } ) ;
Original file line number Diff line number Diff line change 1- import { IncomingMessage , ServerResponse } from "http" ;
1+ // remove type imports from http for Deno compatibility
2+ // see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
3+ // import { IncomingMessage, ServerResponse } from "http";
4+ type IncomingMessage = any ;
5+ type ServerResponse = any ;
26
37export type MiddlewareOptions = {
48 pathPrefix ?: string ;
You can’t perform that action at this time.
0 commit comments