Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
19 lines
586 B
Plaintext
19 lines
586 B
Plaintext
export function isSerializedLexicalEditor(value) {
|
|
return typeof value === 'object' && 'root' in value;
|
|
}
|
|
export function formatLexicalDocTitle(editorState, textContent) {
|
|
for (const node of editorState) {
|
|
if ('text' in node && node.text) {
|
|
textContent += node.text;
|
|
} else {
|
|
if (!('children' in node)) {
|
|
textContent += `[${node.type}]`;
|
|
}
|
|
}
|
|
if ('children' in node && node.children) {
|
|
textContent += formatLexicalDocTitle(node.children, textContent);
|
|
}
|
|
}
|
|
return textContent;
|
|
}
|
|
//# sourceMappingURL=formatLexicalDocTitle.js.map |