Skip to content

Commit

Permalink
Fixed bug #608: invalid range and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vanodevium committed Nov 7, 2019
1 parent 4f2152d commit c6ff937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/package-managers/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function viewOne(packageName, field, currentVersion) {
*/
function viewMany(packageName, fields, currentVersion) {
if (currentVersion && (!semver.validRange(currentVersion) || versionUtil.isWildCard(currentVersion))) {
return Promise.resolve();
return Promise.resolve({});
}

npmConfig['full-metadata'] = _.includes(fields, 'time');
Expand Down Expand Up @@ -224,7 +224,7 @@ module.exports = {
return viewMany(packageName, ['time', 'versions'], currentVersion)
.then(result => {
const versions = doesSatisfyEnginesNode(result.versions, options.enginesNode);
return Object.keys(result.time).reduce((accum, key) =>
return _.keys(result.time).reduce((accum, key) =>
accum.concat(_.includes(TIME_FIELDS, key) || _.includes(versions, key) ? key : []), []
);
})
Expand Down

0 comments on commit c6ff937

Please sign in to comment.