detect-indent
Advanced tools
Comparing version 7.0.0 to 7.0.1
@@ -39,2 +39,3 @@ // Detect either spaces or tabs but not both to properly handle tabs for indentation and spaces for alignment | ||
let indentType; | ||
let use; | ||
let weight; | ||
@@ -62,2 +63,3 @@ let entry; | ||
use = 1; | ||
weight = 0; | ||
@@ -70,3 +72,6 @@ | ||
if (indentDifference === 0) { | ||
weight++; | ||
// Not a new "use" of the current indent: | ||
use = 0; | ||
// But do add a bit to it for breaking ties: | ||
weight = 1; | ||
// We use the key from previous loop | ||
@@ -80,3 +85,3 @@ } else { | ||
entry = indents.get(key); | ||
entry = entry === undefined ? [1, 0] : [++entry[0], entry[1] + weight]; | ||
entry = entry === undefined ? [1, 0] : [entry[0] + use, entry[1] + weight]; | ||
@@ -83,0 +88,0 @@ indents.set(key, entry); |
{ | ||
"name": "detect-indent", | ||
"version": "7.0.0", | ||
"version": "7.0.1", | ||
"description": "Detect the indentation of code", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9746
163