From c88ead6d729a2337fbcee553189d69023975551b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TATSUNO=20=E2=80=9CTaz=E2=80=9D=20Yasuhiro?= Date: Fri, 1 Nov 2024 10:14:44 +0900 Subject: [PATCH] refactor(helper/html): Prefer Array.isArray over instanceof Array (#3601) --- src/helper/html/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helper/html/index.ts b/src/helper/html/index.ts index e0871c0e..7db7da1c 100644 --- a/src/helper/html/index.ts +++ b/src/helper/html/index.ts @@ -17,8 +17,9 @@ export const html = ( for (let i = 0, len = strings.length - 1; i < len; i++) { buffer[0] += strings[i] - const children = - values[i] instanceof Array ? (values[i] as Array).flat(Infinity) : [values[i]] + const children = Array.isArray(values[i]) + ? (values[i] as Array).flat(Infinity) + : [values[i]] for (let i = 0, len = children.length; i < len; i++) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const child = children[i] as any