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(uuid): remove V1Options in favor of GenerateOptions #4925

Merged
merged 1 commit into from
May 31, 2024

Conversation

iuioiua
Copy link
Collaborator

@iuioiua iuioiua commented May 31, 2024

What's changed

The V1Options interface, the options interface for generate(), has been removed from the public API and replaced by a new GenerateOptions interface.

The deprecation happened in #4872.

Why this change was made

The V1Options interface had a name that was inconsistent with options interfaces in the Standard Library codebase. Instead, options interfaces should be named XOptions, where X is the name of the symbol that the options interface belongs to.

Migration guide

To migrate, replace the use of V1Options with GenerateOptions.

- import { generate, validate, type V1Options } from "@std/uuid/v1";
+ import { generate, validate, type GenerateOptions } from "@std/uuid/v1";
  import { assert } from "@std/assert/assert";

- const options: V1Options = {
+ const options: GenerateOptions = {
    node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
    clockseq: 0x1234,
    msecs: new Date("2011-11-01").getTime(),
    nsecs: 5678,
  };

  const uuid = generate(options) as string;
  assert(validate(uuid));

@iuioiua iuioiua requested a review from kt3k as a code owner May 31, 2024 11:46
@github-actions github-actions bot added the uuid label May 31, 2024
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

Copy link

codecov bot commented May 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.70%. Comparing base (b1684ec) to head (a30381b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4925      +/-   ##
==========================================
- Coverage   92.12%   91.70%   -0.42%     
==========================================
  Files         487      487              
  Lines       38745    38745              
  Branches     5388     5355      -33     
==========================================
- Hits        35695    35533     -162     
- Misses       2994     3154     +160     
- Partials       56       58       +2     

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

@iuioiua iuioiua enabled auto-merge (squash) May 31, 2024 11:48
@iuioiua iuioiua merged commit 0bfa4fa into main May 31, 2024
13 checks passed
@iuioiua iuioiua deleted the uuid-remove-V1Options branch May 31, 2024 11:48
@iuioiua iuioiua mentioned this pull request Jun 2, 2024
10 tasks
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