Skip to content

Commit

Permalink
fix: Add null to return type for HTMLElement#querySelector (closes #157)
Browse files Browse the repository at this point in the history
  • Loading branch information
nonara authored and Ron S committed Oct 10, 2021
1 parent 6823349 commit 2b65583
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nodes/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,9 @@ export default class HTMLElement extends Node {
/**
* Query CSS Selector to find matching node.
* @param {string} selector Simplified CSS selector
* @return {HTMLElement} matching node
* @return {(HTMLElement|null)} matching node
*/
public querySelector(selector: string) {
public querySelector(selector: string): HTMLElement | null {
return selectOne(selector, this as HTMLElement, {
xmlMode: true,
adapter: Matcher,
Expand Down

0 comments on commit 2b65583

Please sign in to comment.