@@ -884,15 +884,15 @@ export default function(options: UpdateSchema): Rule {
884
884
) ) ,
885
885
886
886
// Build a map of all dependencies and their packageJson.
887
- reduce < NpmRepositoryPackageJson , Map < string , NpmRepositoryPackageJson > > (
887
+ reduce < Partial < NpmRepositoryPackageJson > , Map < string , NpmRepositoryPackageJson > > (
888
888
( acc , npmPackageJson ) => {
889
889
// If the package was not found on the registry. It could be private, so we will just
890
890
// ignore. If the package was part of the list, we will error out, but will simply ignore
891
891
// if it's either not requested (so just part of package.json. silently) or if it's a
892
892
// `--all` situation. There is an edge case here where a public package peer depends on a
893
893
// private one, but it's rare enough.
894
894
if ( ! npmPackageJson . name ) {
895
- if ( packages . has ( npmPackageJson . requestedName ) ) {
895
+ if ( npmPackageJson . requestedName && packages . has ( npmPackageJson . requestedName ) ) {
896
896
if ( options . all ) {
897
897
logger . warn ( `Package ${ JSON . stringify ( npmPackageJson . requestedName ) } was not `
898
898
+ 'found on the registry. Skipping.' ) ;
@@ -903,7 +903,8 @@ export default function(options: UpdateSchema): Rule {
903
903
}
904
904
}
905
905
} else {
906
- acc . set ( npmPackageJson . name , npmPackageJson ) ;
906
+ // If a name is present, it is assumed to be fully populated
907
+ acc . set ( npmPackageJson . name , npmPackageJson as NpmRepositoryPackageJson ) ;
907
908
}
908
909
909
910
return acc ;
0 commit comments