packages/babel-plugin-flow-prepack/src/firstPassVisitors.js
function hasTypeAnnotation (path: NodePath): boolean {
  if (!path.node) {
    return false;
  }
  else if (path.node.typeAnnotation) {
    return true;
  }
  else if (path.isAssignmentPattern()) {
    return hasTypeAnnotation(path.get('left'));
  }
  else {
    return false;
  }
}
function hasTypeAnnotation (path: NodePath): boolean {
  if (!path.node) {
    return false;
  }
  else if (path.node.typeAnnotation) {
    return true;
  }
  else if (path.isAssignmentPattern()) {
    return hasTypeAnnotation(path.get('left'));
  }
  else {
    return false;
  }
}
Determine whether the given node path has a type annotation or not.