import { isValidElement } from 'react';

function childrenToString(node) {
  if (typeof node === "string" || typeof node === "number" || typeof node === "boolean") {
    return node.toString();
  }
  if (!node) {
    return "";
  }
  if (Array.isArray(node)) {
    if (!node.length) return "";
    return node.map((entry) => childrenToString(entry)).join("");
  }
  if (isValidElement(node)) {
    const children = node.props?.children;
    if (!children) return "";
    return childrenToString(children);
  }
  return "";
}

export { childrenToString as c };
//# sourceMappingURL=childrenToString-Bz9MqbHb.js.map
