blob: 7ce0d194f3d690f0066afb4a356f5993e2f7bd1d [file] [log] [blame]
module.exports = function remapFunction(genItem, getMapping) {
const mapping = getMapping(genItem.loc);
if (!mapping) {
return null;
}
const declMapping = genItem.decl && getMapping(genItem.decl);
const srcItem = {
name: genItem.name,
line: mapping.loc.start.line,
loc: mapping.loc,
decl: declMapping ? declMapping.loc : undefined,
};
if (genItem.skip) {
srcItem.skip = genItem.skip;
}
return { srcItem, source: mapping.source };
};