function getComments(node, flags, fn) {
  if (!Array.isArray(node?.comments)) {
    return [];
  }
  const test = getCommentTestFunction(flags, fn);
  return test ? node.comments.filter(test) : node.comments;
}
@param {Estree.Node} node
@param {number | function} [flags]
@param {function} [fn]
@returns {Estree.Comment[]}