@@ -22,10 +22,9 @@ async function analyzeAllPackageExports(
2222 signal ?: AbortSignal ,
2323) {
2424 throwIfAborted ( signal )
25- const packagePath = installation . sourcePath || installation . packagePath
2625 return getAllExports (
2726 installation . packageString ,
28- packagePath ,
27+ installation . packagePath ,
2928 installation . packageName ,
3029 installation . installPath ,
3130 signal ,
@@ -34,9 +33,9 @@ async function analyzeAllPackageExports(
3433
3534async function getExportsForInstalledPackage (
3635 installedPackage : InstalledPackage ,
37- options : InstallPackageOptions = { } ,
36+ options : InstallPackageOptions ,
37+ startTime : number ,
3838) {
39- const startTime = performance . now ( )
4039 const packageString = installedPackage . packageString
4140
4241 try {
@@ -57,13 +56,14 @@ export async function getPackageExports(
5756 packageInput : string | InstalledPackage ,
5857 options : InstallPackageOptions = { } ,
5958) {
59+ const startTime = performance . now ( )
6060 if ( typeof packageInput === 'string' ) {
6161 return withInstalledPackage ( packageInput , options , installedPackage =>
62- getExportsForInstalledPackage ( installedPackage , options ) ,
62+ getExportsForInstalledPackage ( installedPackage , options , startTime ) ,
6363 )
6464 }
6565
66- return getExportsForInstalledPackage ( packageInput , options )
66+ return getExportsForInstalledPackage ( packageInput , options , startTime )
6767}
6868
6969async function analyzePackageExportSizes (
@@ -166,9 +166,9 @@ async function analyzePackageExportSizes(
166166
167167async function getExportSizesForInstalledPackage (
168168 installedPackage : InstalledPackage ,
169- options : GetPackageStatsOptions = { } ,
169+ options : GetPackageStatsOptions ,
170+ startTime : number ,
170171) {
171- const startTime = performance . now ( )
172172 const packageString = installedPackage . packageString
173173
174174 try {
@@ -192,11 +192,12 @@ export async function getPackageExportSizes(
192192 packageInput : string | InstalledPackage ,
193193 options : GetPackageStatsOptions = { } ,
194194) {
195+ const startTime = performance . now ( )
195196 if ( typeof packageInput === 'string' ) {
196197 return withInstalledPackage ( packageInput , options , installedPackage =>
197- getExportSizesForInstalledPackage ( installedPackage , options ) ,
198+ getExportSizesForInstalledPackage ( installedPackage , options , startTime ) ,
198199 )
199200 }
200201
201- return getExportSizesForInstalledPackage ( packageInput , options )
202+ return getExportSizesForInstalledPackage ( packageInput , options , startTime )
202203}
0 commit comments