From b5dd65419466e5e575076a4d924f8853264d50a6 Mon Sep 17 00:00:00 2001 From: granitosaurus Date: Tue, 17 Sep 2024 14:59:19 +0700 Subject: [PATCH] replace nodejs Buffer API with cross platform Uint8Array --- src/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.ts b/src/client.ts index bde510e..2b2da73 100644 --- a/src/client.ts +++ b/src/client.ts @@ -124,7 +124,7 @@ export class ScrapflyClient { } if (format === 'blob') { - content = Buffer.from(await response.arrayBuffer()); + content = new Uint8Array(await response.arrayBuffer()); result.format = 'binary'; } @@ -306,6 +306,7 @@ export class ScrapflyClient { } const content = new Uint8Array(result.image); + // Use Deno's write file method await writeFile(file_path, content); }