(file: string, root: string)
| 61 | } |
| 62 | |
| 63 | function fileToUrl(file: string, root: string) { |
| 64 | const url = path.relative(root, file) |
| 65 | // out of root, use /@fs/ prefix |
| 66 | if (url[0] === '.') { |
| 67 | return path.posix.join(FS_PREFIX, normalizePath(file)) |
| 68 | } |
| 69 | // file within root, create root-relative url |
| 70 | return '/' + normalizePath(url) |
| 71 | } |
| 72 | |
| 73 | async function mapFiles(files: string[], root: string) { |
| 74 | if (!files.length) return [] |
no test coverage detected