Skip to content

Commit 3830923

Browse files
committed
Remove remaining await Promise.resolve()
1 parent e110541 commit 3830923

6 files changed

Lines changed: 10 additions & 18 deletions

File tree

src/processors/applePanelsProcessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class ApplePanelsProcessor extends BaseProcessor {
220220
async loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree> {
221221
const { readBinaryFromInput, readTextFromInput, pathExists, getFileSize, join } =
222222
this.options.fileAdapter;
223-
await Promise.resolve();
223+
224224
const filename =
225225
typeof filePathOrBuffer === 'string' ? getBasename(filePathOrBuffer) : 'upload.plist';
226226
let buffer: Uint8Array;
@@ -477,7 +477,7 @@ class ApplePanelsProcessor extends BaseProcessor {
477477

478478
async saveFromTree(tree: AACTree, outputPath: string): Promise<void> {
479479
const { writeTextToPath, pathExists, mkDir, join, dirname } = this.options.fileAdapter;
480-
await Promise.resolve();
480+
481481
// Support two output modes:
482482
// 1) Single-file .plist (PanelDefinitions.plist content written directly)
483483
// 2) Apple Panels bundle folder (*.ascconfig) with Contents/Resources structure

src/processors/astericsGridProcessor.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ class AstericsGridProcessor extends BaseProcessor {
841841

842842
async loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree> {
843843
const { readBinaryFromInput, readTextFromInput } = this.options.fileAdapter;
844-
await Promise.resolve();
844+
845845
const tree = new AACTree();
846846
const filename =
847847
typeof filePathOrBuffer === 'string' ? getBasename(filePathOrBuffer) : 'upload.grd';
@@ -1307,7 +1307,7 @@ class AstericsGridProcessor extends BaseProcessor {
13071307
outputPath: string
13081308
): Promise<Uint8Array> {
13091309
const { readTextFromInput, readBinaryFromInput, writeTextToPath } = this.options.fileAdapter;
1310-
await Promise.resolve();
1310+
13111311
let content = await readTextFromInput(filePathOrBuffer);
13121312

13131313
// Remove BOM if present
@@ -1444,7 +1444,7 @@ class AstericsGridProcessor extends BaseProcessor {
14441444

14451445
async saveFromTree(tree: AACTree, outputPath: string): Promise<void> {
14461446
const { writeTextToPath } = this.options.fileAdapter;
1447-
await Promise.resolve();
1447+
14481448
// Use default Asterics Grid styling instead of taking from first page
14491449
// This prevents issues where the first page has unusual colors (like purple)
14501450
const defaultPageStyle = {

src/processors/dotProcessor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class DotProcessor extends BaseProcessor {
8383

8484
async extractTexts(filePathOrBuffer: ProcessorInput): Promise<string[]> {
8585
const { readTextFromInput } = this.options.fileAdapter;
86-
await Promise.resolve();
86+
8787
const content = await readTextFromInput(filePathOrBuffer);
8888

8989
const { nodes, edges } = this.parseDotFile(content);
@@ -106,7 +106,7 @@ class DotProcessor extends BaseProcessor {
106106

107107
async loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree> {
108108
const { readBinaryFromInput, readTextFromInput } = this.options.fileAdapter;
109-
await Promise.resolve();
109+
110110
const filename =
111111
typeof filePathOrBuffer === 'string' ? getBasename(filePathOrBuffer) : 'upload.dot';
112112
const buffer = await readBinaryFromInput(filePathOrBuffer);
@@ -213,7 +213,7 @@ class DotProcessor extends BaseProcessor {
213213
outputPath: string
214214
): Promise<Uint8Array> {
215215
const { readTextFromInput, writeBinaryToPath } = this.options.fileAdapter;
216-
await Promise.resolve();
216+
217217
const content = await readTextFromInput(filePathOrBuffer);
218218
let translatedContent = content;
219219

@@ -237,7 +237,7 @@ class DotProcessor extends BaseProcessor {
237237

238238
async saveFromTree(tree: AACTree, _outputPath: string): Promise<void> {
239239
const { writeTextToPath } = this.options.fileAdapter;
240-
await Promise.resolve();
240+
241241
let dotContent = `digraph "${tree.metadata?.name || 'AACBoard'}" {\n`;
242242

243243
// Helper to escape DOT string

src/processors/excelProcessor.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class ExcelProcessor extends BaseProcessor {
2323
* @returns Array of all text content found in the Excel file
2424
*/
2525
async extractTexts(_filePathOrBuffer: ProcessorInput): Promise<string[]> {
26-
await Promise.resolve();
26+
2727
console.warn('ExcelProcessor.extractTexts is not implemented yet.');
2828
return [];
2929
}
@@ -34,7 +34,6 @@ export class ExcelProcessor extends BaseProcessor {
3434
* @returns AACTree representation of the Excel file
3535
*/
3636
async loadIntoTree(_filePathOrBuffer: ProcessorInput): Promise<AACTree> {
37-
await Promise.resolve();
3837
console.warn('ExcelProcessor.loadIntoTree is not implemented yet.');
3938
const tree = new AACTree();
4039
tree.metadata.format = 'excel';
@@ -54,7 +53,6 @@ export class ExcelProcessor extends BaseProcessor {
5453
outputPath: string
5554
): Promise<Uint8Array> {
5655
const { dirname, pathExists, mkDir } = this.options.fileAdapter;
57-
await Promise.resolve();
5856
console.warn('ExcelProcessor.processTexts is not implemented yet.');
5957
const outputDir = dirname(outputPath);
6058
if (!(await pathExists(outputDir))) {

src/processors/obfsetProcessor.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export class ObfsetProcessor extends BaseProcessor {
6363
*/
6464
async loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree> {
6565
const { readTextFromInput } = this.options.fileAdapter;
66-
await Promise.resolve();
6766
const tree = new AACTree();
6867
tree.metadata.format = 'obfset';
6968
const content = await readTextFromInput(filePathOrBuffer);
@@ -211,15 +210,13 @@ export class ObfsetProcessor extends BaseProcessor {
211210
_translations: Map<string, string>,
212211
_outputPath: string
213212
): Promise<Uint8Array> {
214-
await Promise.resolve();
215213
throw new Error('processTexts is not supported for .obfset currently');
216214
}
217215

218216
/**
219217
* Save tree structure back to file
220218
*/
221219
async saveFromTree(_tree: AACTree, _outputPath: string): Promise<void> {
222-
await Promise.resolve();
223220
throw new Error('saveFromTree is not supported for .obfset currently');
224221
}
225222

src/processors/snapProcessor.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ class SnapProcessor extends BaseProcessor {
121121

122122
async loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree> {
123123
const { writeBinaryToPath, removePath, mkTempDir, basename, join } = this.options.fileAdapter;
124-
await Promise.resolve();
125124
const tree = new AACTree();
126125
let dbResult: Awaited<ReturnType<typeof openSqliteDatabase>> | null = null;
127126
let cleanupTempZip: (() => Promise<void>) | null = null;
@@ -970,7 +969,6 @@ class SnapProcessor extends BaseProcessor {
970969
if (!isNodeRuntime()) {
971970
throw new Error('saveFromTree is only supported in Node.js environments for Snap files.');
972971
}
973-
await Promise.resolve();
974972
const outputDir = dirname(outputPath);
975973
const dirExists = await pathExists(outputDir);
976974
if (!dirExists) {
@@ -1283,7 +1281,6 @@ class SnapProcessor extends BaseProcessor {
12831281
audioData: Uint8Array,
12841282
metadata?: string
12851283
): Promise<number> {
1286-
await Promise.resolve();
12871284
if (!isNodeRuntime()) {
12881285
throw new Error('addAudioToButton is only supported in Node.js environments.');
12891286
}

0 commit comments

Comments
 (0)