detect-indent
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -12,2 +12,6 @@ (function () { | ||
function detectIndent(str) { | ||
if (typeof str !== 'string') { | ||
throw new Error('Argument must be a string.'); | ||
} | ||
var lines = str.replace(RE_MULTILINE_COMMENTS, '').split(/\n|\r\n?/); | ||
@@ -49,2 +53,6 @@ var tabs = 0; | ||
if (spaces.length === 0) { | ||
return null; | ||
} | ||
// greatest common divisor is most likely the indent size | ||
@@ -51,0 +59,0 @@ var indentSize = spaces.reduce(gcd); |
{ | ||
"name": "detect-indent", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Detect the indentation of code", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
3881
55