(tree: PackageFileTree[])
| 27 | |
| 28 | /** Flatten a file tree into a map of path -> node */ |
| 29 | export function flattenTree(tree: PackageFileTree[]): Map<string, PackageFileTree> { |
| 30 | const result = new Map<string, PackageFileTree>() |
| 31 | |
| 32 | traverse(tree, node => { |
| 33 | result.set(node.path, node) |
| 34 | }) |
| 35 | |
| 36 | return result |
| 37 | } |
| 38 | |
| 39 | const hasChanged = (fromNode: PackageFileTree, toNode: PackageFileTree): boolean => { |
| 40 | // Prefer strong hash comparison when both hashes are available |
no test coverage detected