Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(properties, [key, value]) =>
Object.assign({}, properties, {
[paramCaseRe.test(key) ? paramCase(key) : key]: value
}),
{}
JSXAttribute(node) {
if (node.node.name.name in TRANSLATIONS) {
node.node.name.name = TRANSLATIONS[node.node.name.name]
} else if (node.node.name.name === `props`) {
node.traverse(propsKeysVisitor)
} else if (
node.node.name.name.startsWith(`data`) ||
node.node.name.name.startsWith(`aria`)
) {
const CAMEL_CASE_REGEX = /^(aria[A-Z])|(data[A-Z])/
if (CAMEL_CASE_REGEX.test(node.node.name.name)) {
node.node.name.name = camelCase(node.node.name.name)
}
} else if (
node.node.name.name in ARRAY_TO_STRING &&
node.node.value.type === 'JSXExpressionContainer' &&
node.node.value.expression.type === 'ArrayExpression'
) {
node.node.value = t.stringLiteral(
node.node.value.expression.elements.map(el => el.value).join(' ')
)
}
if (
node.node.name.name === `style` &&
node.node.value.type === `StringLiteral`
) {
let styleArray = []