Skip to content

Commit 66ad15a

Browse files
dahliaclaude
andcommitted
Fix Uint8Array to BlobPart type compatibility for TypeScript 5.9
TypeScript 5.9.2 (shipped with Deno 2.6.3) no longer considers Uint8Array directly assignable to BlobPart. This fixes the type error by extracting the underlying ArrayBuffer with slice() before creating the Blob. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 81aafef commit 66ad15a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/jmap/src/jmap-transport.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,12 @@ export class JmapTransport implements Transport {
398398
const content = await attachment.content;
399399

400400
// Create a Blob from the Uint8Array
401-
const blob = new Blob([content], { type: attachment.contentType });
401+
// Extract the ArrayBuffer portion to ensure TypeScript compatibility
402+
const arrayBuffer = content.buffer.slice(
403+
content.byteOffset,
404+
content.byteOffset + content.byteLength,
405+
) as ArrayBuffer;
406+
const blob = new Blob([arrayBuffer], { type: attachment.contentType });
402407

403408
const result = await uploadBlob(
404409
this.config,

0 commit comments

Comments
 (0)