Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
const htmlTags = require('html-tags');
const basic = /\s?|(]*>|]*>|]+>)+/i;
const full = new RegExp(htmlTags.map(tag => `<${tag}\\b[^>]*>`).join('|'), 'i');
module.exports = string => basic.test(string) || full.test(string);
{React.createElement(H, {
is: type,
css,
children: voids.includes(type) ? undefined : 'Demo'
})}
{
this.update({ type: e.target.value })
}}>
{tags.map(t => (
<option label="{t}" value="{t}">
))}
</option>
{
this.update({ css: e.target.value })
}}
/>
if (typeof document !== 'undefined') {
const sheet = document.head.appendChild(
document.createElement('style')
).sheet
insert = rule => {
rules.push(rule)
sheet.insertRule(rule, sheet.cssRules.length)
}
}
const comp = type => props => React.createElement(tagHOC([])(type), css(props))
const Div = comp('div')
const Bass = tags
.map(tag => comp(tag))
.reduce((a, b, i) => Object.assign(a, { [tags[i]]: b }), Div)
Bass.css = () => rules.join('')
Bass.component = comp
export default Bass