MCPcopy
hub / github.com/webpack/webpack / getKey

Method getKey

lib/optimize/SplitChunksPlugin.js:921–936  ·  view source on GitHub ↗
(chunks)

Source from the content-addressed store, hash-verified

919 * @returns {bigint | Chunk} key of the chunks
920 */
921 const getKey = (chunks) => {
922 const iterator = chunks[Symbol.iterator]();
923 let result = iterator.next();
924 if (result.done) return ZERO;
925 const first = result.value;
926 result = iterator.next();
927 if (result.done) return first;
928 let key =
929 /** @type {bigint} */ (chunkIndexMap.get(first)) |
930 /** @type {bigint} */ (chunkIndexMap.get(result.value));
931 while (!(result = iterator.next()).done) {
932 const raw = chunkIndexMap.get(result.value);
933 key ^= /** @type {bigint} */ (raw);
934 }
935 return key;
936 };
937 /**
938 * Returns stringified key.
939 * @param {bigint | Chunk} key key of the chunks

Callers

nothing calls this directly

Calls 8

hashFilenameFunction · 0.85
requestToIdFunction · 0.85
nextMethod · 0.45
getMethod · 0.45
identifierMethod · 0.45
nameForConditionMethod · 0.45
replaceMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected