var emptyOptions = {};
function toString(t, r) {
	let i = r || emptyOptions;
	return one(t, typeof i.includeImageAlt == "boolean" ? i.includeImageAlt : !0, typeof i.includeHtml == "boolean" ? i.includeHtml : !0);
}
function one(e, t, n) {
	if (node(e)) {
		if ("value" in e) return e.type === "html" && !n ? "" : e.value;
		if (t && "alt" in e && e.alt) return e.alt;
		if ("children" in e) return all(e.children, t, n);
	}
	return Array.isArray(e) ? all(e, t, n) : "";
}
function all(e, t, r) {
	let i = [], a = -1;
	for (; ++a < e.length;) i[a] = one(e[a], t, r);
	return i.join("");
}
function node(e) {
	return !!(e && typeof e == "object");
}
export { toString };
