Skip to content

Commit

Permalink
nextElementSibling returns an HTMLElement
Browse files Browse the repository at this point in the history
The purpose of `nextElementSibling` is to return an `HTMLElement`, not any kind of `Node`.
The `.tsconfig` disables strict null-checking, so I forgo adding the `null` return type.
  • Loading branch information
hugmanrique committed May 7, 2021
1 parent 83fa267 commit 607c003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nodes/html.ts
Expand Up @@ -739,7 +739,7 @@ export default class HTMLElement extends Node {
}
}

public get nextElementSibling(): Node {
public get nextElementSibling(): HTMLElement {
if (this.parentNode) {
const children = this.parentNode.childNodes;
let i = 0;
Expand Down

0 comments on commit 607c003

Please sign in to comment.