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

Improve handling of default options #79

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

tommy-mitchell
Copy link
Contributor

Fixes #78.

Previously, setting options.version to undefined would return all versions of a package, instead of the latest version. This is technically a breaking change (especially for https://github.com/sindresorhus/package-json-cli), but I think it's the correct behavior.

index.js Outdated Show resolved Hide resolved
@tommy-mitchell
Copy link
Contributor Author

The undefined issue is even accounted for in latest-version-cli:

const {range: version} = cli.flags;

const result = await latestVersion(cli.input[0], version ? {version} : {});

@sindresorhus sindresorhus merged commit c554238 into sindresorhus:main Feb 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is options.allVersions needed?
2 participants