From b177d02e3aee907af72dc76aece21faf74be7935 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 6 Sep 2024 22:47:52 +0700 Subject: [PATCH] Update index.ts --- source/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/index.ts b/source/index.ts index 6c90a0d..e7835cf 100644 --- a/source/index.ts +++ b/source/index.ts @@ -1149,11 +1149,10 @@ export function assertArray(value: unknown, assertion?: (element: u } if (assertion) { - // eslint-disable-next-line unicorn/no-array-for-each - value.forEach(v => { + for (const element of value) { // @ts-expect-error: "Assertions require every name in the call target to be declared with an explicit type annotation." - assertion(v, message); - }); + assertion(element, message); + } } }