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

@ -62,15 +62,13 @@ npm.load({}, async () => {
if (pad.pool == null) throw new Error('Attribute pool is missing');
// check if there is an atext in the keyRevisions
if (revisions[keyRev] == null ||
revisions[keyRev].meta == null ||
revisions[keyRev].meta.atext == null) {
let {meta: {atext} = {}} = revisions[keyRev] || {};
if (atext == null) {
console.error(`No atext in key revision ${keyRev}`);
continue;
}
const apool = pad.pool;
let atext = revisions[keyRev].meta.atext;
for (let rev = keyRev + 1; rev <= keyRev + 100 && rev <= head; rev++) {
checkRevisionCount++;