Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
case 'Entry':
frontMatter[field] = getEntryFields(
fieldContent
);
break;
default:
frontMatter[field] = fieldContent;
break;
}
}
// rich text (see rich text function)
else if ('nodeType' in fieldContent) {
frontMatter[field] = [];
frontMatter[
`${field}_plaintext`
] = richTextToPlain(fieldContent);
const nodes = fieldContent.content;
for (let i = 0; i < nodes.length; i++) {
frontMatter[field].push(
richTextNodes(nodes[i])
);
}
}
// arrays
else {
if (!fieldContent.length) {
frontMatter[field] = fieldContent;
} else {
frontMatter[field] = [];
for (
let i = 0;
i < fieldContent.length;
case 'Entry':
frontMatter[field] = getEntryFields(
fieldContent
);
break;
default:
frontMatter[field] = fieldContent;
break;
}
}
// rich text (see rich text function)
else if ('nodeType' in fieldContent) {
frontMatter[field] = [];
frontMatter[
`${field}_plaintext`
] = richTextToPlain(fieldContent);
const nodes = fieldContent.content;
for (let i = 0; i < nodes.length; i++) {
frontMatter[field].push(
richTextNodes(nodes[i])
);
}
}
// arrays
else {
if (!fieldContent.length) {
frontMatter[field] = fieldContent;
} else {
frontMatter[field] = [];
for (
let i = 0;
i < fieldContent.length;
function checkContent(isRichText, value, config = {}) {
const { messages } = isRichText
? alex.text(documentToPlainTextString(value), config)
: alex.markdown(value, config);
return messages;
}