Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const els = [].concat(nodes).reduce((arr, node, index) => {
if (isTagNode(node)) {
arr.push(tagToReactElement(node, index));
} else if (isStringNode(node)) {
arr.push(node);
}
return arr;
}, []);
content.forEach((el) => {
if (isStringNode(el) && isStartsWith(el, '*')) {
if (listItems[listIdx]) {
listIdx++;
}
ensureListItem(createItemNode());
addItem(el.substr(1));
} else if (isTagNode(el) && TagNode.isOf(el, '*')) {
if (listItems[listIdx]) {
listIdx++;
}
ensureListItem(createItemNode());
} else if (!isTagNode(listItems[listIdx])) {
listIdx++;
ensureListItem(el);
} else if (listItems[listIdx]) {
addItem(el);
} else {