Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
])
}
if (t.isCallExpression(reference.parentPath.parentPath)) {
if (state.emotionSourceMap) {
if (
!sourceMap &&
reference.parentPath.parentPath.node.loc !== undefined
) {
sourceMap = getSourceMap(
reference.parentPath.parentPath.node.loc.start,
state
)
}
appendStringToExpressions(
reference.parentPath.parentPath.node.arguments,
sourceMap,
t
)
}
}
})
}
if (t.isCallExpression(path)) {
const label = getLabelFromPath(path, t)
let isPure = true
path.get('arguments').forEach(node => {
if (!node.isPure()) {
isPure = false
}
if (t.isObjectExpression(node)) {
node.replaceWith(simplifyObject(node.node, t))
}
})
if (label) {
appendStringToExpressions(path.node.arguments, `label:${label};`, t)
}
if (state.emotionSourceMap) {
if (!sourceMap && path.node.loc !== undefined) {
sourceMap = getSourceMap(path.node.loc.start, state)
}
appendStringToExpressions(path.node.arguments, sourceMap, t)
}
path.node.arguments = joinStringLiterals(path.node.arguments, t)
if (
path.node.arguments.length === 1 &&
t.isStringLiteral(path.node.arguments[0])
) {
let cssString = path.node.arguments[0].value
if (!node.isPure()) {
isPure = false
}
if (t.isObjectExpression(node)) {
node.replaceWith(simplifyObject(node.node, t))
}
})
if (label) {
appendStringToExpressions(path.node.arguments, `label:${label};`, t)
}
if (state.emotionSourceMap) {
if (!sourceMap && path.node.loc !== undefined) {
sourceMap = getSourceMap(path.node.loc.start, state)
}
appendStringToExpressions(path.node.arguments, sourceMap, t)
}
path.node.arguments = joinStringLiterals(path.node.arguments, t)
if (
path.node.arguments.length === 1 &&
t.isStringLiteral(path.node.arguments[0])
) {
let cssString = path.node.arguments[0].value
let res = css(cssString)
path.replaceWith(
t.objectExpression([
t.objectProperty(t.identifier('name'), t.stringLiteral(res.name)),
t.objectProperty(t.identifier('styles'), t.stringLiteral(res.styles))
])