Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
attrsToPass = classesAndId
}
if (typeof classesAndId === 'string' && (classesAndId.indexOf('.') === 0 || classesAndId.indexOf('#') === 0)) {
// case: div('.hello')
objectAssign(attrsToPass, getClassesAndId(classesAndId))
} else if (classesAndId !== undefined && typeof classesAndId !== 'object') {
// case: div(2342374)
childrenToPass = [classesAndId]
}
return createElement(tagOrComponent, attrsToPass, ...childrenToPass)
}
// attach each HTML creator function to a creator function for custom components
return htmlTags.reduce((acc, tag) => {
acc[tag] = creator(tag)
return acc
}, creator)
}