migrate angular 21

This commit is contained in:
2026-03-09 22:43:40 +01:00
parent 0203d4ea9d
commit 26c99a0dae
65 changed files with 19188 additions and 16946 deletions

View File

@@ -52,9 +52,7 @@ describe('TransposeService', () => {
const line: Line = {
type: LineType.chord,
text: '',
chords: [
{chord: 'Q', add: 'sus4', slashChord: null, position: 0, length: 1},
],
chords: [{chord: 'Q', add: 'sus4', slashChord: null, position: 0, length: 1}],
};
const rendered = service.renderChords(line);
@@ -66,9 +64,7 @@ describe('TransposeService', () => {
const line: Line = {
type: LineType.chord,
text: '',
chords: [
{chord: 'C', add: null, slashChord: 'Q', position: 0, length: 1},
],
chords: [{chord: 'C', add: null, slashChord: 'Q', position: 0, length: 1}],
};
const rendered = service.renderChords(line);
@@ -80,9 +76,7 @@ describe('TransposeService', () => {
const line: Line = {
type: LineType.chord,
text: '',
chords: [
{chord: 'C', add: null, slashChord: null, position: 120, length: 1},
],
chords: [{chord: 'C', add: null, slashChord: null, position: 120, length: 1}],
};
const rendered = service.renderChords(line);

View File

@@ -111,7 +111,7 @@ export class TransposeService {
private transposeChord(chord: Chord, map: TransposeMap): Chord {
const translatedChord = map[chord.chord] ?? 'X';
const translatedSlashChord = chord.slashChord ? map[chord.slashChord] ?? 'X' : null;
const translatedSlashChord = chord.slashChord ? (map[chord.slashChord] ?? 'X') : null;
return {
...chord,
@@ -147,7 +147,7 @@ export class TransposeService {
private renderChord(chord: Chord): string {
const renderedChord = scaleMapping[chord.chord] ?? 'X';
const renderedSlashChord = chord.slashChord ? scaleMapping[chord.slashChord] ?? 'X' : '';
const renderedSlashChord = chord.slashChord ? (scaleMapping[chord.slashChord] ?? 'X') : '';
return renderedChord + (chord.add ?? '') + (renderedSlashChord ? '/' + renderedSlashChord : '');
}