(pathname: string)
| 21 | } |
| 22 | |
| 23 | const createProjectRoot = (pathname: string): ProjectTree | null => { |
| 24 | const normalizedPathname = normalizeProjectRoot(pathname) |
| 25 | if (!normalizedPathname) return null |
| 26 | |
| 27 | let name = window.path.basename(normalizedPathname) |
| 28 | if (!name) { |
| 29 | // Root directory such as "/" or "C:\" |
| 30 | name = normalizedPathname |
| 31 | } |
| 32 | |
| 33 | return { |
| 34 | pathname: normalizedPathname, |
| 35 | name, |
| 36 | isDirectory: true, |
| 37 | isFile: false, |
| 38 | isMarkdown: false, |
| 39 | folders: [], |
| 40 | files: [] |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | interface BufferedProjectState { |
| 45 | rootDirectory: string |
no test coverage detected