Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
attribute(node, name, original) {
const isSVG = this.type === 'svg';
switch (name) {
case 'class':
if (isSVG)
return hyperAttribute(node, original);
name = 'className';
case 'data':
case 'props':
return hyperProperty(node, name);
case 'style':
return hyperStyle(node, original, isSVG);
case 'ref':
return hyperRef(node);
default:
if (name.slice(0, 1) === '.')
return hyperSetter(node, name.slice(1), isSVG);
if (name.slice(0, 2) === 'on')
return hyperEvent(node, name);
if (name in node && !(isSVG || readOnly.test(name)))
return hyperProperty(node, name);
return hyperAttribute(node, original);
}
},
attribute(node, name, original) {
const isSVG = this.type === 'svg';
switch (name) {
case 'class':
if (isSVG)
return hyperAttribute(node, original);
name = 'className';
case 'data':
case 'props':
return hyperProperty(node, name);
case 'style':
return hyperStyle(node, original, isSVG);
case 'ref':
return hyperRef(node);
default:
if (name.slice(0, 1) === '.')
return hyperSetter(node, name.slice(1), isSVG);
if (name.slice(0, 2) === 'on')
return hyperEvent(node, name);
if (name in node && !(isSVG || readOnly.test(name)))
return hyperProperty(node, name);
return hyperAttribute(node, original);
}
},