schlechtenburg/packages/rich-text/lib/is-empty.ts

14 lines
360 B
TypeScript
Raw Normal View History

2024-10-08 07:15:26 +00:00
import { RichTextValue } from "./types";
/**
* Check if a Rich Text value is Empty, meaning it contains no text or any
* objects (such as images).
*
* @param {RichTextValue} value Value to use.
*
* @return {boolean} True if the value is empty, false if not.
*/
export function isEmpty( { text }: RichTextValue ): boolean {
return text.length === 0;
}