From d1adadcc94c1f33d1253c321268f2dfe77d1a78c Mon Sep 17 00:00:00 2001 From: Pavan Kumar VH Date: Thu, 3 Sep 2026 11:41:18 +0530 Subject: [PATCH] Use Number.isNaN instead of global isNaN in saxy XML parser The global isNaN() function coerces non-numbers to numbers first, which can lead to unexpected results. Using Number.isNaN is more predictable and safer for type checking. --- common/src/util/saxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/util/saxy.ts b/common/src/util/saxy.ts index b49422c01e..c055cc3e07 100644 --- a/common/src/util/saxy.ts +++ b/common/src/util/saxy.ts @@ -163,7 +163,7 @@ const parseEntities = (input: string): string => { value = parseInt(entityName.slice(1), 10) } - if (isNaN(value)) { + if (Number.isNaN(value)) { parts.push('&' + entityName + ';') } else { parts.push(String.fromCharCode(value))