( relPath: string, settings: VaultSettings | null | undefined )
| 1220 | } |
| 1221 | |
| 1222 | export function folderForVaultRelativePath( |
| 1223 | relPath: string, |
| 1224 | settings: VaultSettings | null | undefined |
| 1225 | ): NoteFolder | null { |
| 1226 | const normalized = relPath.replace(/\\/g, '/').replace(/^\/+/, '') |
| 1227 | const top = normalized.split('/')[0] ?? '' |
| 1228 | if (!top || top.startsWith('.')) return null |
| 1229 | const system = systemFolderForTopSegment(top) |
| 1230 | if (system) return system |
| 1231 | if (isPrimaryNotesAtRoot(settings) && !RESERVED_ROOT_NAMES.has(top.toLowerCase())) return 'inbox' |
| 1232 | return null |
| 1233 | } |
| 1234 | |
| 1235 | export function assetPathWithinFolder( |
| 1236 | assetPath: string, |
no test coverage detected