Satisfy strict null checks

pull/205/head
paldepind 8 years ago
parent f79af82881
commit dccd3d4800

@ -16,7 +16,9 @@ function post(_: any, vnode: VNode): void {
function destroy(vnode: VNode): void { function destroy(vnode: VNode): void {
// Remove placeholder // Remove placeholder
vnode.elm && vnode.elm.parentElement.removeChild(vnode.elm); if (vnode.elm !== undefined) {
(vnode.elm.parentElement as HTMLElement).removeChild(vnode.elm);
}
// Remove real element from where it was inserted // Remove real element from where it was inserted
vnode.elm = (vnode.data as VNodeData).attachData.real; vnode.elm = (vnode.data as VNodeData).attachData.real;
} }

@ -35,11 +35,11 @@ function appendChild(node: Node, child: Node): void {
node.appendChild(child); node.appendChild(child);
} }
function parentNode(node: Node): HTMLElement { function parentNode(node: Node): HTMLElement | null {
return node.parentElement; return node.parentElement;
} }
function nextSibling(node: Node): Node { function nextSibling(node: Node): Node | null {
return node.nextSibling; return node.nextSibling;
} }
@ -63,4 +63,5 @@ export const htmlDomApi = {
tagName, tagName,
setTextContent, setTextContent,
} as DOMAPI; } as DOMAPI;
export default htmlDomApi; export default htmlDomApi;
Loading…
Cancel
Save