mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-03-25 02:32:52 -05:00
Fix #73 Add time property to deliver uplink last modified package
This commit is contained in:
parent
9fdc251b83
commit
8fbf77a76d
2 changed files with 11 additions and 1 deletions
lib
|
@ -364,7 +364,7 @@ class Storage {
|
|||
|
||||
this._sync_package_with_uplinks(name, data, options, function(err, result, uplink_errors) {
|
||||
if (err) return callback(err);
|
||||
const whitelist = ['_rev', 'name', 'versions', 'dist-tags', 'readme'];
|
||||
const whitelist = ['_rev', 'name', 'versions', 'dist-tags', 'readme', 'time'];
|
||||
for (let i in result) {
|
||||
if (whitelist.indexOf(i) === -1) {
|
||||
delete result[i];
|
||||
|
@ -541,6 +541,11 @@ class Storage {
|
|||
fetched: Date.now(),
|
||||
};
|
||||
|
||||
// added to fix verdaccio#73
|
||||
if ('time' in upLinkResponse) {
|
||||
packageInfo['time'] = upLinkResponse.time;
|
||||
}
|
||||
|
||||
for (let i in upLinkResponse.versions) {
|
||||
if (Object.prototype.hasOwnProperty.call(upLinkResponse.versions, i)) {
|
||||
// this won't be serialized to json,
|
||||
|
|
|
@ -218,6 +218,11 @@ class LocalStorage {
|
|||
change = true;
|
||||
}
|
||||
|
||||
if ('time' in packageInfo) {
|
||||
packageLocalJson.time = packageInfo.time;
|
||||
change = true;
|
||||
}
|
||||
|
||||
if (change) {
|
||||
this.logger.debug('updating package info');
|
||||
this._writePackage(name, packageLocalJson, function(err) {
|
||||
|
|
Loading…
Add table
Reference in a new issue