"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../mdast-util-to-hast/lib-index.cjs");
function remarkRehype(destination, options) {
  if (destination && "run" in destination) {
    return async function(tree, file) {
      const hastTree = (
        /** @type {HastRoot} */
        index.toHast(tree, { file, ...options })
      );
      await destination.run(hastTree, file);
    };
  }
  return function(tree, file) {
    return (
      /** @type {HastRoot} */
      index.toHast(tree, { file, ...destination || options })
    );
  };
}
exports.default = remarkRehype;
//# sourceMappingURL=lib-index.cjs.map
