@it-corp/vpbank-spotlight
Version:
Command center components for react and VPbank components
22 lines (17 loc) • 486 B
text/typescript
import { getPackagePaths } from './get-package-paths';
export interface DeclarationPath {
path: string;
type: 'package' | 'file';
}
export function getDeclarationsPaths(paths: DeclarationPath[]): string[] {
return paths.reduce<string[]>((acc, info) => {
if (info.type === 'package') {
const items = getPackagePaths(info.path);
return [...acc, ...items];
}
if (info.type === 'file') {
return [...acc, info.path];
}
return acc;
}, []);
}