@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
25 lines • 875 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Mapper = void 0;
exports.map = map;
const search_enrichers_1 = require("./search-enrichers");
var Mapper;
(function (Mapper) {
Mapper["Enrichment"] = "enrichment";
})(Mapper || (exports.Mapper = Mapper = {}));
const Mappers = {
[Mapper.Enrichment]: {
mapper: (e, _data, enrichment) => {
const enrichmentData = search_enrichers_1.Enrichments[enrichment];
const content = (0, search_enrichers_1.enrichmentContent)(e, enrichment);
return content !== undefined ? enrichmentData.mapper?.(content) ?? [] : [];
}
}
};
/**
* Maps the given search element using the specified mapper and arguments.
*/
function map(e, data, mapper, args) {
return Mappers[mapper].mapper(e, data, args);
}
//# sourceMappingURL=search-mappers.js.map