function isNodeALifeCycleMethod(node, checkAsyncSafeLifeCycles) {
  if (node.key) {
    if (node.kind === 'constructor') {
      return true;
    }

    const nodeKeyName = node.key.name;

    if (typeof nodeKeyName !== 'string') {
      return false;
    }

    if (LIFE_CYCLE_METHODS.indexOf(nodeKeyName) >= 0) {
      return true;
    }
    if (checkAsyncSafeLifeCycles && ASYNC_SAFE_LIFE_CYCLE_METHODS.indexOf(nodeKeyName) >= 0) {
      return true;
    }
  }

  return false;
}
Returns true if the given node is a React Component lifecycle method
@param {ASTNode} node The AST node being checked.
@param {boolean} checkAsyncSafeLifeCycles
@return {boolean} True if the node is a lifecycle method