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

BREAKING(semver): do not accept undefined input in tryParse #5584

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

kt3k
Copy link
Member

@kt3k kt3k commented Jul 31, 2024

What's changed

The argument of tryParse becomes string instead of string | undefined.

Motivation

canParse and parse only accepts string. This change aligns tryParse to these similar APis.

Migration guide

-tryParse(version);
+typeof version === "string" ? tryParse(version) : undefined;

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

Good catch. Weird that we did this to begin with.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.48%. Comparing base (b315e04) to head (2d8f4f3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5584      +/-   ##
==========================================
- Coverage   96.48%   96.48%   -0.01%     
==========================================
  Files         465      465              
  Lines       37759    37756       -3     
  Branches     5579     5577       -2     
==========================================
- Hits        36432    36429       -3     
  Misses       1285     1285              
  Partials       42       42              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kt3k kt3k merged commit 8baede0 into denoland:main Jul 31, 2024
13 checks passed
@kt3k kt3k deleted the breaking-semver-try-parse branch July 31, 2024 03:59
@iuioiua
Copy link
Contributor

iuioiua commented Jul 31, 2024

Addresses #5220 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants