bin scripts: Use destructuring instead of long condition checks

This commit is contained in:
Richard Hansen 2021-01-09 02:28:45 -05:00 committed by John McLear
parent f03c4bd7f7
commit 92cd2cc760
3 changed files with 6 additions and 8 deletions

View file

@ -54,8 +54,8 @@ npm.load({}, async () => {
// console.log('Fetching', revNum)
const revision = await db.get(`pad:${padId}:revs:${revNum}`);
// check if there is a atext in the keyRevisions
if (~keyRevisions.indexOf(revNum) &&
(revision == null || revision.meta == null || revision.meta.atext == null)) {
const {meta: {atext: revAtext} = {}} = revision || {};
if (~keyRevisions.indexOf(revNum) && revAtext == null) {
console.error(`No atext in key revision ${revNum}`);
continue;
}