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 1bef2ee commit 5d25ac3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-check
import esbuild from "esbuild";
import { copyFile, readFile, writeFile, rm } from "fs/promises";
import { copyFile, readFile, writeFile, rm } from "node:fs/promises";
import { glob } from "glob";

/**
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/node/index.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/parse-request.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 } from "http";
// import { IncomingMessage } from "node:http";
type IncomingMessage = any;

import type { OctokitRequest } from "../types";
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/node/send-response.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 ServerResponse = any;
import type { OctokitResponse } from "../types";

Expand Down
2 changes: 1 addition & 1 deletion test/aws-lambda-api-gateway-v2.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAWSLambdaAPIGatewayV2Handler, OAuthApp } from "../src/";
import { URL } from "url";
import { URL } from "node:url";
import { APIGatewayProxyEventV2 } from "aws-lambda";

describe("createAWSLambdaAPIGatewayV2Handler(app)", () => {
Expand Down
4 changes: 2 additions & 2 deletions test/node-middleware.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createServer, IncomingMessage } from "http";
import { URL } from "url";
import { createServer, IncomingMessage } from "node:http";
import { URL } from "node:url";

import { createNodeMiddleware, OAuthApp } from "../src/";

Expand Down
2 changes: 1 addition & 1 deletion test/web-worker-handler.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { URL } from "url";
import { URL } from "node:url";
import { createWebWorkerHandler, OAuthApp } from "../src";

describe("createWebWorkerHandler(app)", () => {
Expand Down

0 comments on commit 5d25ac3

Please sign in to comment.