mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 10:16:26 +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({}, {
|
const noteData = Object.assign({},
|
||||||
key,
|
{
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
updatedAt: new Date(),
|
updatedAt: new Date()
|
||||||
|
},
|
||||||
|
input, // input may contain more accurate dates
|
||||||
|
{
|
||||||
|
key,
|
||||||
storage: storageKey
|
storage: storageKey
|
||||||
}, input)
|
})
|
||||||
|
|
||||||
CSON.writeFileSync(path.join(storage.path, 'notes', key + '.cson'), _.omit(noteData, ['key', 'storage']))
|
CSON.writeFileSync(path.join(storage.path, 'notes', key + '.cson'), _.omit(noteData, ['key', 'storage']))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user