From 9091791a44218c4c773bbee10280543286c70f69 Mon Sep 17 00:00:00 2001 From: Kei Kamikawa Date: Sun, 29 Dec 2024 21:29:18 +0900 Subject: [PATCH] fixed compilation error fixed "Argument of type 'Uint8Array' is not assignable to parameter of type 'ArrayBufferLike'" --- src/base64.ts | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base64.ts b/src/base64.ts index e8b2f27..4f3e8b3 100644 --- a/src/base64.ts +++ b/src/base64.ts @@ -27,4 +27,4 @@ export const decodeBase64 = (str: string): Uint8Array => { }; const jsonUTF8Stringify = (obj: any): Uint8Array => utf8Encoder.encode(JSON.stringify(obj)); -export const encodeObjectBase64Url = (obj: any): string => encodeBase64Url(jsonUTF8Stringify(obj)); +export const encodeObjectBase64Url = (obj: any): string => encodeBase64Url(jsonUTF8Stringify(obj).buffer); diff --git a/tsconfig.json b/tsconfig.json index c807724..1f41d17 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2022", + "target": "esnext", "module": "commonjs", "declaration": true, "moduleResolution": "node",