Skip to content

Commit 5367bd0

Browse files
committed
Refactor code
1 parent 17ae11c commit 5367bd0

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

index.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,17 @@ function element(node) {
6666
return toH(function (name, attrs) {
6767
var values = [];
6868
var content;
69+
var value;
6970
var key;
7071

7172
for (key in attrs) {
73+
value = {name: key, value: attrs[key]};
74+
7275
if (own.call(attributeSpaces, key)) {
73-
values.push(xtend({
74-
name: key,
75-
value: attrs[key]
76-
}, attributeSpaces[key]));
77-
} else {
78-
values.push({
79-
name: key,
80-
value: attrs[key]
81-
});
76+
value = xtend(value, attributeSpaces[key]);
8277
}
78+
79+
values.push(value);
8380
}
8481

8582
if (name === 'template') {

0 commit comments

Comments
 (0)