@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 882 B
Source Map (JSON)
{"version":3,"file":"rich-text-has-content.mjs","names":[],"sources":["../../../src/utils/helpers/rich-text-has-content.ts"],"sourcesContent":["import { getObject } from \"./get-typed-value.js\";\n\nconst richTextHasContent = (node: unknown): boolean => {\n\tconst nodeObject = getObject(node);\n\tif (!nodeObject) return false;\n\tif (nodeObject.type === \"text\") {\n\t\treturn typeof nodeObject.text === \"string\" && nodeObject.text.length > 0;\n\t}\n\tif (nodeObject.type === \"horizontalRule\") return true;\n\n\treturn (\n\t\tArray.isArray(nodeObject.content) &&\n\t\tnodeObject.content.some(richTextHasContent)\n\t);\n};\n\nexport default richTextHasContent;\n"],"mappings":"kDAEA,MAAM,EAAsB,GAA2B,CACtD,IAAM,EAAa,EAAU,CAAI,EAOjC,OANK,EACD,EAAW,OAAS,OAChB,OAAO,EAAW,MAAS,UAAY,EAAW,KAAK,OAAS,EAEpE,EAAW,OAAS,kBAGvB,MAAM,QAAQ,EAAW,OAAO,GAChC,EAAW,QAAQ,KAAK,CAAkB,EARnB,EAUzB"}