Skip to content

Commit

Permalink
add dist-tags judge
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Apr 26, 2017
1 parent 9702cac commit 6ab3cd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ exports.get = (name) => {
return request.get(addRegistry(url))
.timeout(exports.timeout)
.then((res) => {
if (_.isEmpty(res.body)) {
if (_.isEmpty(res.body) || !res.body['dist-tags']) {
throw new Error('Can\'t get the module\'s informations');
}
const time = res.body.time;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "npm-apis",
"description": "The client for api of npmjs",
"version": "1.0.1",
"version": "1.0.2",
"author": "Tree Xie <vicansocanbico@gmail.com>",
"keywords": [
"npm",
Expand Down

0 comments on commit 6ab3cd0

Please sign in to comment.