MCPcopy
hub / github.com/webpack/webpack / mergeRelatedInfo

Function mergeRelatedInfo

lib/asset/AssetGenerator.js:130–139  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

128 * @returns {NonNullable<AssetInfo["related"]>} object
129 */
130const mergeRelatedInfo = (a, b) => {
131 const result = { ...a, ...b };
132 for (const key of Object.keys(a)) {
133 if (key in b) {
134 if (a[key] === b[key]) continue;
135 result[key] = mergeMaybeArrays(a[key], b[key]);
136 }
137 }
138 return result;
139};
140
141/**
142 * Encodes the provided encoding.

Callers 1

mergeAssetInfoFunction · 0.85

Calls 2

mergeMaybeArraysFunction · 0.85
keysMethod · 0.65

Tested by

no test coverage detected