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
}
const result = processValue(cursor.value, cursor.key);
const done = result && result.done;
const jumpTo = result && result.jumpTo;
const done = result?.done;
const jumpTo = result?.jumpTo;
if (done) {
resolve(true);