MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / pathMatchesDigest

Function pathMatchesDigest

pkg/npm/install.js:352–360  ·  view source on GitHub ↗
(candidatePath, expectedDigest)

Source from the content-addressed store, hash-verified

350}
351
352function pathMatchesDigest(candidatePath, expectedDigest) {
353 try {
354 const status = fs.lstatSync(candidatePath);
355 return status.isFile() && !status.isSymbolicLink() &&
356 fileSha256(candidatePath) === expectedDigest;
357 } catch (_) {
358 return false;
359 }
360}
361
362function removeOwnedPublishedBinary(destDir, publishedDigests) {
363 for (const name of [WINDOWS_BINARY_NAME]) {

Callers 1

Calls 1

fileSha256Function · 0.85

Tested by

no test coverage detected