ngx-unused
Version:
Detect unused classes (components, pipes, services and directives) defined in Angular workspace.
17 lines (16 loc) • 489 B
JavaScript
import { existsSync } from 'fs';
import { stdout } from 'process';
export function getRuntimeConfig(cliArgs) {
return {
tsConfigFilePath: cliArgs.project || '',
sourceRoots: cliArgs._ || [],
decorateOutput: stdout.isTTY,
};
}
export function validate(cliArgs) {
return {
tsConfigFilePath: !!cliArgs.project && existsSync(cliArgs.project),
sourceRoots: !!cliArgs._.length,
valid: !!cliArgs.project && !!cliArgs._.length,
};
}