Socket
Socket
Sign inDemoInstall

detect-indent

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-indent - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

9

index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc