import { footer } from "./lib-footer.js";
import { createState } from "./lib-state.js";
function toHast(tree, options) {
  const state = createState(tree, options);
  const node = state.one(tree, void 0);
  const foot = footer(state);
  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;
}
export {
  toHast
};
//# sourceMappingURL=lib-index.js.map
