mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
.html() can return null
.html() can return null when querying an element that does not exist.
Repro:
const response = await axios.default.get('https://www.google.com/')
const $ = cheerio.load(response.data)
const foo = $('.bar').html()
console.log(`foo is: ${foo}`) //foo is: null
This commit is contained in:
Vendored
+1
-1
@@ -172,7 +172,7 @@ interface Cheerio {
|
||||
|
||||
empty(): Cheerio;
|
||||
|
||||
html(): string;
|
||||
html(): string | null;
|
||||
html(html: string): Cheerio;
|
||||
|
||||
text(): string;
|
||||
|
||||
Reference in New Issue
Block a user