[FIX] package, vdom: condition always true, TS 3.7.2

Before this commit, a condition deemed always true made
the building crash. The happened with TypeScript == 3.7.2

After this commit, the required typescript version has been
changed, as well as the incriminated true condition
This commit is contained in:
Lucas Perais (lpe)
2019-11-15 12:57:54 +01:00
committed by aab-odoo
parent a97144366d
commit f83846e054
2 changed files with 3 additions and 5 deletions
+1 -1
View File
@@ -44,7 +44,7 @@
"sass": "^1.16.1", "sass": "^1.16.1",
"source-map-support": "^0.5.10", "source-map-support": "^0.5.10",
"ts-jest": "^23.10.5", "ts-jest": "^23.10.5",
"typescript": "^3.6.4", "typescript": "^3.7.2",
"uglify-es": "^3.3.9" "uglify-es": "^3.3.9"
}, },
"jest": { "jest": {
+2 -4
View File
@@ -20,10 +20,8 @@ function htmlToVNode(node: ChildNode): VNode {
attrs[attr.name] = attr.textContent; attrs[attr.name] = attr.textContent;
} }
const children: VNode[] = []; const children: VNode[] = [];
if (node.hasChildNodes) { for (let c of node.childNodes) {
for (let c of node.childNodes) { children.push(htmlToVNode(c));
children.push(htmlToVNode(c));
}
} }
return h((node as Element).tagName, { attrs }, children); return h((node as Element).tagName, { attrs }, children);
} }