Skip to content

Commit

Permalink
feat(hdom-mock): enable TS strict compiler flags (refactor)
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jun 4, 2019
1 parent 7f093b9 commit 787e2d4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/hdom-mock/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class HDOMNode {
}
}

toHiccup() {
toHiccup(): any {
if (this.isText()) {
return this.body;
}
Expand Down Expand Up @@ -122,7 +122,7 @@ export class MockHDOM implements HDOMImplementation<HDOMNode> {
parent: HDOMNode,
tree: any,
child?: number
) {
): HDOMNode | HDOMNode[] {
return createTree(opts, this, parent, tree, child);
}

Expand Down Expand Up @@ -183,7 +183,7 @@ export class MockHDOM implements HDOMImplementation<HDOMNode> {
tree: any
) {
this.removeChild(parent, child);
this.createTree(opts, parent, tree, child);
return this.createTree(opts, parent, tree, child);
}

getChild(parent: HDOMNode, i: number) {
Expand Down Expand Up @@ -228,7 +228,9 @@ export class MockHDOM implements HDOMImplementation<HDOMNode> {
}
}
} else {
el[id] != null ? (el[id] = null) : delete el.attribs[id];
(<any>el)[id] != null
? ((<any>el)[id] = null)
: delete el.attribs[id];
}
return el;
}
Expand All @@ -243,7 +245,7 @@ export class MockHDOM implements HDOMImplementation<HDOMNode> {
i >= 0 && listeners.splice(i, 1);
}
} else {
el[a] ? (el[a] = null) : delete el.attribs[a];
(<any>el)[a] ? ((<any>el)[a] = null) : delete el.attribs[a];
}
}
}
Expand Down

0 comments on commit 787e2d4

Please sign in to comment.