discombobulator 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "discombobulator",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Discombobulator core library",
5
5
  "license": "ISC",
6
6
  "author": "Mark Webb",
@@ -2,7 +2,8 @@
2
2
  //
3
3
  // An articulation is a modification to a note, such as an accent or roll.
4
4
 
5
- import util from "util";
5
+ // import util from "util";
6
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
6
7
 
7
8
  import { Element } from "./element.mjs";
8
9
 
@@ -21,7 +22,8 @@ export class Articulation extends Element {
21
22
  return "Articulation";
22
23
  }
23
24
 
24
- [util.inspect.custom](depth, opts) {
25
+ // [util.inspect.custom](depth, opts) {
26
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
25
27
  return `${this[Symbol.toStringTag]} {${
26
28
  !!this.#symbol ? this.#symbol.toString() : "undefined"
27
29
  }}`;
package/src/group.mjs CHANGED
@@ -2,7 +2,8 @@
2
2
  //
3
3
  // A group is a time-axis pattern that specifies how chords may be grouped.
4
4
 
5
- import util from "util";
5
+ // import util from "util";
6
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
6
7
 
7
8
  import { Element } from "./element.mjs";
8
9
 
@@ -56,7 +57,8 @@ export class Group extends Element {
56
57
  return description;
57
58
  }
58
59
 
59
- [util.inspect.custom](depth, opts) {
60
+ // [util.inspect.custom](depth, opts) {
61
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
60
62
  return `${this[Symbol.toStringTag]} {${this.#describe()}}`;
61
63
  }
62
64
 
package/src/groupset.mjs CHANGED
@@ -3,7 +3,8 @@
3
3
  // A group set is a set of groups, and allows patterns to be generated by
4
4
  // permutating the group set with a pattern set.
5
5
 
6
- import util from "util";
6
+ // import util from "util";
7
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
7
8
 
8
9
  import { bitCount, factorial } from "./util.mjs";
9
10
  import { permutations, permutationIndexGenerator } from "./permute.mjs";
@@ -60,13 +61,15 @@ export class GroupSet extends Set {
60
61
  let description = "";
61
62
 
62
63
  for (let pattern of this) {
63
- description += util.inspect(pattern);
64
+ // description += util.inspect(pattern);
65
+ description += inspect(pattern); // from Disco App (base44)
64
66
  }
65
67
 
66
68
  return description;
67
69
  }
68
70
 
69
- [util.inspect.custom](depth, opts) {
71
+ // [util.inspect.custom](depth, opts) {
72
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
70
73
  return `${this[Symbol.toStringTag]} {${this.#describe()}}`;
71
74
  }
72
75
 
@@ -2,7 +2,8 @@
2
2
  //
3
3
  // An instrument is a playing surface that generates a note.
4
4
 
5
- import util from "util";
5
+ // import util from "util";
6
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
6
7
 
7
8
  import { Element } from "./element.mjs";
8
9
 
@@ -21,7 +22,8 @@ export class Instrument extends Element {
21
22
  return "Instrument";
22
23
  }
23
24
 
24
- [util.inspect.custom](depth, opts) {
25
+ // [util.inspect.custom](depth, opts) {
26
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
25
27
  return `Instrument {${
26
28
  !!this.#symbol ? this.#symbol.toString() : "undefined"
27
29
  }}`;
@@ -3,7 +3,8 @@
3
3
  // chords in a group varies based on another range, and all permutation of such groups
4
4
  // are generated.
5
5
 
6
- import util from "util";
6
+ // import util from "util";
7
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
7
8
 
8
9
  import { bitCount } from "./util.mjs";
9
10
  import { combinations, ithBinaryCombination } from "./permute.mjs";
@@ -103,11 +104,13 @@ export class IrregularGroupSet extends RegularGroupSet {
103
104
  );
104
105
  }
105
106
 
106
- [util.inspect.custom](depth, opts) {
107
+ // [util.inspect.custom](depth, opts) {
108
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
107
109
  let groups = "";
108
110
 
109
111
  for (const group of this) {
110
- groups += (groups.length == 0 ? "" : ", ") + util.inspect(group);
112
+ // groups += (groups.length == 0 ? "" : ", ") + util.inspect(group);
113
+ groups += (groups.length == 0 ? "" : ", ") + inspect(group);
111
114
  }
112
115
 
113
116
  return `${this[Symbol.toStringTag]} {[${groups}]}`;
package/src/note.mjs CHANGED
@@ -2,7 +2,8 @@
2
2
  //
3
3
  // A note is a tuple of an instrument and a set of articulations that affect how it's played.
4
4
 
5
- import util from "util";
5
+ // import util from "util";
6
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
6
7
 
7
8
  import { Element } from "./element.mjs";
8
9
  import { Instrument } from "./instrument.mjs";
@@ -87,11 +88,14 @@ export class Note extends Element {
87
88
  return this;
88
89
  }
89
90
 
90
- [util.inspect.custom](depth, opts) {
91
+ // [util.inspect.custom](depth, opts) {
92
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
91
93
  return `${this[Symbol.toStringTag]} {${
92
- !!this.#instrument ? util.inspect(this.#instrument) : "undefined"
94
+ // !!this.#instrument ? util.inspect(this.#instrument) : "undefined"
95
+ !!this.#instrument ? inspect(this.#instrument) : "undefined"
93
96
  }, {${
94
- !!this.#articulations ? util.inspect(this.#articulations) : "undefined"
97
+ // !!this.#articulations ? util.inspect(this.#articulations) : "undefined"
98
+ !!this.#articulations ? inspect(this.#articulations) : "undefined"
95
99
  }}}`;
96
100
  }
97
101
 
@@ -1,7 +1,8 @@
1
1
  // RegularGroupGenerator is a Group generator that generates fully active
2
2
  // groups in a range determined by boundaries and a step rate.
3
3
 
4
- import util from "util";
4
+ // import util from "util";
5
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
5
6
 
6
7
  import { bitCount } from "./util.mjs";
7
8
  import { Group } from "./group.mjs";
@@ -77,11 +78,13 @@ export class RegularGroupSet extends GroupSet {
77
78
  return "RegularGroupSet";
78
79
  }
79
80
 
80
- [util.inspect.custom](depth, opts) {
81
+ // [util.inspect.custom](depth, opts) {
82
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
81
83
  let groups = "";
82
84
 
83
85
  for (const group of this) {
84
- groups += (groups.length == 0 ? "" : ", ") + util.inspect(group);
86
+ // groups += (groups.length == 0 ? "" : ", ") + util.inspect(group);
87
+ groups += (groups.length == 0 ? "" : ", ") + inspect(group);
85
88
  }
86
89
 
87
90
  return `${this[Symbol.toStringTag]} {[${groups}]}`;
package/src/schedule.mjs CHANGED
@@ -7,7 +7,9 @@
7
7
  // The duration is used by Schema to calculate the duration of each chord in each
8
8
  // pattern.
9
9
 
10
- import util from "util";
10
+ // import util from "util";
11
+ import { inspect } from "./util-adapter.mjs"; // From Disco App (base44)
12
+
11
13
  import Fraction from "fraction.js"
12
14
 
13
15
  import { Set } from "./set.mjs";
@@ -42,13 +44,15 @@ export class Schedule extends Set {
42
44
  let description = "";
43
45
 
44
46
  for (let patterns of this) {
45
- description += util.inspect(patterns);
47
+ // description += util.inspect(patterns);
48
+ description += inspect(patterns); // from Disco App (base44)
46
49
  }
47
50
 
48
51
  return description;
49
52
  }
50
53
 
51
- [util.inspect.custom](depth, opts) {
54
+ // [util.inspect.custom](depth, opts) {
55
+ [Symbol.for('nodejs.util.inspect.custom')](depth, opts) { // from Disco App (base44)
52
56
  return `${this[Symbol.toStringTag]} {${this.#duration.toString()}, {${this.#describe()}}}`;
53
57
  }
54
58