From a80c90780e01e705da880b3701aea37c0ec360bc Mon Sep 17 00:00:00 2001 From: Ron S Date: Sun, 3 Oct 2021 17:31:29 -0400 Subject: [PATCH] fix: Add null to return type for HTMLElement#querySelector (closes #157) --- src/nodes/html.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nodes/html.ts b/src/nodes/html.ts index 1fd1573..c1da816 100644 --- a/src/nodes/html.ts +++ b/src/nodes/html.ts @@ -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,