just use isNaN

pull/235/head
Rich Harris 8 years ago committed by GitHub
parent ca2f0a5bbb
commit 6679aef568

@ -28,7 +28,7 @@ export default function addComponentAttributes ( generator, node, local ) {
if ( value.type === 'Text' ) {
// static attributes
const result = String( parseFloat( value.data ) ) !== value.data ? JSON.stringify( value.data ) : value.data;
const result = isNaN( value.data ) ? JSON.stringify( value.data ) : value.data;
local.staticAttributes.push({
name: attribute.name,
value: result

Loading…
Cancel
Save