Skip to content

Commit a62221f

Browse files
BLEnder fix(@types/node): drop bogus BinaryLike cast in emailHashPrefix
emailHashPrefix cast its already-string argument to crypto's BinaryLike before passing it to getSha1, which takes a string. In @types/node 26 that union (string | NodeJS.ArrayBufferView) is no longer accepted where a string is required, breaking tsc for npm-lint, npm-build and the Docker image build. Removed the unnecessary cast and the now-unused BinaryLike import. No behaviour change.
1 parent a692a62 commit a62221f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/app/api/utils/mockUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
import { BinaryLike } from "crypto";
65
import { getSha1 } from "../../../utils/fxa";
76
import { logger } from "../../functions/server/logging";
87

98
export function emailHashPrefix(email: string) {
10-
return getSha1(email as BinaryLike)
9+
return getSha1(email)
1110
.slice(0, 6)
1211
.toUpperCase();
1312
}

0 commit comments

Comments
 (0)