(dir: string, pathname: string)
| 132 | } |
| 133 | |
| 134 | async function expectProjectFile(dir: string, pathname: string) { |
| 135 | const filePath = path.join(dir, ...pathname.split("/").filter(Boolean)); |
| 136 | const stat = await Deno.stat(filePath); |
| 137 | if (!stat.isFile) { |
| 138 | throw new Error(`Not a project file: ${filePath}`); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | async function expectNotProjectFile(dir: string, pathname: string) { |
| 143 | const filePath = path.join(dir, ...pathname.split("/").filter(Boolean)); |