1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -17,7 +17,7 @@ const { findStorage } = require('browser/lib/findStorage')
* }
* ```
*/
function reorderFolder (storageKey, oldIndex, newIndex) {
function reorderFolder(storageKey, oldIndex, newIndex) {
let targetStorage
try {
if (!_.isNumber(oldIndex)) throw new Error('oldIndex must be a number.')
@@ -28,15 +28,19 @@ function reorderFolder (storageKey, oldIndex, newIndex) {
return Promise.reject(e)
}
return resolveStorageData(targetStorage)
.then(function reorderFolder (storage) {
storage.folders = _.move(storage.folders, oldIndex, newIndex)
CSON.writeFileSync(path.join(storage.path, 'boostnote.json'), _.pick(storage, ['folders', 'version']))
return resolveStorageData(targetStorage).then(function reorderFolder(
storage
) {
storage.folders = _.move(storage.folders, oldIndex, newIndex)
CSON.writeFileSync(
path.join(storage.path, 'boostnote.json'),
_.pick(storage, ['folders', 'version'])
)
return {
storage
}
})
return {
storage
}
})
}
module.exports = reorderFolder