Fix npm command dependencies variable

merge-requests/12/head
DedShot™#9195 2020-05-01 15:16:33 -04:00 committed by Bsian
parent 08cf69173e
commit c9d39fff4c
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ export default class NPM extends Command {
license = data.license;
}
let dependencies: string = 'None';
if (version !== 'Unknown' && data.versions[version].dependencies) {
if (version !== 'Unknown' && data.versions[version].hasOwnProperty('dependencies') && Object.keys(data.versions[version].dependencies).length > 0) {
dependencies = Object.keys(data.versions[version].dependencies).join(', ');
}
const name: string = data.name || 'None';