@jdeighan/coffee-utils 7.0.41 → 7.0.44
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -3
- package/src/indent_utils.coffee +2 -2
- package/src/indent_utils.js +2 -2
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jdeighan/coffee-utils",
|
3
3
|
"type": "module",
|
4
|
-
"version": "7.0.
|
4
|
+
"version": "7.0.44",
|
5
5
|
"description": "A set of utility functions for CoffeeScript",
|
6
6
|
"main": "coffee_utils.js",
|
7
7
|
"exports": {
|
@@ -49,9 +49,9 @@
|
|
49
49
|
"js-yaml": "^4.1.0",
|
50
50
|
"n-readlines": "^1.0.1",
|
51
51
|
"readline-sync": "^1.4.10",
|
52
|
-
"svelte": "^3.
|
52
|
+
"svelte": "^3.48.0"
|
53
53
|
},
|
54
54
|
"devDependencies": {
|
55
|
-
"@jdeighan/unit-tester": "^2.0.
|
55
|
+
"@jdeighan/unit-tester": "^2.0.2"
|
56
56
|
}
|
57
57
|
}
|
package/src/indent_utils.coffee
CHANGED
@@ -78,7 +78,7 @@ export undented = (text, level=undef) ->
|
|
78
78
|
else if isArray(text)
|
79
79
|
lLines = text
|
80
80
|
for line in lLines
|
81
|
-
assert isString(line), "undented():
|
81
|
+
assert isString(line), "undented(): array not all strings"
|
82
82
|
if (lLines.length == 0)
|
83
83
|
return []
|
84
84
|
else
|
@@ -91,7 +91,7 @@ export undented = (text, level=undef) ->
|
|
91
91
|
else
|
92
92
|
lMatches = lLines[0].match(/^\s*/)
|
93
93
|
toRemove = lMatches[0]
|
94
|
-
nToRemove = toRemove
|
94
|
+
nToRemove = indentLevel(toRemove)
|
95
95
|
|
96
96
|
lNewLines = []
|
97
97
|
for line in lLines
|
package/src/indent_utils.js
CHANGED
@@ -99,7 +99,7 @@ export var undented = function(text, level = undef) {
|
|
99
99
|
lLines = text;
|
100
100
|
for (i = 0, len = lLines.length; i < len; i++) {
|
101
101
|
line = lLines[i];
|
102
|
-
assert(isString(line), "undented():
|
102
|
+
assert(isString(line), "undented(): array not all strings");
|
103
103
|
}
|
104
104
|
if (lLines.length === 0) {
|
105
105
|
return [];
|
@@ -115,7 +115,7 @@ export var undented = function(text, level = undef) {
|
|
115
115
|
lMatches = lLines[0].match(/^\s*/);
|
116
116
|
toRemove = lMatches[0];
|
117
117
|
}
|
118
|
-
nToRemove = toRemove
|
118
|
+
nToRemove = indentLevel(toRemove);
|
119
119
|
lNewLines = [];
|
120
120
|
for (j = 0, len1 = lLines.length; j < len1; j++) {
|
121
121
|
line = lLines[j];
|