@jdeighan/coffee-utils 11.0.40 → 11.0.42

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": "11.0.40",
4
+ "version": "11.0.42",
5
5
  "description": "A set of utility functions for CoffeeScript",
6
6
  "main": "coffee_utils.js",
7
7
  "exports": {
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "homepage": "https://github.com/johndeighan/coffee-utils#readme",
50
50
  "dependencies": {
51
- "@jdeighan/exceptions": "^2.0.5",
51
+ "@jdeighan/base-utils": "^1.0.3",
52
52
  "cross-env": "^7.0.3",
53
53
  "js-yaml": "^4.1.0",
54
54
  "n-readlines": "^1.0.1",
@@ -56,6 +56,6 @@
56
56
  "svelte": "^3.52.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@jdeighan/unit-tester": "^2.0.60"
59
+ "@jdeighan/unit-tester": "^2.0.62"
60
60
  }
61
61
  }
@@ -3,7 +3,7 @@
3
3
  import pathlib from 'path'
4
4
  import {writable, readable, get} from 'svelte/store'
5
5
 
6
- import {assert, croak} from '@jdeighan/exceptions'
6
+ import {assert, croak} from '@jdeighan/base-utils'
7
7
  import {undef, pass} from '@jdeighan/coffee-utils'
8
8
  import {localStore} from '@jdeighan/coffee-utils/browser'
9
9
  import {
package/src/DataStores.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  assert,
13
13
  croak
14
- } from '@jdeighan/exceptions';
14
+ } from '@jdeighan/base-utils';
15
15
 
16
16
  import {
17
17
  undef,
@@ -1,7 +1,7 @@
1
1
  # Section.coffee
2
2
 
3
- import {assert, croak} from '@jdeighan/exceptions'
4
- import {dbg, dbgEnter, dbgReturn} from '@jdeighan/exceptions/debug'
3
+ import {assert, croak} from '@jdeighan/base-utils'
4
+ import {dbg, dbgEnter, dbgReturn} from '@jdeighan/base-utils/debug'
5
5
  import {
6
6
  pass, undef, defined, isArray, isEmpty, isFunction,
7
7
  } from '@jdeighan/coffee-utils'
package/src/Section.js CHANGED
@@ -3,13 +3,13 @@
3
3
  import {
4
4
  assert,
5
5
  croak
6
- } from '@jdeighan/exceptions';
6
+ } from '@jdeighan/base-utils';
7
7
 
8
8
  import {
9
9
  dbg,
10
10
  dbgEnter,
11
11
  dbgReturn
12
- } from '@jdeighan/exceptions/debug';
12
+ } from '@jdeighan/base-utils/debug';
13
13
 
14
14
  import {
15
15
  pass,
@@ -2,10 +2,10 @@
2
2
 
3
3
  import {
4
4
  assert, croak, LOG, LOGVALUE, LOGTAML, isTAML, fromTAML,
5
- } from '@jdeighan/exceptions'
5
+ } from '@jdeighan/base-utils'
6
6
  import {
7
7
  dbg, dbgEnter, dbgReturn, dbgYield, dbgResume,
8
- } from '@jdeighan/exceptions/debug'
8
+ } from '@jdeighan/base-utils/debug'
9
9
  import {
10
10
  pass, undef, defined, notdefined, OL, isEmpty, nonEmpty,
11
11
  isString, isHash, isArray, isUniqueTree, isNonEmptyString,
@@ -107,9 +107,8 @@ export class SectionMap
107
107
  # an array of section or set names or literal strings
108
108
  # i.e. it should NOT contain sub-arrays
109
109
 
110
- if isString(desc) || isArrayOfStrings(desc)
111
- dbgEnter "SectionMap.getBlock", desc
112
- else
110
+ dbgEnter "SectionMap.getBlock", desc
111
+ if ! isString(desc) && ! isArrayOfStrings(desc)
113
112
  croak "Bad desc: #{OL(desc)}"
114
113
 
115
114
  if isSectionName(desc)
package/src/SectionMap.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  LOGTAML,
11
11
  isTAML,
12
12
  fromTAML
13
- } from '@jdeighan/exceptions';
13
+ } from '@jdeighan/base-utils';
14
14
 
15
15
  import {
16
16
  dbg,
@@ -18,7 +18,7 @@ import {
18
18
  dbgReturn,
19
19
  dbgYield,
20
20
  dbgResume
21
- } from '@jdeighan/exceptions/debug';
21
+ } from '@jdeighan/base-utils/debug';
22
22
 
23
23
  import {
24
24
  pass,
@@ -131,9 +131,8 @@ export var SectionMap = class SectionMap {
131
131
  // a set name
132
132
  // an array of section or set names or literal strings
133
133
  // i.e. it should NOT contain sub-arrays
134
- if (isString(desc) || isArrayOfStrings(desc)) {
135
- dbgEnter("SectionMap.getBlock", desc);
136
- } else {
134
+ dbgEnter("SectionMap.getBlock", desc);
135
+ if (!isString(desc) && !isArrayOfStrings(desc)) {
137
136
  croak(`Bad desc: ${OL(desc)}`);
138
137
  }
139
138
  if (isSectionName(desc)) {
package/src/block.coffee CHANGED
@@ -3,8 +3,8 @@
3
3
  import fs from 'fs'
4
4
  import readline from 'readline'
5
5
 
6
- import {assert, croak} from '@jdeighan/exceptions'
7
- import {blockToArray, arrayToBlock} from '@jdeighan/exceptions/utils'
6
+ import {assert, croak} from '@jdeighan/base-utils'
7
+ import {blockToArray, arrayToBlock} from '@jdeighan/base-utils/utils'
8
8
  import {
9
9
  undef, pass, defined, notdefined,
10
10
  isEmpty, isString, isArray, nonEmpty, isArrayOfStrings,
package/src/block.js CHANGED
@@ -7,12 +7,12 @@ import readline from 'readline';
7
7
  import {
8
8
  assert,
9
9
  croak
10
- } from '@jdeighan/exceptions';
10
+ } from '@jdeighan/base-utils';
11
11
 
12
12
  import {
13
13
  blockToArray,
14
14
  arrayToBlock
15
- } from '@jdeighan/exceptions/utils';
15
+ } from '@jdeighan/base-utils/utils';
16
16
 
17
17
  import {
18
18
  undef,
package/src/fs.coffee CHANGED
@@ -5,8 +5,8 @@ import urllib from 'url'
5
5
  import fs from 'fs'
6
6
  import NReadLines from 'n-readlines'
7
7
 
8
- import {assert, croak, LOG, fromTAML} from '@jdeighan/exceptions'
9
- import {dbg, dbgEnter, dbgReturn} from '@jdeighan/exceptions/debug'
8
+ import {assert, croak, LOG, fromTAML} from '@jdeighan/base-utils'
9
+ import {dbg, dbgEnter, dbgReturn} from '@jdeighan/base-utils/debug'
10
10
  import {
11
11
  undef, pass, defined, rtrim, isEmpty, nonEmpty, getOptions,
12
12
  isString, isArray, isHash, isRegExp, isFunction, OL,
package/src/fs.js CHANGED
@@ -15,13 +15,13 @@ import {
15
15
  croak,
16
16
  LOG,
17
17
  fromTAML
18
- } from '@jdeighan/exceptions';
18
+ } from '@jdeighan/base-utils';
19
19
 
20
20
  import {
21
21
  dbg,
22
22
  dbgEnter,
23
23
  dbgReturn
24
- } from '@jdeighan/exceptions/debug';
24
+ } from '@jdeighan/base-utils/debug';
25
25
 
26
26
  import {
27
27
  undef,
package/src/fsa.coffee CHANGED
@@ -1,8 +1,8 @@
1
1
  # fsa.coffee
2
2
 
3
- import {assert, croak} from '@jdeighan/exceptions'
4
- import {LOG} from '@jdeighan/exceptions/log'
5
- import {dbg, dbgEnter, dbgReturn} from '@jdeighan/exceptions/debug'
3
+ import {assert, croak} from '@jdeighan/base-utils'
4
+ import {LOG} from '@jdeighan/base-utils/log'
5
+ import {dbg, dbgEnter, dbgReturn} from '@jdeighan/base-utils/debug'
6
6
  import {
7
7
  undef, defined, notdefined, words, isEmpty, nonEmpty,
8
8
  isString, OL,
package/src/fsa.js CHANGED
@@ -3,17 +3,17 @@
3
3
  import {
4
4
  assert,
5
5
  croak
6
- } from '@jdeighan/exceptions';
6
+ } from '@jdeighan/base-utils';
7
7
 
8
8
  import {
9
9
  LOG
10
- } from '@jdeighan/exceptions/log';
10
+ } from '@jdeighan/base-utils/log';
11
11
 
12
12
  import {
13
13
  dbg,
14
14
  dbgEnter,
15
15
  dbgReturn
16
- } from '@jdeighan/exceptions/debug';
16
+ } from '@jdeighan/base-utils/debug';
17
17
 
18
18
  import {
19
19
  undef,
package/src/html.coffee CHANGED
@@ -1,6 +1,6 @@
1
1
  # html.coffee
2
2
 
3
- import {assert, croak} from '@jdeighan/exceptions'
3
+ import {assert, croak} from '@jdeighan/base-utils'
4
4
  import {
5
5
  undef, pass, words, isEmpty, nonEmpty,
6
6
  } from '@jdeighan/coffee-utils'
package/src/html.js CHANGED
@@ -5,7 +5,7 @@ var hNoEnd, i, len, ref, tagName;
5
5
  import {
6
6
  assert,
7
7
  croak
8
- } from '@jdeighan/exceptions';
8
+ } from '@jdeighan/base-utils';
9
9
 
10
10
  import {
11
11
  undef,
package/src/indent.coffee CHANGED
@@ -1,6 +1,6 @@
1
1
  # indent.coffee
2
2
 
3
- import {assert, croak} from '@jdeighan/exceptions'
3
+ import {assert, croak} from '@jdeighan/base-utils'
4
4
  import {
5
5
  undef, defined, notdefined,
6
6
  OL, isInteger, isString, isArray, isEmpty, rtrim,
package/src/indent.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  assert,
5
5
  croak
6
- } from '@jdeighan/exceptions';
6
+ } from '@jdeighan/base-utils';
7
7
 
8
8
  import {
9
9
  undef,
package/src/svelte.coffee CHANGED
@@ -1,7 +1,7 @@
1
1
  # svelte.coffee
2
2
 
3
- import {assert, croak} from '@jdeighan/exceptions'
4
- import {LOG} from '@jdeighan/exceptions/log'
3
+ import {assert, croak} from '@jdeighan/base-utils'
4
+ import {LOG} from '@jdeighan/base-utils/log'
5
5
  import {isFunction} from '@jdeighan/coffee-utils'
6
6
 
7
7
  # ---------------------------------------------------------------------------
package/src/svelte.js CHANGED
@@ -3,11 +3,11 @@
3
3
  import {
4
4
  assert,
5
5
  croak
6
- } from '@jdeighan/exceptions';
6
+ } from '@jdeighan/base-utils';
7
7
 
8
8
  import {
9
9
  LOG
10
- } from '@jdeighan/exceptions/log';
10
+ } from '@jdeighan/base-utils/log';
11
11
 
12
12
  import {
13
13
  isFunction
package/src/taml.coffee CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  import yaml from 'js-yaml'
4
4
 
5
- import {assert, croak, isTAML, fromTAML, toTAML} from '@jdeighan/exceptions'
5
+ import {assert, croak, isTAML, fromTAML, toTAML} from '@jdeighan/base-utils'
6
6
  import {
7
7
  undef, defined, notdefined, OL, chomp, escapeStr,
8
8
  isString, isObject, isEmpty,
package/src/taml.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  isTAML,
9
9
  fromTAML,
10
10
  toTAML
11
- } from '@jdeighan/exceptions';
11
+ } from '@jdeighan/base-utils';
12
12
 
13
13
  import {
14
14
  undef,
package/src/utils.coffee CHANGED
@@ -1,7 +1,10 @@
1
1
  # utils.coffee
2
2
 
3
- import {assert, croak} from '@jdeighan/exceptions'
4
- import {LOG, sep_dash, sep_eq} from '@jdeighan/exceptions/log'
3
+ import {assert, croak} from '@jdeighan/base-utils'
4
+ import {LOG, LOGVALUE, sep_dash, sep_eq} from '@jdeighan/base-utils/log'
5
+ import {
6
+ dbgEnter, dbgReturn, dbgYield, dbgResume, dbg, setDebugging,
7
+ } from '@jdeighan/base-utils/debug'
5
8
  import {
6
9
  undef, pass, defined, notdefined,
7
10
  deepCopy, escapeStr, unescapeStr, hasChar, quoted, OL,
@@ -9,10 +12,13 @@ import {
9
12
  isConstructor, isFunction, isRegExp, isObject, getClassName,
10
13
  jsType, oneof,
11
14
  isEmpty, nonEmpty, chomp, rtrim, setCharsAt, words, getOptions,
12
- } from '@jdeighan/exceptions/utils'
15
+ } from '@jdeighan/base-utils/utils'
13
16
 
14
17
  export {
15
- undef, pass, defined, notdefined, LOG, sep_dash, sep_eq,
18
+ assert, croak,
19
+ LOG, LOGVALUE, sep_dash, sep_eq,
20
+ dbgEnter, dbgReturn, dbgYield, dbgResume, dbg, setDebugging,
21
+ undef, pass, defined, notdefined,
16
22
  deepCopy, escapeStr, unescapeStr, hasChar, quoted, OL,
17
23
  isString, isNumber, isInteger, isHash, isArray, isBoolean,
18
24
  isConstructor, isFunction, isRegExp, isObject, getClassName,
package/src/utils.js CHANGED
@@ -5,13 +5,23 @@ var hasProp = {}.hasOwnProperty;
5
5
  import {
6
6
  assert,
7
7
  croak
8
- } from '@jdeighan/exceptions';
8
+ } from '@jdeighan/base-utils';
9
9
 
10
10
  import {
11
11
  LOG,
12
+ LOGVALUE,
12
13
  sep_dash,
13
14
  sep_eq
14
- } from '@jdeighan/exceptions/log';
15
+ } from '@jdeighan/base-utils/log';
16
+
17
+ import {
18
+ dbgEnter,
19
+ dbgReturn,
20
+ dbgYield,
21
+ dbgResume,
22
+ dbg,
23
+ setDebugging
24
+ } from '@jdeighan/base-utils/debug';
15
25
 
16
26
  import {
17
27
  undef,
@@ -44,16 +54,25 @@ import {
44
54
  setCharsAt,
45
55
  words,
46
56
  getOptions
47
- } from '@jdeighan/exceptions/utils';
57
+ } from '@jdeighan/base-utils/utils';
48
58
 
49
59
  export {
60
+ assert,
61
+ croak,
62
+ LOG,
63
+ LOGVALUE,
64
+ sep_dash,
65
+ sep_eq,
66
+ dbgEnter,
67
+ dbgReturn,
68
+ dbgYield,
69
+ dbgResume,
70
+ dbg,
71
+ setDebugging,
50
72
  undef,
51
73
  pass,
52
74
  defined,
53
75
  notdefined,
54
- LOG,
55
- sep_dash,
56
- sep_eq,
57
76
  deepCopy,
58
77
  escapeStr,
59
78
  unescapeStr,