From 3434c88e1243af8cea3cbc8589d02caa2d770dea Mon Sep 17 00:00:00 2001 From: flyinghermit Date: Wed, 11 Dec 2024 15:27:06 -0500 Subject: [PATCH] update ArrayBuffer to ArrayBufferLike --- web/packages/shared/utils/base64/base64-arraybuffer.ts | 2 +- web/packages/shared/utils/base64/base64url-arraybuffer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/packages/shared/utils/base64/base64-arraybuffer.ts b/web/packages/shared/utils/base64/base64-arraybuffer.ts index f100fc3ac898d..90673e77542ce 100644 --- a/web/packages/shared/utils/base64/base64-arraybuffer.ts +++ b/web/packages/shared/utils/base64/base64-arraybuffer.ts @@ -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); diff --git a/web/packages/shared/utils/base64/base64url-arraybuffer.ts b/web/packages/shared/utils/base64/base64url-arraybuffer.ts index 181c63f8032f3..f604d5ac5b835 100644 --- a/web/packages/shared/utils/base64/base64url-arraybuffer.ts +++ b/web/packages/shared/utils/base64/base64url-arraybuffer.ts @@ -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.