15 lines
272 B
TypeScript
15 lines
272 B
TypeScript
export const stringifyRichText = (richText) => {
|
|
let string = '';
|
|
|
|
richText.forEach((node) => {
|
|
const { children } = node;
|
|
|
|
children.forEach((child) => {
|
|
const { text } = child;
|
|
string = string.concat(' ', text);
|
|
});
|
|
});
|
|
|
|
return string;
|
|
};
|