File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,9 @@ namespace ts {
290
290
const pnpapi = getPnpApi ( ) ;
291
291
292
292
const currentPackage = pnpapi . findPackageLocator ( `${ currentDirectory } /` ) ;
293
- Debug . assert ( ! ! currentPackage ) ;
293
+ if ( ! currentPackage ) {
294
+ return [ ] ;
295
+ }
294
296
295
297
const { packageDependencies} = pnpapi . getPackageInformation ( currentPackage ! ) ;
296
298
@@ -1647,13 +1649,15 @@ namespace ts {
1647
1649
const pnpApi = getPnpApi ( ) ;
1648
1650
1649
1651
const ownerPackage = pnpApi . findPackageLocator ( resolvedValue . path ) ;
1650
- Debug . assert ( ! ! ownerPackage ) ;
1652
+ if ( ! ownerPackage ) {
1653
+ return true ;
1654
+ }
1651
1655
1652
1656
const rootLocators = pnpApi . getDependencyTreeRoots ( ) ;
1653
1657
1654
1658
// External if none of the root locators owns the file
1655
1659
return ! rootLocators . some ( root => {
1656
- return root . name === ownerPackage ! . name && root . reference === ownerPackage ! . reference ;
1660
+ return root . name === ownerPackage . name && root . reference === ownerPackage . reference ;
1657
1661
} ) ;
1658
1662
}
1659
1663
}
You can’t perform that action at this time.
0 commit comments