Skip to content

fix: replace crypto.BinaryLike with Buffer in KeyUtils for @types/nod…#354

Open
aharoitx wants to merge 1 commit into
8.0.xfrom
fix/keyutils-types-node-26
Open

fix: replace crypto.BinaryLike with Buffer in KeyUtils for @types/nod…#354
aharoitx wants to merge 1 commit into
8.0.xfrom
fix/keyutils-types-node-26

Conversation

@aharoitx

@aharoitx aharoitx commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Problem

Dependabot's @types/node 25 → 26 bump (#352, previously #346) fails CI:
all jobs run npm run build, and tsc errors with:

src/util/KeyUtils.ts(43,52): error TS2345: Argument of type 'BinaryLike' is not
assignable to parameter of type 'string | ArrayBufferView<ArrayBufferLike>'.
src/util/KeyUtils.ts(50,51): error TS2345: (same)

In @types/node 26, crypto.Hash.update() no longer accepts a plain
ArrayBuffer, which the crypto.BinaryLike type includes.

Solution

Type the two private helpers in KeyUtils (and one local variable) as Buffer
instead of crypto.BinaryLikeBuffer is what they actually receive from
their only call sites. Type-only change; the emitted JavaScript is identical.

Verification

  • npm run build passes with both @types/node 25.9.3 (current) and 26.1.0
  • npm run unit: 55/55 tests pass, identical results before/after
  • format:ci and lint pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants