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:
@@ -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']))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user