"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const footer = require("./lib-footer.cjs");
const state = require("./lib-state.cjs");
function toHast(tree, options) {
  const state$1 = state.createState(tree, options);
  const node = state$1.one(tree, void 0);
  const foot = footer.footer(state$1);
  const result = Array.isArray(node) ? { type: "root", children: node } : node || { type: "root", children: [] };
  if (foot) {
    result.children.push({ type: "text", value: "\n" }, foot);
  }
  return result;
}
exports.toHast = toHast;
//# sourceMappingURL=lib-index.cjs.map
