From 112c509b26fd879ee5ce1cf65da9f2b26a6f3490 Mon Sep 17 00:00:00 2001 From: KIRA-L001 <137947115+KIRA-L001@users.noreply.github.com> Date: Mon, 27 Jul 2026 14:36:49 +0530 Subject: [PATCH] fix: drop redundant TextEncoder copy in SDK file writes (closes #36) Signed-off-by: KIRA-L001 <137947115+KIRA-L001@users.noreply.github.com> --- packages/sdk/src/client.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/sdk/src/client.ts b/packages/sdk/src/client.ts index a1521ce..fb7f97d 100644 --- a/packages/sdk/src/client.ts +++ b/packages/sdk/src/client.ts @@ -580,11 +580,7 @@ export class Dormice { name, files: files.map((file) => ({ path: file.path, - contentBase64: Buffer.from( - typeof file.content === 'string' - ? new TextEncoder().encode(file.content) - : file.content, - ).toString('base64'), + contentBase64: Buffer.from(file.content).toString('base64'), })), }); return writeFilesResponseSchema.parse(data); @@ -602,11 +598,7 @@ export class Dormice { const data = await this.rpc('writeFile', { name, path, - contentBase64: Buffer.from( - typeof content === 'string' - ? new TextEncoder().encode(content) - : content, - ).toString('base64'), + contentBase64: Buffer.from(content).toString('base64'), }); return writeFileResponseSchema.parse(data); }