Skip to content

Commit 535b9d5

Browse files
committed
Release 5.0.7
1 parent a9d483b commit 535b9d5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "isbinaryfile",
33
"description": "Detects if a file is binary in Node.js. Similar to Perl's -B.",
4-
"version": "5.0.6",
4+
"version": "5.0.7",
55
"keywords": [
66
"text",
77
"binary",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ function isBinaryCheck(fileBuffer: Buffer, bytesRead: number): boolean {
266266

267267
suspiciousBytes++;
268268
// Read at least 32 fileBuffer before making a decision
269-
if (i >= 32 && (suspiciousBytes * 100) / (scanBytes) > 10) {
269+
if (i >= 32 && (suspiciousBytes * 100) / scanBytes > 10) {
270270
return true;
271271
}
272272
}
273273
}
274274

275-
if ((suspiciousBytes * 100) / (scanBytes) > 10) {
275+
if ((suspiciousBytes * 100) / scanBytes > 10) {
276276
return true;
277277
}
278278

0 commit comments

Comments
 (0)