MCPcopy Index your code
hub / github.com/Waishnav/devspace / parseAllowedRoots

Function parseAllowedRoots

src/config.ts:43–57  ·  view source on GitHub ↗
(value: string | string[] | undefined)

Source from the content-addressed store, hash-verified

41}
42
43function parseAllowedRoots(value: string | string[] | undefined): string[] {
44 if (Array.isArray(value)) {
45 const roots = value.map((entry) => entry.trim()).filter(Boolean);
46 return (roots.length > 0 ? roots : [process.cwd()]).map((root) => resolve(expandHomePath(root)));
47 }
48
49 const rawRoots =
50 value
51 ?.split(",")
52 .map((entry) => entry.trim())
53 .filter(Boolean) ?? [];
54
55 const roots = rawRoots.length > 0 ? rawRoots : [process.cwd()];
56 return roots.map((root) => resolve(expandHomePath(root)));
57}
58
59function parseAllowedHosts(value: string | string[] | undefined, derivedHosts: string[]): string[] {
60 if (Array.isArray(value)) {

Callers 1

loadConfigFunction · 0.85

Calls 1

expandHomePathFunction · 0.85

Tested by

no test coverage detected