use optional chaining

This commit is contained in:
Bruno Windels 2020-08-19 18:25:38 +02:00
parent a90cebcabb
commit 79363ed1d7

View file

@ -76,8 +76,8 @@ export function iterateCursor(cursorRequest, processValue) {
return; // end of results return; // end of results
} }
const result = processValue(cursor.value, cursor.key); const result = processValue(cursor.value, cursor.key);
const done = result && result.done; const done = result?.done;
const jumpTo = result && result.jumpTo; const jumpTo = result?.jumpTo;
if (done) { if (done) {
resolve(true); resolve(true);