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

Omit deprecated versions by default #77

Merged
merged 9 commits into from
Feb 21, 2024

Conversation

tommy-mitchell
Copy link
Contributor

@tommy-mitchell tommy-mitchell commented Feb 20, 2024

Closes #70.

Adds a new omitDeprecated option (true by default). If set, versions marked as deprecated on the registry are omitted from results. Providing a dist tag or a specific version will still return that version, even if it's deprecated. If no version can be found once deprecated versions are omitted, a VersionNotFoundError is thrown.

@tommy-mitchell
Copy link
Contributor Author

tommy-mitchell commented Feb 20, 2024

lol - I had put ignoreDeprecated in the types, but used omitDeprecated in the source code. Proved my own point 😅

index.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

I would go with omitDeprecated.

@sindresorhus sindresorhus merged commit 2238f3f 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.

Add option to ignore deprecated versions
2 participants