packages/flow-remove-types/index.js
function isLastNodeRemovedFromLine(context, node) {
  var tokens = context.ast.tokens;
  var priorTokenIdx = findTokenIndex(tokens, startOf(node)) - 1;
  var token = tokens[priorTokenIdx];
  var line = node.loc.end.line;

  // Find previous token that was not removed on the same line.
  while (
    priorTokenIdx >= 0 &&
    token.loc.end.line === line &&
    isRemovedToken(context, token)
  ) {
    token = tokens[--priorTokenIdx];
  }

  // If there's no prior token (start of file), or the prior token is on another
  // line, this line must be fully removed.
  return !token || token.loc.end.line !== line;
}
function isLastNodeRemovedFromLine(context, node) {
  var tokens = context.ast.tokens;
  var priorTokenIdx = findTokenIndex(tokens, startOf(node)) - 1;
  var token = tokens[priorTokenIdx];
  var line = node.loc.end.line;

  // Find previous token that was not removed on the same line.
  while (
    priorTokenIdx >= 0 &&
    token.loc.end.line === line &&
    isRemovedToken(context, token)
  ) {
    token = tokens[--priorTokenIdx];
  }

  // If there's no prior token (start of file), or the prior token is on another
  // line, this line must be fully removed.
  return !token || token.loc.end.line !== line;
}
function isLastNodeRemovedFromLine ( context , node ) { var tokens = context . ast . tokens ; var priorTokenIdx = findTokenIndex ( tokens , startOf ( node ) ) - 1 ; var token = tokens [ priorTokenIdx ] ; var line = node . loc . end . line ; // Find previous token that was not removed on the same line. while ( priorTokenIdx >= 0 && token . loc . end . line === line && isRemovedToken ( context , token ) ) { token = tokens [ -- priorTokenIdx ] ; } // If there's no prior token (start of file), or the prior token is on another // line, this line must be fully removed. return ! token || token . loc . end . line !== line ; }
Returns true if node is the last to be removed from a line.
Returns true if node is the last to be removed from a line .