MCPcopy Index your code
hub / github.com/midrender/revideo / getProjects

Function getProjects

packages/vite-plugin/src/utils.ts:11–26  ·  view source on GitHub ↗
(project: string | string[])

Source from the content-addressed store, hash-verified

9}
10
11export 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
28function expandFilePaths(filePaths: string[] | string): string[] {
29 const expandedFilePaths = [];

Callers 1

main.tsFile · 0.90

Calls 4

expandFilePathsFunction · 0.85
getMetaFunction · 0.85
setMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected