mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
fix: migration issue with old storage #740
time field is not present on some old storage, this will add the time field when a package is published
This commit is contained in:
parent
b26f80f062
commit
e977d50c8a
1 changed files with 6 additions and 0 deletions
|
@ -239,6 +239,12 @@ class LocalStorage implements IStorage {
|
|||
}
|
||||
|
||||
let currentDate = new Date().toISOString();
|
||||
|
||||
// some old storage do not have this field #740
|
||||
if (_.isNil(data.time)) {
|
||||
data.time = {};
|
||||
}
|
||||
|
||||
data.time['modified'] = currentDate;
|
||||
|
||||
if (('created' in data.time) === false) {
|
||||
|
|
Loading…
Add table
Reference in a new issue