@primer/react-brand
Version:
Primer Brand is a GitHub's design system for creating React-based marketing websites and digital experiences.
16 lines (15 loc) • 391 B
JavaScript
import e from "react";
//#region src/utils/getTextContent.ts
function t(n) {
if (!n) return "";
if (typeof n == "string" || typeof n == "number") return String(n);
if (Array.isArray(n)) return n.map(t).join("");
if (e.isValidElement(n)) {
let e = n.props;
return t(e.children);
}
return "";
}
//#endregion
export { t as getTextContent };
//# sourceMappingURL=getTextContent.js.map