From deadd0c3990115a42d648b395eabc3a1d5401b1d Mon Sep 17 00:00:00 2001 From: Sean Garrett Date: Sat, 10 Feb 2024 20:19:36 +0000 Subject: [PATCH] added semicolons where required --- src/debouncedProcessors.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/debouncedProcessors.ts b/src/debouncedProcessors.ts index adf5c31..0373491 100644 --- a/src/debouncedProcessors.ts +++ b/src/debouncedProcessors.ts @@ -1,7 +1,7 @@ -import { debounce, Debouncer, MarkdownPostProcessorContext, Menu, Notice, TFile } from "obsidian" -import { v4 as uuidv4 } from "uuid" -import PlantumlPlugin from "./main" -import { Processor } from "./processor" +import { debounce, Debouncer, MarkdownPostProcessorContext, Menu, Notice, TFile } from "obsidian"; +import { v4 as uuidv4 } from "uuid"; +import PlantumlPlugin from "./main"; +import { Processor } from "./processor"; export class DebouncedProcessors implements Processor { @@ -140,14 +140,14 @@ export class DebouncedProcessors implements Processor { } const getFolder = async () => { - let exportPath = this.plugin.settings.exportPath + let exportPath = this.plugin.settings.exportPath; if (!exportPath.startsWith('/')) { // relative to the document const documentPath = this.plugin.app.vault.getAbstractFileByPath(ctx.sourcePath).parent; - exportPath = `${documentPath.path}/${exportPath}` + exportPath = `${documentPath.path}/${exportPath}`; } - const exists = await this.plugin.app.vault.adapter.exists(exportPath) + const exists = await this.plugin.app.vault.adapter.exists(exportPath); if (!exists) { this.plugin.app.vault.createFolder(exportPath); } @@ -167,10 +167,10 @@ export class DebouncedProcessors implements Processor { let fName = fileName; if (fName.startsWith('/')) { - fName = fName.substring(1) + fName = fName.substring(1); } - const folderOrFile = this.plugin.app.vault.getAbstractFileByPath(fName) + const folderOrFile = this.plugin.app.vault.getAbstractFileByPath(fName); if (folderOrFile instanceof TFile) { return folderOrFile as TFile; @@ -183,10 +183,10 @@ export class DebouncedProcessors implements Processor { if (img) { renderToBlob(img, 'An error occurred while exporting the diagram', async (blob) => { const filename = await getFilePath('png'); - const buffer = await blob.arrayBuffer() - const file = getFile(filename) + const buffer = await blob.arrayBuffer(); + const file = getFile(filename); if (file) { - await this.plugin.app.vault.modifyBinary(file, buffer) + await this.plugin.app.vault.modifyBinary(file, buffer); } else { await this.plugin.app.vault.createBinary(filename, buffer); } @@ -198,16 +198,16 @@ export class DebouncedProcessors implements Processor { const saveTextFile = async (type: string, data: string) => { try { const filename = await getFilePath(type); - const file = getFile(filename) + const file = getFile(filename); if (file) { await this.plugin.app.vault.modify(file, data); } else { - await this.plugin.app.vault.create(filename, data) + await this.plugin.app.vault.create(filename, data); } new Notice(`Diagram exported to '${filename}'`); } catch (error) { new Notice('An error occurred while while exporting the diagram'); - console.error(error) + console.error(error); } }