Switch to double quotes and reformat codebase with Biome
This commit is contained in:
@@ -134,9 +134,7 @@ async function saveDesktopAttachmentFromBase64(input: {
|
||||
|
||||
function assertDesktopAttachment(attachment: AttachmentMetadata): void {
|
||||
if (attachment.storageType !== "desktop-file") {
|
||||
throw new Error(
|
||||
`Unsupported desktop attachment storage type '${attachment.storageType}'.`
|
||||
);
|
||||
throw new Error(`Unsupported desktop attachment storage type '${attachment.storageType}'.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,14 +10,11 @@ export async function writeDesktopAttachmentBase64(input: {
|
||||
base64: string;
|
||||
extension?: string | null;
|
||||
}): Promise<AttachmentFileResult> {
|
||||
return await invokeDesktopCommand<AttachmentFileResult>(
|
||||
"write_attachment_base64",
|
||||
{
|
||||
attachmentId: input.attachmentId,
|
||||
base64: input.base64,
|
||||
extension: input.extension ?? null,
|
||||
}
|
||||
);
|
||||
return await invokeDesktopCommand<AttachmentFileResult>("write_attachment_base64", {
|
||||
attachmentId: input.attachmentId,
|
||||
base64: input.base64,
|
||||
extension: input.extension ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
export async function copyDesktopAttachmentFile(input: {
|
||||
@@ -32,9 +29,7 @@ export async function copyDesktopAttachmentFile(input: {
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteDesktopAttachmentFile(input: {
|
||||
path: string;
|
||||
}): Promise<boolean> {
|
||||
export async function deleteDesktopAttachmentFile(input: { path: string }): Promise<boolean> {
|
||||
return await invokeDesktopCommand<boolean>("delete_attachment_file", {
|
||||
path: input.path,
|
||||
});
|
||||
|
||||
@@ -19,15 +19,10 @@ export async function readDesktopFileBase64(pathOrUri: string): Promise<string>
|
||||
});
|
||||
}
|
||||
|
||||
export async function resolveDesktopPreviewUrl(
|
||||
attachment: AttachmentMetadata
|
||||
): Promise<string> {
|
||||
export async function resolveDesktopPreviewUrl(attachment: AttachmentMetadata): Promise<string> {
|
||||
const base64 = await readDesktopFileBase64(attachment.storageKey);
|
||||
|
||||
if (
|
||||
typeof URL !== "undefined" &&
|
||||
typeof URL.createObjectURL === "function"
|
||||
) {
|
||||
if (typeof URL !== "undefined" && typeof URL.createObjectURL === "function") {
|
||||
const bytes = base64ToUint8Array(base64);
|
||||
const buffer = new ArrayBuffer(bytes.byteLength);
|
||||
new Uint8Array(buffer).set(bytes);
|
||||
@@ -40,9 +35,7 @@ export async function resolveDesktopPreviewUrl(
|
||||
return `data:${attachment.mimeType};base64,${base64}`;
|
||||
}
|
||||
|
||||
export async function releaseDesktopPreviewUrl(input: {
|
||||
url: string;
|
||||
}): Promise<void> {
|
||||
export async function releaseDesktopPreviewUrl(input: { url: string }): Promise<void> {
|
||||
if (!activeObjectUrls.has(input.url)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user