• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pedromsantos / glenn / 12018517108

25 Nov 2024 08:47PM UTC coverage: 97.56%. Remained the same
12018517108

Pull #797

github

web-flow
chore(deps-dev): bump @commitlint/config-conventional

Bumps [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional) from 19.5.0 to 19.6.0.
- [Release notes](https://github.com/conventional-changelog/commitlint/releases)
- [Changelog](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/commitlint/commits/v19.6.0/@commitlint/config-conventional)

---
updated-dependencies:
- dependency-name: "@commitlint/config-conventional"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #797: chore(deps-dev): bump @commitlint/config-conventional from 19.5.0 to 19.6.0

250 of 271 branches covered (92.25%)

Branch coverage included in aggregate %.

1629 of 1655 relevant lines covered (98.43%)

538.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.81
/src/Domain/Interval.ts
1
import { IntervalPrimitives } from '../primitives/Interval';
2

3
export class IntervalQuality {
×
4
  private static readonly all: IntervalQuality[] = [];
19✔
5

6
  private constructor(private readonly name: string) {
95✔
7
    IntervalQuality.all.push(this);
95✔
8
  }
9

10
  get Name(): string {
11
    return this.name;
922✔
12
  }
13

14
  public static readonly Minor: IntervalQuality = new IntervalQuality('Minor');
19✔
15
  public static readonly Major: IntervalQuality = new IntervalQuality('Major');
19✔
16
  public static readonly Augmented: IntervalQuality = new IntervalQuality('Augmented');
19✔
17
  public static readonly Diminished: IntervalQuality = new IntervalQuality('Diminished');
19✔
18
  public static readonly Perfect: IntervalQuality = new IntervalQuality('Perfect');
19✔
19

20
  public static From(name: string) {
21
    switch (name) {
132✔
22
      case 'Minor':
23
        return IntervalQuality.Minor;
19✔
24
      case 'Major':
25
        return IntervalQuality.Major;
55✔
26
      case 'Augmented':
27
        return IntervalQuality.Augmented;
1✔
28
      case 'Diminished':
29
        return IntervalQuality.Diminished;
1✔
30
      case 'Perfect':
31
        return IntervalQuality.Perfect;
55✔
32
      default:
33
        throw new Error('Invalid interval quality');
1✔
34
    }
35
  }
36
}
37

38
export class Interval {
311,221✔
39
  private static readonly all: Interval[] = [];
19✔
40

41
  private constructor(
42
    private readonly name: string,
532✔
43
    private readonly abreviature: string,
532✔
44
    private readonly distance: number,
532✔
45
    private readonly quality: IntervalQuality,
532✔
46
    public invert: () => Interval,
532✔
47
    public raiseOctave: () => Interval
532✔
48
  ) {
49
    Interval.all.push(this);
532✔
50
  }
51

52
  get Name(): string {
53
    return this.name;
15✔
54
  }
55

56
  get To(): IntervalPrimitives {
57
    return {
922✔
58
      name: this.name,
59
      abreviature: this.abreviature,
60
      distance: this.distance,
61
      quality: this.quality.Name,
62
    };
63
  }
64

65
  public static From(primitive: IntervalPrimitives) {
66
    const interval = Interval.intervals.find(
133✔
67
      (i) =>
68
        i.name == primitive.name &&
1,389✔
69
        i.distance == primitive.distance &&
70
        i.abreviature == primitive.abreviature &&
71
        i.quality == IntervalQuality.From(primitive.quality)
72
    );
73

74
    if (!interval) {
132✔
75
      throw new Error('Invalid interval primitive');
1✔
76
    }
77

78
    return interval;
131✔
79
  }
80

81
  public static readonly Unison: Interval = new Interval(
19✔
82
    'Unison',
83
    'U',
84
    0,
85
    IntervalQuality.Perfect,
86
    () => Interval.PerfectOctave,
41✔
87
    () => Interval.PerfectOctave
6✔
88
  );
89

90
  public static readonly DiminishedUnison: Interval = new Interval(
19✔
91
    'Diminished Unison',
92
    'd1',
93
    -1,
94
    IntervalQuality.Diminished,
95
    () => Interval.AugmentedUnison,
4✔
96
    () => Interval.DiminishedUnison
3✔
97
  );
98

99
  public static readonly AugmentedUnison: Interval = new Interval(
19✔
100
    'Augmented Unison',
101
    'A1',
102
    1,
103
    IntervalQuality.Augmented,
104
    () => Interval.DiminishedUnison,
5✔
105
    () => Interval.AugmentedUnison
3✔
106
  );
107

108
  public static readonly MinorSecond: Interval = new Interval(
19✔
109
    'Minor Second',
110
    'm2',
111
    1,
112
    IntervalQuality.Minor,
113
    () => Interval.MajorSeventh,
40✔
114
    () => Interval.MinorNinth
4✔
115
  );
116

117
  public static readonly MajorSecond: Interval = new Interval(
19✔
118
    'Major Second',
119
    'M2',
120
    2,
121
    IntervalQuality.Major,
122
    () => Interval.MinorSeventh,
37✔
123
    () => Interval.MajorNinth
3✔
124
  );
125

126
  public static readonly AugmentedSecond: Interval = new Interval(
19✔
127
    'Augmented Second',
128
    'A2',
129
    3,
130
    IntervalQuality.Augmented,
131
    () => Interval.DiminishedSeventh,
9✔
132
    () => Interval.AugmentedNinth
3✔
133
  );
134

135
  public static readonly MinorThird: Interval = new Interval(
19✔
136
    'Minor Third',
137
    'm3',
138
    3,
139
    IntervalQuality.Minor,
140
    () => Interval.MajorSixth,
39✔
141
    () => Interval.MinorThird
8✔
142
  );
143

144
  public static readonly MajorThird: Interval = new Interval(
19✔
145
    'Major Third',
146
    'M3',
147
    4,
148
    IntervalQuality.Major,
149
    () => Interval.MinorSixth,
44✔
150
    () => Interval.MajorThird
2✔
151
  );
152

153
  public static readonly PerfectFourth: Interval = new Interval(
19✔
154
    'Perfect Fourth',
155
    'P4',
156
    5,
157
    IntervalQuality.Perfect,
158
    () => Interval.PerfectFifth,
47✔
159
    () => Interval.PerfectEleventh
6✔
160
  );
161

162
  public static readonly AugmentedFourth: Interval = new Interval(
19✔
163
    'Augmented Fourth',
164
    'A4',
165
    6,
166
    IntervalQuality.Augmented,
167
    () => Interval.DiminishedFifth,
1✔
168
    () => Interval.AugmentedEleventh
5✔
169
  );
170

171
  public static readonly DiminishedFifth: Interval = new Interval(
19✔
172
    'Diminished Fifth',
173
    'd5',
174
    6,
175
    IntervalQuality.Diminished,
176
    () => Interval.AugmentedFourth,
6✔
177
    () => Interval.DiminishedFifth
4✔
178
  );
179

180
  public static readonly Tritone: Interval = new Interval(
19✔
181
    'Diminished Fifth',
182
    'd5',
183
    6,
184
    IntervalQuality.Diminished,
185
    () => Interval.AugmentedFourth,
×
186
    () => Interval.Tritone
3✔
187
  );
188

189
  public static readonly PerfectFifth: Interval = new Interval(
19✔
190
    'Perfect Fifth',
191
    'P5',
192
    7,
193
    IntervalQuality.Perfect,
194
    () => Interval.PerfectFourth,
49✔
195
    () => Interval.PerfectFifth
4✔
196
  );
197

198
  public static readonly AugmentedFifth: Interval = new Interval(
19✔
199
    'Augmented Fifth',
200
    'A5',
201
    8,
202
    IntervalQuality.Augmented,
203
    () => Interval.AugmentedFourth,
1✔
204
    () => Interval.AugmentedFifth
6✔
205
  );
206

207
  public static readonly MinorSixth: Interval = new Interval(
19✔
208
    'Minor Sixth',
209
    'm6',
210
    8,
211
    IntervalQuality.Minor,
212
    () => Interval.MajorThird,
39✔
213
    () => Interval.MinorThirteenth
4✔
214
  );
215

216
  public static readonly MajorSixth: Interval = new Interval(
19✔
217
    'Major Sixth',
218
    'M6',
219
    9,
220
    IntervalQuality.Major,
221
    () => Interval.MinorThird,
37✔
222
    () => Interval.MajorThirteenth
2✔
223
  );
224

225
  public static readonly DiminishedSeventh: Interval = new Interval(
19✔
226
    'Diminished Seventh',
227
    'd7',
228
    9,
229
    IntervalQuality.Diminished,
230
    () => Interval.AugmentedSecond,
9✔
231
    () => Interval.DiminishedSeventh
2✔
232
  );
233

234
  public static readonly MinorSeventh: Interval = new Interval(
19✔
235
    'Minor Seventh',
236
    'm7',
237
    10,
238
    IntervalQuality.Minor,
239
    () => Interval.MajorSecond,
39✔
240
    () => Interval.MinorSeventh
5✔
241
  );
242

243
  public static readonly MajorSeventh: Interval = new Interval(
19✔
244
    'Major Seventh',
245
    'M7',
246
    11,
247
    IntervalQuality.Major,
248
    () => Interval.MinorSecond,
42✔
249
    () => Interval.MajorSeventh
×
250
  );
251

252
  public static readonly PerfectOctave: Interval = new Interval(
19✔
253
    'Perfect Octave',
254
    'PO',
255
    12,
256
    IntervalQuality.Perfect,
257
    () => Interval.Unison,
41✔
258
    () => Interval.PerfectOctave
2✔
259
  );
260

261
  public static readonly DiminishedNinth: Interval = new Interval(
19✔
262
    'Diminished Ninth',
263
    'd9',
264
    13,
265
    IntervalQuality.Minor,
266
    () => Interval.AugmentedUnison,
5✔
267
    () => Interval.DiminishedNinth
6✔
268
  );
269

270
  public static readonly MinorNinth: Interval = new Interval(
19✔
271
    'Minor Ninth',
272
    'm9',
273
    13,
274
    IntervalQuality.Minor,
275
    () => Interval.MajorSeventh,
3✔
276
    () => Interval.MinorNinth
4✔
277
  );
278

279
  public static readonly MajorNinth: Interval = new Interval(
19✔
280
    'Major Ninth',
281
    'M9',
282
    14,
283
    IntervalQuality.Major,
284
    () => Interval.MinorSeventh,
2✔
285
    () => Interval.MajorNinth
3✔
286
  );
287

288
  public static readonly AugmentedNinth: Interval = new Interval(
19✔
289
    'Augmented Ninth',
290
    'A9',
291
    15,
292
    IntervalQuality.Augmented,
293
    () => Interval.DiminishedUnison,
4✔
294
    () => Interval.AugmentedNinth
4✔
295
  );
296

297
  public static readonly PerfectEleventh: Interval = new Interval(
19✔
298
    'Perfect Eleventh',
299
    'P11',
300
    17,
301
    IntervalQuality.Perfect,
302
    () => Interval.PerfectFifth,
2✔
303
    () => Interval.PerfectEleventh
3✔
304
  );
305

306
  public static readonly AugmentedEleventh: Interval = new Interval(
19✔
307
    'Augmented Eleventh',
308
    'A11',
309
    18,
310
    IntervalQuality.Augmented,
311
    () => Interval.DiminishedFifth,
5✔
312
    () => Interval.AugmentedEleventh
6✔
313
  );
314

315
  public static readonly MinorThirteenth: Interval = new Interval(
19✔
316
    'Minor Thirteenth',
317
    'm13',
318
    20,
319
    IntervalQuality.Minor,
320
    () => Interval.MajorThird,
5✔
321
    () => Interval.MinorThirteenth
3✔
322
  );
323

324
  public static readonly MajorThirteenth: Interval = new Interval(
19✔
325
    'Major Thirteenth',
326
    'M13',
327
    21,
328
    IntervalQuality.Major,
329
    () => Interval.MinorThird,
2✔
330
    () => Interval.MajorThirteenth
2✔
331
  );
332

333
  isLargarThan(other: Interval): boolean {
334
    return this.distance > other.distance;
102✔
335
  }
336

337
  public static get intervals(): Interval[] {
338
    return Interval.all;
137✔
339
  }
340

341
  public static get unique(): Interval[] {
342
    return Interval.all.filter(
3✔
343
      (i) =>
344
        i.distance <= 12 &&
84✔
345
        (i.quality === IntervalQuality.Perfect ||
346
          i.quality === IntervalQuality.Minor ||
347
          i.quality === IntervalQuality.Major)
348
    );
349
  }
350
}
351

352
export const enum IntervalDirection {
37✔
353
  Ascending,
354
  Descending,
355
  Level,
356
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc