(project: string | string[])
| 9 | } |
| 10 | |
| 11 | export function getProjects(project: string | string[]): Projects { |
| 12 | const list: ProjectData[] = []; |
| 13 | const lookup = new Map<string, ProjectData>(); |
| 14 | |
| 15 | const projectList = expandFilePaths(project); |
| 16 | for (const url of projectList) { |
| 17 | const {name, dir} = path.posix.parse(url); |
| 18 | const metaFile = `${name}.meta`; |
| 19 | const metaData = getMeta(path.join(dir, metaFile)); |
| 20 | const data = {name: metaData?.name ?? name, fileName: name, url}; |
| 21 | list.push(data); |
| 22 | lookup.set(data.name, data); |
| 23 | } |
| 24 | |
| 25 | return {list, lookup}; |
| 26 | } |
| 27 | |
| 28 | function expandFilePaths(filePaths: string[] | string): string[] { |
| 29 | const expandedFilePaths = []; |
no test coverage detected