@jdeighan/coffee-utils 7.0.47 → 7.0.48

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jdeighan/coffee-utils",
3
3
  "type": "module",
4
- "version": "7.0.47",
4
+ "version": "7.0.48",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -143,7 +143,6 @@ adjustStack = (str) ->
143
143
  undef
144
144
  if shouldLogString(str) then 'string' else undef
145
145
  ]
146
- return
147
146
 
148
147
  # ---------------------------------------------------------------------------
149
148
 
@@ -159,15 +158,21 @@ export debug = (lArgs...) ->
159
158
 
160
159
  if doDebugDebug
161
160
  if nArgs==1
162
- LOG "debug('#{escapeStr(label)}')"
161
+ LOG "debug('#{escapeStr(label)}') - 1 arg"
163
162
  else
164
- LOG "debug('#{escapeStr(label)}', #{typeof item})"
163
+ LOG "debug('#{escapeStr(label)}', #{typeof item}) - 2 args"
165
164
 
166
165
  # --- We always need to manipulate the stack when we encounter
167
166
  # either "enter X" or "return from X", so we can't short-circuit
168
167
  # when debugging is off
169
168
 
170
- [mainPre, auxPre, hEnv, type] = adjustStack(label)
169
+ lResult = adjustStack(label)
170
+ if doDebugDebug
171
+ LOG 'lResult', lResult
172
+ [mainPre, auxPre, hEnv, type] = lResult
173
+ if doDebugDebug && (type == undef)
174
+ LOG "type is undef - NOT LOGGING"
175
+
171
176
  hOptions = {
172
177
  prefix: mainPre
173
178
  itemPrefix: auxPre
@@ -161,7 +161,7 @@ adjustStack = function(str) {
161
161
 
162
162
  // ---------------------------------------------------------------------------
163
163
  export var debug = function(...lArgs) {
164
- var auxPre, hEnv, hOptions, item, label, mainPre, nArgs, orgDebugging, trans, type;
164
+ var auxPre, hEnv, hOptions, item, lResult, label, mainPre, nArgs, orgDebugging, trans, type;
165
165
  // --- We want to allow item to be undef. Therefore, we need to
166
166
  // distinguish between 1 arg sent vs. 2 args sent
167
167
  nArgs = lArgs.length;
@@ -170,15 +170,22 @@ export var debug = function(...lArgs) {
170
170
  assert(isString(label), `debug(): 1st arg ${OL(label)} should be a string`);
171
171
  if (doDebugDebug) {
172
172
  if (nArgs === 1) {
173
- LOG(`debug('${escapeStr(label)}')`);
173
+ LOG(`debug('${escapeStr(label)}') - 1 arg`);
174
174
  } else {
175
- LOG(`debug('${escapeStr(label)}', ${typeof item})`);
175
+ LOG(`debug('${escapeStr(label)}', ${typeof item}) - 2 args`);
176
176
  }
177
177
  }
178
178
  // --- We always need to manipulate the stack when we encounter
179
179
  // either "enter X" or "return from X", so we can't short-circuit
180
180
  // when debugging is off
181
- [mainPre, auxPre, hEnv, type] = adjustStack(label);
181
+ lResult = adjustStack(label);
182
+ if (doDebugDebug) {
183
+ LOG('lResult', lResult);
184
+ }
185
+ [mainPre, auxPre, hEnv, type] = lResult;
186
+ if (doDebugDebug && (type === undef)) {
187
+ LOG("type is undef - NOT LOGGING");
188
+ }
182
189
  hOptions = {
183
190
  prefix: mainPre,
184
191
  itemPrefix: auxPre