Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { touchSync } from 'touch'
import {
getIdentifierName,
getName,
createRawStringFromTemplateLiteral,
minify
} from './babel-utils'
import { hashString, Stylis } from 'emotion-utils'
import cssProps from './css-prop'
import ASTObject from './ast-object'
export function hashArray(arr) {
return hashString(arr.join(''))
}
const staticStylis = new Stylis({ keyframe: false })
export function replaceCssWithCallExpression(
path,
identifier,
state,
t,
staticCSSSrcCreator = src => src,
removePath = false,
staticCSSSelectorCreator = (name, hash) => `.${name}-${hash}`
) {
try {
const { hash, src } = createRawStringFromTemplateLiteral(path.node.quasi)
const name = getName(getIdentifierName(path, t), 'css')
if (state.extractStatic && !path.node.quasi.expressions.length) {
const staticCSSRules = staticStylis(