1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Reorder Object.assign

- Respects the dates that may be in input over default dates
 - Respects key and storage over what might be in input
This commit is contained in:
Stefan du Fresne
2017-12-14 13:16:37 +00:00
parent b1063eb38f
commit 745d250787

View File

@@ -66,12 +66,16 @@ function createNote (storageKey, input) {
}
}
}
const noteData = Object.assign({}, {
key,
createdAt: new Date(),
updatedAt: new Date(),
storage: storageKey
}, input)
const noteData = Object.assign({},
{
createdAt: new Date(),
updatedAt: new Date()
},
input, // input may contain more accurate dates
{
key,
storage: storageKey
})
CSON.writeFileSync(path.join(storage.path, 'notes', key + '.cson'), _.omit(noteData, ['key', 'storage']))