Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public call(vnode: VNode | null): VNode {
if (isDocFrag(this.rootElement)) {
return this.wrapDocFrag(vnode === null ? [] : [vnode]);
}
if (vnode === null) {
return this.wrap([]);
}
const {tagName: selTagName, id: selId} = selectorParser(vnode);
const vNodeClassName = classNameFromVNode(vnode);
const vNodeData = vnode.data || {};
const vNodeDataProps = vNodeData.props || {};
const {id: vNodeId = selId} = vNodeDataProps;
const isVNodeAndRootElementIdentical =
typeof vNodeId === 'string' &&
vNodeId.toUpperCase() === this.rootElement.id.toUpperCase() &&
selTagName.toUpperCase() === this.rootElement.tagName.toUpperCase() &&
vNodeClassName.toUpperCase() === this.rootElement.className.toUpperCase();
if (isVNodeAndRootElementIdentical) {
return vnode;
}
return this.wrap([vnode]);