hyperx-to-snabbdom
Advanced tools
Comparing version 0.2.4 to 0.3.0
34
index.js
@@ -33,4 +33,7 @@ module.exports = function (h) { | ||
} else { | ||
data.props[key] = data.attrs[key] = value === "true" | ||
? true : value === "false" ? false : value | ||
if (isSVG(tagName)) { | ||
data.attrs[key] = parseBool(value) | ||
continue | ||
} | ||
data.props[key] = data.attrs[key] = parseBool(value) | ||
} | ||
@@ -42,1 +45,28 @@ } | ||
} | ||
function parseBool(value) { | ||
return value === "true" ? true : value === "false" ? false : value | ||
} | ||
function isSVG(tagName) { | ||
var svgTags = [ | ||
"svg", "animate", "animateTransform", "circle", "cursor", "desc", "ellipse", | ||
"feBlend", "feColorMatrix", "feComposite", | ||
"feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", | ||
"feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", | ||
"feGaussianBlur", "feImage", "feMergeNode", "feMorphology", | ||
"feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", | ||
"feTurbulence", "font-face-format", "font-face-name", "font-face-uri", | ||
"glyph", "glyphRef", "hkern", "image", "line", "missing-glyph", "mpath", | ||
"path", "polygon", "polyline", "rect", "set", "stop", "tref", "use", "view", | ||
"vkern" | ||
] | ||
for (var i = 0; i < svgTags.length; i++) { | ||
if (tagName === svgTags[i]) { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
{ | ||
"name": "hyperx-to-snabbdom", | ||
"version": "0.2.4", | ||
"version": "0.3.0", | ||
"description": "Hyperx to Snabbdom transform function.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
snabbdom |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3201
59
1