From e188daab91b98edb5ad5b3eca7d8b24fc945b7e3 Mon Sep 17 00:00:00 2001 From: Noritaka Kobayashi Date: Sun, 29 Jun 2025 17:53:09 +0900 Subject: refactor: use for...of loop instead of traditional for loop (#1840) --- packages/cli/src/ui/utils/textUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/ui/utils/textUtils.ts') diff --git a/packages/cli/src/ui/utils/textUtils.ts b/packages/cli/src/ui/utils/textUtils.ts index f7006047..fa0abe9a 100644 --- a/packages/cli/src/ui/utils/textUtils.ts +++ b/packages/cli/src/ui/utils/textUtils.ts @@ -34,10 +34,10 @@ export function isBinary( const sample = data.length > sampleSize ? data.subarray(0, sampleSize) : data; - for (let i = 0; i < sample.length; i++) { + for (const byte of sample) { // The presence of a NULL byte (0x00) is one of the most reliable // indicators of a binary file. Text files should not contain them. - if (sample[i] === 0) { + if (byte === 0) { return true; } } -- cgit v1.2.3