Skip to content

Commit

Permalink
fix: return time as milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
@jotadeveloper authored and sergiohgz committed Aug 13, 2019
1 parent d9ed04a commit 15467ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/local-storage/src/local-database.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class LocalDatabase implements IPluginStorage {
search(onPackage: Callback, onEnd: Callback, validateName: any): void {
const storages = this._getCustomPackageLocalStorages();
const base = Path.dirname(this.config.self_path);
const self = this;
async.eachSeries(
Object.keys(storages),
function(storage, cb) {
Expand Down Expand Up @@ -113,7 +114,7 @@ class LocalDatabase implements IPluginStorage {
{
name: file,
path: packagePath,
time: stats.mtime.getTime()
time: self._getTime(stats.mtime.getTime(), stats.mtime)
},
cb
);
Expand All @@ -130,6 +131,10 @@ class LocalDatabase implements IPluginStorage {
);
}

_getTime(time: number, mtime: number) {
return time ? time : mtime;
}

_getCustomPackageLocalStorages() {
const storages = {};

Expand Down

0 comments on commit 15467ba

Please sign in to comment.