MCPcopy
hub / github.com/webpack/webpack / buildFsInfoWithSnapshot

Function buildFsInfoWithSnapshot

test/FileSystemInfo.unittest.js:599–617  ·  test/FileSystemInfo.unittest.js::buildFsInfoWithSnapshot
(
			/** @type {(err?: Error | null, fs?: IFs, snapshot?: Snapshot | null) => void} */ callback
		)

Source from the content-addressed store, hash-verified

597 class="cm">// cache miss and re-read from disk so snapshots stay valid.
598 describe(class="st">"existence-only watchpack entries", () => {
599 const buildFsInfoWithSnapshot = (
600 /** @type {(err?: Error | null, fs?: IFs, snapshot?: Snapshot | null) => void} */ callback
601 ) => {
602 const fs = createFs();
603 const fsInfo = createFsInfo(fs);
604 fsInfo.createSnapshot(
605 Date.now() + 10000,
606 files,
607 directories,
608 missing,
609 /** @type {SnapshotOptions} */ (
610 /** @type {unknown} */ ([class="st">"timestamp", { timestamp: true }])
611 ),
612 (err, snapshot) => {
613 if (err) return callback(err);
614 callback(null, fs, snapshot);
615 }
616 );
617 };
618
619 const onlyNonIgnored = (/** @type {string[]} */ paths) =>
620 paths.filter((/** @type {string} */ p) => !ignored.includes(p));

Callers 1

Calls 4

createFsFunction · 0.85
createFsInfoFunction · 0.85
createSnapshotMethod · 0.80
callbackFunction · 0.70

Tested by

no test coverage detected