function prepareSourceMapChain (mapChain, original_code, filepath) {
    mapChain = mapChain.filter(o => o.map && o.map.mappings).reverse();

    if (mapChain.length > 1) {
        mapChain.forEach((obj, index) => {
            obj.map.version = 3;
            obj.map.file = filepath + '_' + index;
            // Check is in place because some transforms return sources, in particular multi-file sources.
            obj.map.sources = obj.map.sources.length === 1? [filepath + '_' + (index + 1)] : obj.map.sources;
            if(obj.map.sourcesContent && obj.map.sourcesContent.length === 1) {
                obj.map.sourcesContent = [mapChain[index + 1] ? mapChain[index + 1].code : original_code]
            }
        });
    }

    return mapChain;
}
@param {NollupTransformMapEntry[]} mapChain 
@param {string} original_code 
@param {string} filepath 
@return {NollupTransformMapEntry[]}