migrate angular 21
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 : '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user