( path: string, folder: NoteFolder, settings: VaultSettings | null | undefined )
| 789 | } |
| 790 | |
| 791 | export function notePathWithinFolder( |
| 792 | path: string, |
| 793 | folder: NoteFolder, |
| 794 | settings: VaultSettings | null | undefined |
| 795 | ): string { |
| 796 | if (folder === 'inbox' && isPrimaryNotesAtRoot(settings)) return path |
| 797 | const prefix = `${folder}/` |
| 798 | // Case-insensitive so a note under a capitalized on-disk system folder |
| 799 | // (e.g. `Inbox/`) lands in the same subpath as its sibling assets, which use |
| 800 | // the same lenient stripping. Mirrors `assetPathWithinFolder`. (#186) |
| 801 | return path.toLowerCase().startsWith(prefix) ? path.slice(prefix.length) : path |
| 802 | } |
| 803 | |
| 804 | export function noteFolderSubpath( |
| 805 | note: Pick<NoteMeta, 'folder' | 'path'>, |
no test coverage detected