@relative-ci/agent
Version:
Send bundle stats and CI build information to RelativeCI
21 lines (18 loc) • 559 B
JavaScript
import _ from 'lodash';
import filter from '@bundle-stats/plugin-webpack-filter';
import { SOURCE_WEBPACK_STATS } from '../constants.js';
const SOURCE_FILTERS = {
[SOURCE_WEBPACK_STATS]: filter,
};
/**
* Filter artifact data based on the source type and map them by key
*/
function filterArtifacts(artifactsData) {
const dataByKey = {};
artifactsData.forEach(({ key, data }) => {
_.set(dataByKey, key, SOURCE_FILTERS[key](data));
});
return dataByKey;
}
export { filterArtifacts };
//# sourceMappingURL=filter-artifacts.js.map