Skip to content

Commit 4fc2bef

Browse files
Mallikarjun-0fb55
andauthored
fix: add input type validation to isHtml utility (#4523)
Co-authored-by: Felix Boehm <[email protected]>
1 parent 08326d0 commit 4fc2bef

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ const enum CharacterCode {
8080
* @returns Indicates if `str` is HTML.
8181
*/
8282
export function isHtml(str: string): boolean {
83+
if (typeof str !== 'string') {
84+
return false;
85+
}
86+
8387
const tagStart = str.indexOf('<');
8488

8589
if (tagStart === -1 || tagStart > str.length - 3) return false;

0 commit comments

Comments
 (0)