lib/rules/max-empty-lines/index.js
function isEofNode(document, root) {
  if (!document || document.constructor.name !== "Document") {
    return true;
  }

  // In the `postcss-html` and `postcss-jsx` syntax, checks that there is text after the given node.
  let after;

  if (root === document.last) {
    after = _.get(document, "raws.afterEnd");
  } else {
    const rootIndex = document.index(root);

    after = _.get(document.nodes[rootIndex + 1], "raws.beforeStart");
  }

  return !(after + "").trim();
}
function isEofNode(document, root) {
  if (!document || document.constructor.name !== "Document") {
    return true;
  }

  // In the `postcss-html` and `postcss-jsx` syntax, checks that there is text after the given node.
  let after;

  if (root === document.last) {
    after = _.get(document, "raws.afterEnd");
  } else {
    const rootIndex = document.index(root);

    after = _.get(document.nodes[rootIndex + 1], "raws.beforeStart");
  }

  return !(after + "").trim();
}
function isEofNode ( document , root ) { if ( ! document || document . constructor . name !== "Document" ) { return true ; } // In the `postcss-html` and `postcss-jsx` syntax, checks that there is text after the given node. let after ; if ( root === document . last ) { after = _ . get ( document , "raws.afterEnd" ) ; } else { const rootIndex = document . index ( root ) ; after = _ . get ( document . nodes [ rootIndex + 1 ] , "raws.beforeStart" ) ; } return ! ( after + "" ) . trim ( ) ; }
Checks whether the given node is the last node of file.
@param {Document|null} document the document node with `postcss-html` and `postcss-jsx`.
@param {Root} root the root node of css
Checks whether the given node is the last node of file .