Skip to content

Commit ebf0bc9

Browse files
refactor(html-to-dom): tidy early return in client and server
1 parent 31d41c4 commit ebf0bc9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/client/html-to-dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function HTMLDOMParser(html: string) {
1414
throw new TypeError('First argument must be a string');
1515
}
1616

17-
if (html === '') {
17+
if (!html) {
1818
return [];
1919
}
2020

src/server/html-to-dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default function HTMLDOMParser(html: string, options?: ParserOptions) {
2121
throw new TypeError('First argument must be a string.');
2222
}
2323

24-
if (html === '') {
24+
if (!html) {
2525
return [];
2626
}
2727

0 commit comments

Comments
 (0)