MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / isMarkdownNoteEntry

Function isMarkdownNoteEntry

apps/desktop/src/main/vault.ts:2001–2012  ·  view source on GitHub ↗
(full: string, entry: Dirent)

Source from the content-addressed store, hash-verified

1999// as isSymbolicLink() (never isFile()), so without this stat fallback a
2000// note symlinked into the vault is invisible.
2001async function isMarkdownNoteEntry(full: string, entry: Dirent): Promise<boolean> {
2002 if (!entry.name.toLowerCase().endsWith('.md')) return false
2003 if (entry.isFile()) return true
2004 if (entry.isSymbolicLink()) {
2005 try {
2006 return (await fs.stat(full)).isFile()
2007 } catch {
2008 return false
2009 }
2010 }
2011 return false
2012}
2013
2014// `.excalidraw` drawings are listed alongside notes (so they show in the sidebar
2015// tree); the sidebar/editor route them by extension to the drawing view.

Callers 1

walkFolderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected