Skip to content

Commit

Permalink
update ArrayBuffer to ArrayBufferLike (#50094)
Browse files Browse the repository at this point in the history
  • Loading branch information
flyinghermit authored Dec 11, 2024
1 parent f32a5d2 commit bbdaaa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/packages/shared/utils/base64/base64-arraybuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ for (let i = 0; i < chars.length; i++) {
lookup[chars.charCodeAt(i)] = i;
}

export const arrayBufferToBase64 = (arraybuffer: ArrayBuffer): string => {
export const arrayBufferToBase64 = (arraybuffer: ArrayBufferLike): string => {
return btoa(
new Uint8Array(arraybuffer).reduce(function (data, byte) {
return data + String.fromCharCode(byte);
Expand Down
2 changes: 1 addition & 1 deletion web/packages/shared/utils/base64/base64url-arraybuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function base64urlToBuffer(base64url: string): ArrayBuffer {
return base64ToArrayBuffer(base64String);
}

export function bufferToBase64url(buffer: ArrayBuffer): string {
export function bufferToBase64url(buffer: ArrayBufferLike): string {
const base64str = arrayBufferToBase64(buffer);

// Assuming the base64str is a well-formed url.
Expand Down

0 comments on commit bbdaaa4

Please sign in to comment.