obsidian-api
obsidian-api copied to clipboard
Bug: processFrontMatter does not work if callback deletes all keys
https://docs.obsidian.md/Reference/TypeScript+API/FileManager/processFrontMatter
[!NOTE] I am not a JS/TS developer so my terminology is likely wrong
Steps to reproduce:
await this.app.fileManager.processFrontMatter(
sharedFile.file,
(frontmatter) => {
// Remove the shared link
delete frontmatter["link"];
}
taken from project
if link is the only field in the frontmatter object then this will not do anything. If there are other fields then the link field is correctly deleted
Expected Behaviour
The provided code would delete the link field from the frontmatter regardless of is it leaves the frontmatter empty