hyperapp
Advanced tools
Comparing version 2.0.21 to 2.0.22
21
index.js
@@ -72,4 +72,3 @@ var SSR_NODE = 1 | ||
var patchProperty = (node, key, oldValue, newValue, listener, isSvg) => { | ||
if (key === "key") { | ||
} else if (key === "style") { | ||
if (key === "style") { | ||
for (var k in { ...oldValue, ...newValue }) { | ||
@@ -93,7 +92,3 @@ oldValue = newValue == null || newValue[k] == null ? "" : newValue[k] | ||
node[key] = newValue == null ? "" : newValue | ||
} else if ( | ||
newValue == null || | ||
newValue === false || | ||
(key === "class" && !(newValue = createClass(newValue))) | ||
) { | ||
} else if (newValue == null || newValue === false) { | ||
node.removeAttribute(key) | ||
@@ -353,6 +348,6 @@ } else { | ||
var createVNode = (tag, props, children, type, node) => ({ | ||
var createVNode = (tag, { key, ...props }, children, type, node) => ({ | ||
tag, | ||
props, | ||
key: props.key, | ||
key, | ||
children, | ||
@@ -368,4 +363,8 @@ type, | ||
export var h = (tag, props, children = EMPTY_ARR) => | ||
createVNode(tag, props, isArray(children) ? children : [children]) | ||
export var h = (tag, { class: c, ...props }, children = EMPTY_ARR) => | ||
createVNode( | ||
tag, | ||
{ ...props, ...(c ? { class: createClass(c) } : EMPTY_OBJ) }, | ||
isArray(children) ? children : [children] | ||
) | ||
@@ -372,0 +371,0 @@ export var app = ({ |
{ | ||
"name": "hyperapp", | ||
"version": "2.0.21", | ||
"version": "2.0.22", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
27311
567