mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +01:00
refactor(helper/html): Prefer Array.isArray over instanceof Array (#3601)
This commit is contained in:
parent
4dd8b2b435
commit
c88ead6d72
@ -17,8 +17,9 @@ export const html = (
|
|||||||
for (let i = 0, len = strings.length - 1; i < len; i++) {
|
for (let i = 0, len = strings.length - 1; i < len; i++) {
|
||||||
buffer[0] += strings[i]
|
buffer[0] += strings[i]
|
||||||
|
|
||||||
const children =
|
const children = Array.isArray(values[i])
|
||||||
values[i] instanceof Array ? (values[i] as Array<unknown>).flat(Infinity) : [values[i]]
|
? (values[i] as Array<unknown>).flat(Infinity)
|
||||||
|
: [values[i]]
|
||||||
for (let i = 0, len = children.length; i < len; i++) {
|
for (let i = 0, len = children.length; i < len; i++) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const child = children[i] as any
|
const child = children[i] as any
|
||||||
|
Loading…
Reference in New Issue
Block a user