import { PkgJson } from './workspace' ; param pkgs param pkgJsons export const expandRevDeps = ( pkgs , pkgJsons ) => { let index = 0 ; while ( index < pkgs . length ) { const pkg = pkgs [ index ] ; const found = pkgJsons . filter ( p => ( p . dependencies && p . dependencies [ pkg ] ) || ( p . devDependencies && p . devDependencies [ pkg ] ) ) . map ( p => p . name ) . filter ( p => pkgs . indexOf ( p ) === - 1 ) ; pkgs = pkgs . concat ( found ) ; index ++ ; } return pkgs ; } ;