MCPcopy
hub / github.com/webpack/webpack / updateSrc

Function updateSrc

test/PersistentCaching.test.js:66–74  ·  test/PersistentCaching.test.js::updateSrc
(/** @type {Record<string, string>} */ data)

Source from the content-addressed store, hash-verified

64 });
65
66 const updateSrc = async (/** @type {Record<string, string>} */ data) => {
67 const ts = new Date(Date.now() - 10000);
68 await mkdir(srcPath, { recursive: true });
69 for (const key of Object.keys(data)) {
70 const p = path.resolve(srcPath, key);
71 await writeFile(p, data[key]);
72 await utimes(p, ts, ts);
73 }
74 };
75
76 const compile = async (/** @type {EXPECTED_ANY} */ configAdditions = {}) =>
77 new Promise((resolve, reject) => {

Callers 1

Calls 4

mkdirFunction · 0.70
writeFileFunction · 0.70
keysMethod · 0.65
resolveMethod · 0.65

Tested by

no test coverage detected