diff options
| author | Noritaka Kobayashi <[email protected]> | 2025-06-29 17:53:09 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-29 08:53:09 +0000 |
| commit | e188daab91b98edb5ad5b3eca7d8b24fc945b7e3 (patch) | |
| tree | a4fc0be1833b85e1ba5cf3da1b0c97fb8d699c05 /packages/cli/src/ui/utils/textUtils.ts | |
| parent | fc21d1cae3c867a9593abcf7b0f957765961fdeb (diff) | |
refactor: use for...of loop instead of traditional for loop (#1840)
Diffstat (limited to 'packages/cli/src/ui/utils/textUtils.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/textUtils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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; } } |
