code: public static boolean isFunctionDeclaration(Node n) {
      // Note: There is currently one case where an unnamed function has a declaration parent.
      // `export default function() {...}`
      // In this case we consider the function to be an expression.
      return n.isFunction() && isDeclarationParent(n.getParent()) && isNamedFunction(n);
    }
docs: Is this node a function declaration? A function declaration is a function
  that has a name that is added to the current scope (i.e. a function that
  is not part of a expression; see {@link #isFunctionExpression}).