@jdeighan/coffee-utils 7.0.40 → 7.0.41
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/indent_utils.coffee +3 -3
- package/src/indent_utils.js +3 -3
package/package.json
CHANGED
package/src/indent_utils.coffee
CHANGED
@@ -32,10 +32,10 @@ export indentation = (level) ->
|
|
32
32
|
# indentLevel - determine indent level of a string
|
33
33
|
# it's OK if the string is ONLY indentation
|
34
34
|
|
35
|
-
export indentLevel = (
|
35
|
+
export indentLevel = (line) ->
|
36
36
|
|
37
|
-
assert isString(
|
38
|
-
lMatches =
|
37
|
+
assert isString(line), "indentLevel(): non-string #{OL(line)}"
|
38
|
+
lMatches = line.match(/^\t*/)
|
39
39
|
return lMatches[0].length
|
40
40
|
|
41
41
|
# ---------------------------------------------------------------------------
|
package/src/indent_utils.js
CHANGED
@@ -43,10 +43,10 @@ export var indentation = function(level) {
|
|
43
43
|
// ---------------------------------------------------------------------------
|
44
44
|
// indentLevel - determine indent level of a string
|
45
45
|
// it's OK if the string is ONLY indentation
|
46
|
-
export var indentLevel = function(
|
46
|
+
export var indentLevel = function(line) {
|
47
47
|
var lMatches;
|
48
|
-
assert(isString(
|
49
|
-
lMatches =
|
48
|
+
assert(isString(line), `indentLevel(): non-string ${OL(line)}`);
|
49
|
+
lMatches = line.match(/^\t*/);
|
50
50
|
return lMatches[0].length;
|
51
51
|
};
|
52
52
|
|