MCPcopy
hub / github.com/webpack/webpack / getAllWasmModules

Function getAllWasmModules

lib/wasm-sync/WasmChunkLoadingRuntimeModule.js:32–48  ·  view source on GitHub ↗
(moduleGraph, chunkGraph, chunk)

Source from the content-addressed store, hash-verified

30 * @returns {Module[]} all wasm modules
31 */
32const getAllWasmModules = (moduleGraph, chunkGraph, chunk) => {
33 const wasmModules = chunk.getAllAsyncChunks();
34 /** @type {Module[]} */
35 const array = [];
36 for (const chunk of wasmModules) {
37 for (const m of chunkGraph.getOrderedChunkModulesIterable(
38 chunk,
39 compareModulesByIdentifier
40 )) {
41 if (m.type.startsWith("webassembly")) {
42 array.push(m);
43 }
44 }
45 }
46
47 return array;
48};
49
50/** @typedef {string[]} Declarations */
51

Callers 1

generateMethod · 0.85

Calls 3

getAllAsyncChunksMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected