Skip to content

Commit

Permalink
Use node:buffer explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 committed May 1, 2024
1 parent aa3139a commit f811ffe
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/http-fetch.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Buffer } from "node:buffer";
import { Readable } from "node:stream";
import { HTTPFetchError } from "./exceptions.js";
import { USER_AGENT } from "./version.js";
Expand Down
1 change: 1 addition & 0 deletions lib/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as http from "node:http";
import { Buffer } from "node:buffer";
import { JSONParseError, SignatureValidationFailed } from "./exceptions.js";
import * as Types from "./types.js";
import validateSignature from "./validate-signature.js";
Expand Down
1 change: 1 addition & 0 deletions lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Buffer } from "node:buffer";
import { JSONParseError } from "./exceptions.js";

export function toArray<T>(maybeArr: T | T[]): T[] {
Expand Down
1 change: 1 addition & 0 deletions lib/validate-signature.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Buffer } from "node:buffer";
import { createHmac, timingSafeEqual } from "node:crypto";

function s2b(str: string, encoding: BufferEncoding): Buffer {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
},
"default": "./dist/cjs/index.js"
"default": "./dist/cjs/index.js"
},
"./package.json": "./package.json"
},
Expand Down Expand Up @@ -47,7 +47,6 @@
"docs:preview": "vitepress preview docs",
"docs:deploy": "./scripts/deploy-docs.sh",
"apidocs": "typedoc --excludePrivate --plugin typedoc-plugin-markdown --out docs/apidocs lib/index.ts",
"generate-changelog": "ts-node ./scripts/generate-changelog.ts",
"release": "npm run build && npm publish --access public"
},
"repository": {
Expand Down
1 change: 1 addition & 0 deletions test/client.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { readFileSync } from "node:fs";
import { Buffer } from "node:buffer";
import { join } from "node:path";
import { deepEqual, equal, ok, strictEqual } from "node:assert";
import { URL } from "node:url";
Expand Down
1 change: 1 addition & 0 deletions test/helpers/test-server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as bodyParser from "body-parser";
import { Buffer } from "node:buffer";
import express from "express";
import { Server } from "node:http";
import { join } from "node:path";
Expand Down

0 comments on commit f811ffe

Please sign in to comment.