File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,10 +156,15 @@ export class DependencyDeputy {
156156 return this . _manifests . get ( workspaceName ) ?. devDependencies ?? [ ] ;
157157 }
158158
159+ private dependencyCache = new Map < string , DependencySet > ( ) ;
160+
159161 getDependencies ( workspaceName : string ) : DependencySet {
162+ let deps = this . dependencyCache . get ( workspaceName ) ;
163+ if ( deps ) return deps ;
160164 const manifest = this . _manifests . get ( workspaceName ) ;
161- if ( ! manifest ) return new Set ( ) ;
162- return new Set ( [ ...manifest . dependencies , ...manifest . devDependencies ] ) ;
165+ deps = manifest ? new Set ( [ ...manifest . dependencies , ...manifest . devDependencies ] ) : new Set ( ) ;
166+ this . dependencyCache . set ( workspaceName , deps ) ;
167+ return deps ;
163168 }
164169
165170 setInstalledBinaries ( workspaceName : string , installedBinaries : Map < string , Set < string > > ) {
You can’t perform that action at this time.
0 commit comments