Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli-hooks/src/check-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async function collectVersionInfo(packageName) {
async function getProjectPackageVersion(packageName) {
const stdout = await execWrapper(`npm list ${packageName} --depth=0 --json`);
const currentVersionOutput = JSON.parse(stdout);
if (!currentVersionOutput.dependencies || !currentVersionOutput.dependencies[packageName]) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁️‍🗨️ thought: IMHO the chained pattern is confusing in this statement and might make later changes more difficult.

if (!currentVersionOutput.dependencies?.[packageName]) {
throw new Error(`Failed to gather project information about ${packageName}`);
}
return currentVersionOutput.dependencies[packageName].version;
Expand Down