@jdeighan/coffee-utils 7.0.11 → 7.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +2 -2
- package/src/log_utils.coffee +4 -3
- package/src/log_utils.js +4 -3
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.12",
|
5
5
|
"description": "A set of utility functions for CoffeeScript",
|
6
6
|
"main": "coffee_utils.js",
|
7
7
|
"exports": {
|
@@ -49,7 +49,7 @@
|
|
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.47.0"
|
53
53
|
},
|
54
54
|
"devDependencies": {
|
55
55
|
"@jdeighan/unit-tester": "^1.0.5"
|
package/src/log_utils.coffee
CHANGED
@@ -15,7 +15,7 @@ putstr = undef
|
|
15
15
|
export stringify = undef
|
16
16
|
|
17
17
|
# ---------------------------------------------------------------------------
|
18
|
-
# This is useful for debugging
|
18
|
+
# This is useful for debugging
|
19
19
|
|
20
20
|
export LOG = (lArgs...) ->
|
21
21
|
|
@@ -26,12 +26,13 @@ export LOG = (lArgs...) ->
|
|
26
26
|
console.log "#{label}:"
|
27
27
|
console.log untabify(orderedStringify(item))
|
28
28
|
else
|
29
|
-
console.log "
|
29
|
+
console.log "#{label}: UNDEFINED"
|
30
30
|
console.log sep_dash
|
31
31
|
else
|
32
32
|
console.log label
|
33
33
|
return
|
34
34
|
|
35
|
+
# --- Use this instead to make it easier to remove all instances
|
35
36
|
export DEBUG = LOG # synonym
|
36
37
|
|
37
38
|
# ---------------------------------------------------------------------------
|
@@ -93,7 +94,7 @@ export orderedStringify = (obj, escape=false) ->
|
|
93
94
|
skipInvalid: true
|
94
95
|
indent: 1
|
95
96
|
sortKeys: true
|
96
|
-
lineWidth:
|
97
|
+
lineWidth: 40
|
97
98
|
replacer: if escape then escReplacer else (name,value) -> value
|
98
99
|
})
|
99
100
|
|
package/src/log_utils.js
CHANGED
@@ -34,7 +34,7 @@ putstr = undef;
|
|
34
34
|
export var stringify = undef;
|
35
35
|
|
36
36
|
// ---------------------------------------------------------------------------
|
37
|
-
// This is useful for debugging
|
37
|
+
// This is useful for debugging
|
38
38
|
export var LOG = function(...lArgs) {
|
39
39
|
var item, label;
|
40
40
|
[label, item] = lArgs;
|
@@ -44,7 +44,7 @@ export var LOG = function(...lArgs) {
|
|
44
44
|
console.log(`${label}:`);
|
45
45
|
console.log(untabify(orderedStringify(item)));
|
46
46
|
} else {
|
47
|
-
console.log(
|
47
|
+
console.log(`${label}: UNDEFINED`);
|
48
48
|
}
|
49
49
|
console.log(sep_dash);
|
50
50
|
} else {
|
@@ -52,6 +52,7 @@ export var LOG = function(...lArgs) {
|
|
52
52
|
}
|
53
53
|
};
|
54
54
|
|
55
|
+
// --- Use this instead to make it easier to remove all instances
|
55
56
|
export var DEBUG = LOG; // synonym
|
56
57
|
|
57
58
|
|
@@ -113,7 +114,7 @@ export var orderedStringify = function(obj, escape = false) {
|
|
113
114
|
skipInvalid: true,
|
114
115
|
indent: 1,
|
115
116
|
sortKeys: true,
|
116
|
-
lineWidth:
|
117
|
+
lineWidth: 40,
|
117
118
|
replacer: escape ? escReplacer : function(name, value) {
|
118
119
|
return value;
|
119
120
|
}
|