function printDanglingComments(
  path,
  options,
  danglingCommentsPrintOptions = {},
) {
  const { node } = path;

  if (!isNonEmptyArray(node?.comments)) {
    return "";
  }

  const {
    indent: shouldIndent = false,
    marker,
    filter = returnTrue,
  } = danglingCommentsPrintOptions;

  const parts = [];
  path.each(({ node: comment }) => {
    if (
      comment.leading ||
      comment.trailing ||
      comment.marker !== marker ||
      !filter(comment)
    ) {
      return;
    }

    parts.push(printComment(path, options));
  }, "comments");

  if (parts.length === 0) {
    return "";
  }

  const doc = join(hardline, parts);
  return shouldIndent ? indent([hardline, doc]) : doc;
}
@param {AstPath} path
@param {{
 indent?: boolean,
 marker?: symbol,
 filter?: (comment) => boolean,
}} [danglingCommentsPrintOptions]
@returns {Doc}