Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import styled from '@emotion/styled-base'
import { tags } from './tags'
// bind it to avoid mutating the original function
const newStyled = styled.bind()
tags.forEach(tagName => {
newStyled[tagName] = newStyled(tagName)
})
export default newStyled
// @flow
import styled from '@emotion/styled-base'
declare var codegen: { $call: Function, require: string => RegExp }
const tags = codegen`
const htmlTagNames = require('html-tag-names')
const svgTagNames = require('svg-tag-names')
module.exports = JSON.stringify(htmlTagNames
.concat(svgTagNames)
.filter((tag, index, array) => array.indexOf(tag) === index))
`
// bind it to avoid mutating the original function
const newStyled = styled.bind(undefined)
tags.forEach(tagName => {
newStyled[tagName] = newStyled(tagName)
})
export default newStyled