Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
processChord(item, processor) {
if (item instanceof ChordSheetJS.ChordLyricsPair && item.chords) {
const parsedChord = Chord.parse(item.chords);
if (parsedChord) {
item.chords = processor(parsedChord).toString();
}
}
}
line.items.forEach(item => {
if (item instanceof ChordSheetJS.ChordLyricsPair) {
lyrics = lyrics + item.lyrics
}
})
return lyrics
line.items.forEach(item => {
if (item instanceof ChordSheetJS.ChordLyricsPair) {
if (item.chords) {
const parsedChord = Chord.parse(item.chords);
if (parsedChord != null && allChords.find(c => c.toString() == parsedChord.toString()) == null) {
allChords.push(parsedChord)
}
}
} else {
if (item.name == 'comment' && item.value) {
let commentSong = new ChordSheetJS.ChordProParser().parse(item.value)
getChords(commentSong).forEach(c => {
if (!allChords.some(ac => ac.toString() == c.toString())) {
allChords.push(c)
}
})
}
}
const processChord = (item, processor) => {
if (item instanceof ChordSheetJS.ChordLyricsPair && item.chords) {
const parsedChord = Chord.parse(item.chords);
if (parsedChord) {
const processedChordLyricsPair = item.clone();
processedChordLyricsPair.chords = processor(parsedChord).toString();
return processedChordLyricsPair;
}
}
return item;
};