templates/es6/util/connection-resolver.js
function getOffset(cursor, defaultOffset) {
    if (typeof cursor === 'undefined' || cursor === null) {
        return defaultOffset;
    }

    let offset = cursorToOffset(cursor);
    if (isNaN(offset)) {
        return defaultOffset;
    }

    return offset;
}
function getOffset(cursor, defaultOffset) {
    if (typeof cursor === 'undefined' || cursor === null) {
        return defaultOffset;
    }

    let offset = cursorToOffset(cursor);
    if (isNaN(offset)) {
        return defaultOffset;
    }

    return offset;
}
Given an optional cursor and a default offset, returns the offset to use; if the cursor contains a valid offset, that will be used, otherwise it will be the default.