import { isMatchingVersion } from '../deps' ; export const render = ( depMap ) => { const allPackages = depMap . deps . concat ( depMap . devDeps ) ; const packageMatchInfos = createMatchInfos ( allPackages ) ; const output = JSON . stringify ( packageMatchInfos , undefined , 2 ) ; console . log ( output ) ; } ; param { IPackageDescriptor [ ] } pkgDescriptor returns { IPackageMatchInfo [ ] } let createMatchInfos = ( pkgDescriptor ) : IPackageMatchInfo [ ] => pkgDescriptor . map ( pkg => ( { name : pkg . name , packageVersion : pkg . parsedDefinedVersion , installedVersion : pkg . installedVersion , matches : isMatchingVersion ( pkg . parsedDefinedVersion , pkg . installedVersion ) , locked : pkg . locked } ) ) ;