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): replace prerelease and buildmetadata arguments with options object #5471

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jul 17, 2024

What's changed

The prerelease and buildmetadata arguments for increment() into a new optional IncrementOptions interface.

Motivation

This change was made to ensure the symbol adheres to the Deno Style Guide which states that optional arguments should go into an options object.

Migration

To migrate, use the options argument, instead of the positional arguments in increment().

import { increment, parse } from "./semver/mod.ts";

- increment(parse("1.2.3"), "prerelease", "alpha", "0");
+ increment(parse("1.2.3"), "prerelease", { prerelease: "alpha", build: "0" });

Related

Closes #4420

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.35%. Comparing base (3af2ed3) to head (cb1ad64).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5471      +/-   ##
==========================================
- Coverage   96.35%   96.35%   -0.01%     
==========================================
  Files         463      463              
  Lines       37729    37728       -1     
  Branches     5568     5568              
==========================================
- Hits        36355    36354       -1     
  Misses       1332     1332              
  Partials       42       42              

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

@iuioiua iuioiua changed the title BREAKING(semver): replace prerelease and build arguments with options object BREAKING(semver): replace prerelease and buildmetadata arguments with options object Jul 17, 2024
@iuioiua iuioiua marked this pull request as ready for review July 18, 2024 00:05
@iuioiua iuioiua requested a review from kt3k as a code owner July 18, 2024 00:05
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@iuioiua iuioiua merged commit 702f048 into main Jul 18, 2024
18 checks passed
@iuioiua iuioiua deleted the semver-increment-options branch July 18, 2024 04:53
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.

suggestion(semver): remove redundant increment() arguments
2 participants