Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/middleware/node/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { IncomingMessage, ServerResponse } from "http";
// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
// import { IncomingMessage, ServerResponse } from "http";
type IncomingMessage = any;
type ServerResponse = any;

import { parseRequest } from "./parse-request";

Expand Down
6 changes: 5 additions & 1 deletion src/middleware/node/on-unhandled-request-default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { IncomingMessage, ServerResponse } from "http";
// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
// import { IncomingMessage, ServerResponse } from "http";
type IncomingMessage = any;
type ServerResponse = any;

export function onUnhandledRequestDefault(
request: IncomingMessage,
Expand Down
7 changes: 5 additions & 2 deletions src/middleware/node/parse-request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { IncomingMessage } from "http";
// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
// import { IncomingMessage } from "http";
type IncomingMessage = any;

// @ts-ignore remove once Node 10 is out maintenance. Replace with Object.fromEntries
import fromEntries from "fromentries";
Expand Down Expand Up @@ -41,7 +44,7 @@ export async function parseRequest(
let bodyChunks: Uint8Array[] = [];
request
.on("error", reject)
.on("data", (chunk) => bodyChunks.push(chunk))
.on("data", (chunk: Uint8Array) => bodyChunks.push(chunk))
.on("end", async () => {
const bodyString = Buffer.concat(bodyChunks).toString();
if (!bodyString) return resolve({ headers, query });
Expand Down
6 changes: 5 additions & 1 deletion src/middleware/node/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { IncomingMessage, ServerResponse } from "http";
// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
// import { IncomingMessage, ServerResponse } from "http";
type IncomingMessage = any;
type ServerResponse = any;

export type MiddlewareOptions = {
pathPrefix?: string;
Expand Down