Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit deadd0c

Browse files
committedFeb 10, 2024
added semicolons where required
1 parent a993938 commit deadd0c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed
 

‎src/debouncedProcessors.ts

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { debounce, Debouncer, MarkdownPostProcessorContext, Menu, Notice, TFile } from "obsidian"
2-
import { v4 as uuidv4 } from "uuid"
3-
import PlantumlPlugin from "./main"
4-
import { Processor } from "./processor"
1+
import { debounce, Debouncer, MarkdownPostProcessorContext, Menu, Notice, TFile } from "obsidian";
2+
import { v4 as uuidv4 } from "uuid";
3+
import PlantumlPlugin from "./main";
4+
import { Processor } from "./processor";
55

66
export class DebouncedProcessors implements Processor {
77

@@ -140,14 +140,14 @@ export class DebouncedProcessors implements Processor {
140140
}
141141

142142
const getFolder = async () => {
143-
let exportPath = this.plugin.settings.exportPath
143+
let exportPath = this.plugin.settings.exportPath;
144144
if (!exportPath.startsWith('/')) {
145145
// relative to the document
146146
const documentPath = this.plugin.app.vault.getAbstractFileByPath(ctx.sourcePath).parent;
147-
exportPath = `${documentPath.path}/${exportPath}`
147+
exportPath = `${documentPath.path}/${exportPath}`;
148148
}
149149

150-
const exists = await this.plugin.app.vault.adapter.exists(exportPath)
150+
const exists = await this.plugin.app.vault.adapter.exists(exportPath);
151151
if (!exists) {
152152
this.plugin.app.vault.createFolder(exportPath);
153153
}
@@ -167,10 +167,10 @@ export class DebouncedProcessors implements Processor {
167167

168168
let fName = fileName;
169169
if (fName.startsWith('/')) {
170-
fName = fName.substring(1)
170+
fName = fName.substring(1);
171171
}
172172

173-
const folderOrFile = this.plugin.app.vault.getAbstractFileByPath(fName)
173+
const folderOrFile = this.plugin.app.vault.getAbstractFileByPath(fName);
174174

175175
if (folderOrFile instanceof TFile) {
176176
return folderOrFile as TFile;
@@ -183,10 +183,10 @@ export class DebouncedProcessors implements Processor {
183183
if (img) {
184184
renderToBlob(img, 'An error occurred while exporting the diagram', async (blob) => {
185185
const filename = await getFilePath('png');
186-
const buffer = await blob.arrayBuffer()
187-
const file = getFile(filename)
186+
const buffer = await blob.arrayBuffer();
187+
const file = getFile(filename);
188188
if (file) {
189-
await this.plugin.app.vault.modifyBinary(file, buffer)
189+
await this.plugin.app.vault.modifyBinary(file, buffer);
190190
} else {
191191
await this.plugin.app.vault.createBinary(filename, buffer);
192192
}
@@ -198,16 +198,16 @@ export class DebouncedProcessors implements Processor {
198198
const saveTextFile = async (type: string, data: string) => {
199199
try {
200200
const filename = await getFilePath(type);
201-
const file = getFile(filename)
201+
const file = getFile(filename);
202202
if (file) {
203203
await this.plugin.app.vault.modify(file, data);
204204
} else {
205-
await this.plugin.app.vault.create(filename, data)
205+
await this.plugin.app.vault.create(filename, data);
206206
}
207207
new Notice(`Diagram exported to '${filename}'`);
208208
} catch (error) {
209209
new Notice('An error occurred while while exporting the diagram');
210-
console.error(error)
210+
console.error(error);
211211
}
212212
}
213213

0 commit comments

Comments
 (0)
Please sign in to comment.