File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ export async function upgradePackageDefinitions(
4646 return ! options . jsonUpgraded || ! options . minimal || ! satisfies ( latestVersions [ dep ] , currentDependencies [ dep ] )
4747 } )
4848
49+ const filteredLatestDependencies = pickBy ( latestVersions , ( spec , dep ) => filteredUpgradedDependencies [ dep ] )
50+
4951 if ( options . peer && ! isEmpty ( filteredUpgradedDependencies ) ) {
50- const upgradedPeerDependencies = await getPeerDependenciesFromRegistry ( filteredUpgradedDependencies , options )
52+ const upgradedPeerDependencies = await getPeerDependenciesFromRegistry ( filteredLatestDependencies , options )
5153 const peerDependencies = { ...options . peerDependencies , ...upgradedPeerDependencies }
5254 if ( ! isEqual ( options . peerDependencies , peerDependencies ) ) {
5355 const [ newUpgradedDependencies , newLatestVersions , newPeerDependencies ] = await upgradePackageDefinitions (
Original file line number Diff line number Diff line change @@ -653,11 +653,7 @@ export const greatest: GetVersion = async (
653653 * @returns Promised {packageName: version} collection
654654 */
655655export const getPeerDependencies = async ( packageName : string , version : Version ) : Promise < Index < Version > > => {
656- // if version number uses >, omit the version and find latest
657- // otherwise, it will error out in the shell
658- // https://github.com/raineorshine/npm-check-updates/issues/1181
659- const atVersion = ! version . startsWith ( '>' ) ? `@${ version } ` : ''
660- const args = [ 'view' , `${ packageName } ${ atVersion } ` , 'peerDependencies' ]
656+ const args = [ 'view' , `${ packageName } @${ version } ` , 'peerDependencies' ]
661657 const result = await spawnNpm ( args , { } , { rejectOnError : false } )
662658 return result ? parseJson ( result , { command : [ ...args , '--json' ] . join ( ' ' ) } ) : { }
663659}
You can’t perform that action at this time.
0 commit comments