MCPcopy
hub / github.com/webpack/webpack / groupByFlag

Function groupByFlag

lib/stats/DefaultStatsFactoryPlugin.js:2160–2182  ·  view source on GitHub ↗
(name, exclude)

Source from the content-addressed store, hash-verified

2158 * @param {boolean=} exclude need exclude?
2159 */
2160 const groupByFlag = (name, exclude) => {
2161 groupConfigs.push({
2162 getKeys: (asset) => (asset[name] ? ["1"] : undefined),
2163 getOptions: () => ({
2164 groupChildren: !exclude,
2165 force: exclude
2166 }),
2167 createGroup: (key, children, assets) =>
2168 exclude
2169 ? {
2170 type: "assets by status",
2171 [name]: Boolean(key),
2172 filteredChildren: assets.length,
2173 ...assetGroup(children, assets)
2174 }
2175 : {
2176 type: "assets by status",
2177 [name]: Boolean(key),
2178 children,
2179 ...assetGroup(children, assets)
2180 }
2181 });
2182 };
2183 const {
2184 groupAssetsByEmitStatus,
2185 groupAssetsByPath,

Callers 2

MODULES_GROUPERSFunction · 0.85

Calls 3

assetGroupFunction · 0.85
moduleGroupFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected