taoqf / node-html-parser

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

Typescript return-type for HtmlElement.getAttribute() is wrong #54

Closed xatian closed 4 years ago

xatian commented 4 years ago

In html.d.ts:

    /**
     * Get an attribute
     * @return {string} value of the attribute
     */
    getAttribute(key: string): string;
    /**

If the attribute is not found this method returns undefined so the type should be string|undefined

taoqf commented 4 years ago

It's right, thank you.