Skip to content

Commit

Permalink
fix: Add DATE and VERSION in search result
Browse files Browse the repository at this point in the history
  • Loading branch information
@jotadeveloper authored and sergiohgz committed Aug 13, 2019
1 parent f4a09ce commit e352b75
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/local-storage/src/local-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ class Storage implements IStorage {
const pkg: any = {
'name': version.name,
'description': version.description,
'dist-tags': {latest: latest},
'dist-tags': {latest},
'maintainers': version.maintainers || [version.author].filter(Boolean),
'author': version.author,
'repository': version.repository,
Expand All @@ -645,9 +645,9 @@ class Storage implements IStorage {
'bugs': version.bugs,
'license': version.license,
'time': {
modified: item.time ? new Date(item.time).toISOString() : undefined,
modified: item.time ? new Date(item.time).toISOString() : stats.mtime,
},
'versions': {},
'versions': {[latest]: 'latest'},
};

stream.push(pkg);
Expand All @@ -660,7 +660,9 @@ class Storage implements IStorage {
}
});
}, function on_end(err) {
if (err) return stream.emit('error', err);
if (err) {
return stream.emit('error', err);
}
stream.end();
});

Expand Down

0 comments on commit e352b75

Please sign in to comment.