Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (
element.nodeType === NODE_TYPE.ELEMENT_NODE &&
element.namespaceURI === Namespaces.HYPERVIEW
) {
switch (element.localName) {
case LOCAL_NAME.BODY:
case LOCAL_NAME.VIEW:
case LOCAL_NAME.FORM:
case LOCAL_NAME.HEADER:
case LOCAL_NAME.ITEM:
case LOCAL_NAME.SECTION_TITLE:
// TODO: Create HvView component
return view(element, stylesheets, onUpdate, options);
case LOCAL_NAME.TEXT:
// TODO: Create HvText component
return text(element, stylesheets, onUpdate, options);
case LOCAL_NAME.BEHAVIOR:
case LOCAL_NAME.MODIFIER:
case LOCAL_NAME.STYLES:
case LOCAL_NAME.STYLE:
// Non-UI elements don't get rendered
return null;
default:
break;
}
}
if (element.nodeType === NODE_TYPE.ELEMENT_NODE) {
if (!element.namespaceURI) {
console.warn('`namespaceURI` missing for node:', element.toString());
return null;
}