function isLastChild(node) {
    const t = node.parent.type;

    if (t === "IfStatement" && node.parent.consequent === node && node.parent.alternate) { // before `else` keyword.
        return true;
    }
    if (t === "DoWhileStatement") { // before `while` keyword.
        return true;
    }
    const nodeList = getChildren(node.parent);

    return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc.
}
function isLastChild(node) {
    const t = node.parent.type;

    if (t === "IfStatement" && node.parent.consequent === node && node.parent.alternate) { // before `else` keyword.
        return true;
    }
    if (t === "DoWhileStatement") { // before `while` keyword.
        return true;
    }
    const nodeList = getChildren(node.parent);

    return nodeList !== null && nodeList[nodeList.length - 1] === node; // before `}` or etc.
}
function isLastChild ( node ) { const t = node . parent . type ; if ( t === "IfStatement" && node . parent . consequent === node && node . parent . alternate ) { // before `else` keyword. return true ; } if ( t === "DoWhileStatement" ) { // before `while` keyword. return true ; } const nodeList = getChildren ( node . parent ) ; return nodeList !== null && nodeList [ nodeList . length - 1 ] === node ; // before `}` or etc. }
Check whether a given node is the last statement in the parent block.
@param {Node} node A node to check.
@returns {boolean} `true` if the node is the last statement in the parent block.
Check whether a given node is the last statement in the parent block .
Returns true if node is the last child of the last statement in the list of children