(fromFile: string, spec: string)
| 170 | } |
| 171 | |
| 172 | const resolveLocalPath = async (fromFile: string, spec: string) => { |
| 173 | const base = path.dirname(fromFile) |
| 174 | const candidates = [ |
| 175 | path.resolve(base, `${spec}.tsx`), |
| 176 | path.resolve(base, `${spec}.ts`), |
| 177 | path.resolve(base, `${spec}/index.tsx`), |
| 178 | path.resolve(base, `${spec}/index.ts`), |
| 179 | ] |
| 180 | for (const c of candidates) if (await exists(c)) return c |
| 181 | return null |
| 182 | } |
| 183 | |
| 184 | const resolveWithin = async (baseDir: string, rel: string) => { |
| 185 | const clean = rel.replace(/^\/+/, '') |
no test coverage detected