Source: Parser/joiner.js

/**
 * Combines two ParserOutput objects storing the result into the first provided argument
 * NOTE: This changes the first object
 * @param {ParserOutput} pDataOne Copy target. This will be changed by this function
 * @param {ParserOutput} pDataTwo Copy source.
 * @param {object} lyricsOne Lyrics per track. Expected mapping track index number to lyric string. Copy target. This will be changed by this function.
 * @param {object} lyricsTwo Lyrics per track. Expected mapping track index number to lyric string. Copy source.
 */
const join = (pDataOne, pDataTwo, lyricsOne, lyricsTwo) => {

    pDataTwo.alphaTexStructure.tracks.forEach(track => {
        pDataOne.alphaTexStructure.tracks.push(track);
    });

    let latestIndex = 0;
    while(lyricsOne[latestIndex]) {
        latestIndex++;
    }

    let index = 0;
    while(lyricsTwo[index]) {
        lyricsOne[latestIndex+index] = lyricsTwo[index];
        index++;        
    }
}

module.exports = {join};