( vaultRoot: string | null, relPath: string, )
| 169 | } |
| 170 | |
| 171 | export function absoluteNotePath( |
| 172 | vaultRoot: string | null, |
| 173 | relPath: string, |
| 174 | ): string | null { |
| 175 | if (!vaultRoot) return null; |
| 176 | const segments = relPath.split("/").filter(Boolean); |
| 177 | if (segments.some((segment) => segment === "..")) return null; |
| 178 | return path.join(vaultRoot, ...segments); |
| 179 | } |
| 180 | |
| 181 | export function titleFromPath(relPath: string): string { |
| 182 | const basename = path.posix.basename(relPath); |