Skip to content

Commit 6469f34

Browse files
style: fix prettier formatting issues
1 parent 18fd2f1 commit 6469f34

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/apiClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export default class APIClient {
213213
const encoder = new FormDataEncoder(optionParams.form);
214214
requestOptions.headers = {
215215
...requestOptions.headers,
216-
'content-type': encoder.contentType
216+
'content-type': encoder.contentType,
217217
};
218218
}
219219

src/resources/messages.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,13 @@ export class Messages extends Resource {
326326
const contentId = attachment.contentId || `file${index}`;
327327
// Handle different types of content (Buffer, ReadableStream, string)
328328
let file;
329-
if (attachment.content instanceof Buffer || typeof attachment.content === 'string') {
330-
file = new File([attachment.content], attachment.filename, { type: attachment.contentType });
329+
if (
330+
attachment.content instanceof Buffer ||
331+
typeof attachment.content === 'string'
332+
) {
333+
file = new File([attachment.content], attachment.filename, {
334+
type: attachment.contentType,
335+
});
331336
} else if (attachment.content instanceof ReadableStream) {
332337
// For ReadableStream, we need to read it into a buffer first
333338
const chunks: Buffer[] = [];
@@ -338,7 +343,9 @@ export class Messages extends Resource {
338343
result = await reader.read();
339344
}
340345
const buffer = Buffer.concat(chunks);
341-
file = new File([buffer], attachment.filename, { type: attachment.contentType });
346+
file = new File([buffer], attachment.filename, {
347+
type: attachment.contentType,
348+
});
342349
} else {
343350
throw new Error('Unsupported attachment content type');
344351
}

tests/resources/messages.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jest.mock('formdata-node', () => {
1515
};
1616

1717
this._getAppendedData = (): Record<string, any> => appendedData;
18-
})
18+
}),
1919
};
2020
});
2121

0 commit comments

Comments
 (0)