MCPcopy Create free account
hub / github.com/npmx-dev/npmx.dev / hasChanged

Function hasChanged

server/utils/compare.ts:39–48  ·  view source on GitHub ↗
(fromNode: PackageFileTree, toNode: PackageFileTree)

Source from the content-addressed store, hash-verified

37}
38
39const hasChanged = (fromNode: PackageFileTree, toNode: PackageFileTree): boolean => {
40 // Prefer strong hash comparison when both hashes are available
41 if (fromNode.hash && toNode.hash) return fromNode.hash !== toNode.hash
42 // Fallback to size comparison if hashes are missing
43 if (typeof fromNode.size === 'number' && typeof toNode.size === 'number') {
44 return fromNode.size !== toNode.size
45 }
46 // If we lack comparable signals, assume unchanged
47 return false
48}
49
50/** Compare two file trees and return changes */
51export function compareFileTrees(

Callers 1

compareFileTreesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected