Skip to content

Commit

Permalink
refactor: replace NodeJS internal module imports with node: specifi…
Browse files Browse the repository at this point in the history
…er imports
  • Loading branch information
wolfy1339 committed Nov 26, 2023
1 parent 8423803 commit eb7b9c1
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
Empty file modified scripts/generate-types.ts
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion src/middleware/node/get-missing-headers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
// import { IncomingMessage } from "http";
// import { IncomingMessage } from "node:http";
type IncomingMessage = any;

const WEBHOOK_HEADERS = [
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/node/get-payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import AggregateError from "aggregate-error";

// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/24#issuecomment-817361886
// import { IncomingMessage } from "http";
// import { IncomingMessage } from "node:http";
// declare module "http" {
// interface IncomingMessage {
// body?: WebhookEvent | unknown;
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/node/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// remove type imports from http for Deno compatibility
// see https://github.com/octokit/octokit.js/issues/2075#issuecomment-817361886
// import { IncomingMessage, ServerResponse } from "http";
// import { IncomingMessage, ServerResponse } from "node:http";
type IncomingMessage = any;
type ServerResponse = any;

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

Expand Down
2 changes: 1 addition & 1 deletion test/typescript-validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
WebhookError,
createNodeMiddleware,
} from "../src/index.ts";
import { createServer } from "http";
import { createServer } from "node:http";
import type {
HandlerFunction,
RemoveHandlerFunction,
Expand Down

0 comments on commit eb7b9c1

Please sign in to comment.