File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import { encode , decode } from "base64-arraybuffer" ;
22
3+ type Base64Input = ArrayBuffer | ArrayBufferView ;
4+
35/**
46 * @internal
57 */
6- export function _base64URLEncode ( arrayBuffer : ArrayBuffer ) : string {
7- return encode ( arrayBuffer )
8+ export function _base64URLEncode ( input : Base64Input ) : string {
9+ return encode ( input as ArrayBuffer )
810 . replace ( / \/ / g, "_" )
911 . replace ( / \+ / g, "-" )
1012 . replace ( / = + $ / , "" ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ async function windowCryptoSubtleDigest(
77 algorithm : string ,
88 data : Uint8Array
99) : Promise < Uint8Array > {
10- const promiseOrEvent = window . crypto . subtle . digest ( algorithm , data . buffer ) ;
10+ const promiseOrEvent = window . crypto . subtle . digest (
11+ algorithm ,
12+ data . buffer as ArrayBuffer
13+ ) ;
1114 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
1215 if ( promiseOrEvent . then ) {
1316 return promiseOrEvent . then ( ( output : ArrayBuffer ) => {
You can’t perform that action at this time.
0 commit comments