Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof tag === 'function') return tag(props, children)()
// Prepare arguments
// (See: http://google.github.io/incremental-dom/#api/elementOpen)
let args = [tag, null, null]
for (let key in props) {
if (key==='key') {
args[1] = props.key
delete props.key
}
args.push(key)
args.push(props[key])
}
elementOpen.apply(null, args)
children.forEach(create)
elementClose(tag)
}
// Pass key as second argument to elementOpen
argsArray[1] = attrs[key]
} else {
argsArray.push( attr )
argsArray.push( attrs[attr] )
}
}
if ( ! children || ! children.length ) {
node.el = elementVoid.apply(null, argsArray)
} else {
elementOpen.apply(null, argsArray)
children.forEach( renderIdom )
node.el = elementClose(tag)
}
// If component instance, store reference to element
if (node.instance)
node.instance.el = node.el
return node
}