fix: cleanup for plugin submission (tasks 9-13)
- Remove unused vault.delete() method in favor of trashFile() - Replace \x00-\x1F with \u0000-\u001F for clearer regex syntax - Verify no unused imports, variables, or scoping issues All cleanup tasks verified with tsc --noUnusedLocals --noUnusedParameters
This commit is contained in:
@@ -34,8 +34,7 @@ export interface IVaultAdapter {
|
||||
// File modification
|
||||
modify(file: TFile, data: string): Promise<void>;
|
||||
|
||||
// File deletion
|
||||
delete(file: TAbstractFile): Promise<void>;
|
||||
// File deletion (respects Obsidian trash settings)
|
||||
trash(file: TAbstractFile, system: boolean): Promise<void>;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,6 @@ export class VaultAdapter implements IVaultAdapter {
|
||||
await this.vault.modify(file, data);
|
||||
}
|
||||
|
||||
async delete(file: TAbstractFile): Promise<void> {
|
||||
await this.vault.delete(file);
|
||||
}
|
||||
|
||||
async trash(file: TAbstractFile, system: boolean): Promise<void> {
|
||||
await this.vault.trash(file, system);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@ export class PathUtils {
|
||||
}
|
||||
|
||||
// Check for invalid characters (Windows restrictions)
|
||||
const invalidChars = /[<>:"|?*\x00-\x1F]/;
|
||||
// Invalid chars: < > : " | ? * and ASCII control characters (0-31)
|
||||
const invalidChars = /[<>:"|?*\u0000-\u001F]/;
|
||||
if (invalidChars.test(normalized)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user