Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getBundleAssetsById = (assets = []) => assets.reduce((aggregator, asset) => {
if (IGNORE_PATTERN.test(asset.name)) {
return aggregator;
}
const source = getAssetName(asset.name);
// @TODO Get an uniq id (based on url, source)
const id = source;
const { size, ...restAssetProps } = asset;
return {
...aggregator,
[id]: {
...restAssetProps,
value: size,
},
};
}, {});