// we want to calculate the hash of the entire dependency tree if (this.projectGraph.dependencies[targetProjectName]) { this.projectGraph.dependencies[targetProjectName].forEach((d) => { if ( !visited.has( this.computeExternalDependencyIdentifier(targetProjectName, d.target) ) ) { partialHashes.push( this.hashExternalDependency(targetProjectName, d.target, visited) ); } }); }
visited.add( this.computeExternalDependencyIdentifier( sourceProjectName, targetProjectName ) ); const node = this.projectGraph.externalNodes[targetProjectName]; let partialHash; if (node) { const partialHashes = []; if (node.data.hash) { // we already know the hash of this dependency partialHashes.push(node.data.hash); } else { // we take version as a hash partialHashes.push(node.data.version); } // we want to calculate the hash of the entire dependency tree if (this.projectGraph.dependencies[targetProjectName]) { this.projectGraph.dependencies[targetProjectName].forEach((d) => { if ( !visited.has( this.computeExternalDependencyIdentifier( targetProjectName, d.target ) ) ) { partialHashes.push( this.hashExternalDependencyV2(targetProjectName, d.target, visited) ); } }); }
partialHash = (0, impl_1.hashArray)(partialHashes); } else { // unknown dependency // this may occur if dependency is not an npm package // but rather symlinked in node_modules or it's pointing to a remote git repo // in this case we have no information about the versioning of the given package partialHash = `__${targetProjectName}__`; } this.externalDepsHashCache[targetProjectName] = partialHash; return partialHash; }