Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(cli): the problem of isListablePackage condition #985

Merged
merged 4 commits into from Oct 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add/isListablePackage.ts
Expand Up @@ -8,7 +8,7 @@ export function isListablePackage(config: Config, packageJson: PackageJSON) {
return false;
}

if (!config.privatePackages && packageJson.private) {
if (!config.privatePackages?.version && packageJson.private) {
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test case that would cover the fix?

Isn't config.privatePackages always an object? If yes, shouldn't it be this?

Suggested change
if (!config.privatePackages?.version && packageJson.private) {
if (!config.privatePackages.version && packageJson.private) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have added test case, is that ok?

return false;
}

Expand Down