@jdeighan/coffee-utils 7.0.9 → 7.0.12

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.9",
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.46.6"
52
+ "svelte": "^3.47.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@jdeighan/unit-tester": "^1.0.5"
@@ -6,11 +6,12 @@ import fs from 'fs'
6
6
  import NReadLines from 'n-readlines'
7
7
 
8
8
  import {
9
- assert, undef, pass, rtrim, error, nonEmpty,
9
+ assert, undef, pass, rtrim, error, isEmpty, nonEmpty,
10
10
  isString, isArray, isRegExp, isFunction, croak,
11
11
  } from '@jdeighan/coffee-utils'
12
12
  import {log, LOG} from '@jdeighan/coffee-utils/log'
13
13
  import {debug} from '@jdeighan/coffee-utils/debug'
14
+ import {arrayToBlock} from '@jdeighan/coffee-utils/block'
14
15
 
15
16
  # ---------------------------------------------------------------------------
16
17
  # mydir() - pass argument `import.meta.url` and it will return
package/src/fs_utils.js CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  pass,
17
17
  rtrim,
18
18
  error,
19
+ isEmpty,
19
20
  nonEmpty,
20
21
  isString,
21
22
  isArray,
@@ -33,6 +34,10 @@ import {
33
34
  debug
34
35
  } from '@jdeighan/coffee-utils/debug';
35
36
 
37
+ import {
38
+ arrayToBlock
39
+ } from '@jdeighan/coffee-utils/block';
40
+
36
41
  // ---------------------------------------------------------------------------
37
42
  // mydir() - pass argument `import.meta.url` and it will return
38
43
  // the directory your file is in
@@ -15,7 +15,7 @@ putstr = undef
15
15
  export stringify = undef
16
16
 
17
17
  # ---------------------------------------------------------------------------
18
- # This is useful for debugging and easy to remove after 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 "[#{label}]: UNDEFINED"
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: -1
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 and easy to remove after 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(`[${label}]: UNDEFINED`);
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: -1,
117
+ lineWidth: 40,
117
118
  replacer: escape ? escReplacer : function(name, value) {
118
119
  return value;
119
120
  }