obsidianmd/obsidian-api

Bug: `FileSystemAdapter.getFilePath` return type is incorrect

mnaoumov opened this issue · 4 comments

According to the documentation

getFilePath(normalizedPath: string): string;

but if you execute in the console

app.vault.adapter.getFilePath('Note.md') instanceof String
false

app.vault.adapter.getFilePath('Note.md') instanceof app.vault.adapter.url.URL
true

Ah that was a mistake in the implementation. Will be fixed in code in the next release, thanks.

@lishid I would like to bring your attention to the fact that you closed this issue on Dec 23 saying that this is going to be fixed in the next release.

Then on Dec 26 you released Obsidian 1.5.3 which still contains the issue

I can't reproduce. It gives me a string in 1.5.3.

Yes, I was wrong that's because I checked incorrectly

app.vault.adapter.getFilePath('Note.md') instanceof String
false

typeof app.vault.adapter.getFilePath('Note.md') === 'string'
true