Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function autoLinkifyHelper(node) {
if(typeof node === 'string') {
return hyperLinkifiedVersion(node);
} else if (['a', 'code', 'pre', 'equation'].indexOf(getNodeName(node).toLowerCase()) > -1){
return node;
} else {
return modifyChildren(node, autoLinkifyHelper);
}
}
const tNode = node => {
if (getType(node) === 'textnode') return node;
let name = getNodeName(node);
let attrs = getProperties(node);
if (!attrs) {
attrs = {};
}
const children = getChildren(node);
return {
component: name,
...attrConvert(attrs, node),
children: children.map(tNode)
};
};