taoqf / node-html-parser

A very fast HTML parser, generating a simplified DOM, with basic element query support.
MIT License
1.11k stars 107 forks source link

fix: nullable return types of HTMLElement #257

Closed wdzeng closed 9 months ago

wdzeng commented 10 months ago

Hi,

This is the greatest tool I've ever found. But some types flaw with TypeScript.

Following methods in HTMLElement can return null, but do not declare correct return types.

Following methods in HTMLElement can return undefined, but do not declare correct return types. Actually these should follow the web API and return null, but I did not change them to prevent breaking the backward compability.