MCPcopy
hub / github.com/compodoc/compodoc / loadCliConfiguration

Function loadCliConfiguration

src/app/cli/config-loader.ts:28–52  ·  view source on GitHub ↗
(
    configPath: string | undefined,
    workingDirectory: string
)

Source from the content-addressed store, hash-verified

26}
27
28export function loadCliConfiguration(
29 configPath: string | undefined,
30 workingDirectory: string
31): LoadedCliConfiguration {
32 const configExplorer = cosmiconfigSync(cosmiconfigModuleName);
33 let configExplorerResult: CosmiconfigResult | null;
34
35 if (configPath) {
36 let normalizedConfigPath = configPath;
37 const matchesWorkingDirectory = normalizedConfigPath.match(workingDirectory);
38
39 if (matchesWorkingDirectory && matchesWorkingDirectory.length > 0) {
40 normalizedConfigPath = normalizedConfigPath.replace(workingDirectory + path.sep, '');
41 }
42
43 configExplorerResult = configExplorer.load(path.resolve(normalizedConfigPath));
44 } else {
45 configExplorerResult = configExplorer.search();
46 }
47
48 return {
49 configFile: configExplorerResult?.config ?? {},
50 configExplorerResult
51 };
52}
53
54export function normalizePatternList(patterns: unknown): string[] {
55 if (!patterns) {

Callers 1

startMethod · 0.90

Calls 3

matchMethod · 0.80
loadMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…