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(path): remove GlobToRegExpOptions.os and OSType export #4928

Merged
merged 4 commits into from
Jun 4, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jun 2, 2024

What's changed

This change removes the os property from the GlobToRegExpOptions interface and the options interface for globToRegExp() and also removes OSType from the public API.

Why this change was made

The os property controlled which OS globToRegExp() worked for. More specifically, it controlled how it delimited paths, as path delimiters change between OSs. This was the only function in @std/path that had this functionality, as other functions instead detected the OS of the current machine and then used the appropriate OS-specific logic. Since the os property had the OSType type, it's now been removed from the public API.

Migration guide

If you'd like globToRegExp() to automatically work for the current machine's OS and didn't use the os option, there's no need to change your code.

However, if you'd like to use have globToRegExp() work for a specific OS, import the OS-specific version of the function. For POSIX systems:

- import { globToRegExp } from "@std/path/glob-to-regexp";
+ import { globToRegExp } from "@std/path/posix/glob-to-regexp";

- globToRegExp("*.js", { os: "posix" });
+ globToRegExp("*.js");

For Windows systems:

- import { globToRegExp } from "@std/path/glob-to-regexp";
+ import { globToRegExp } from "@std/path/windows/glob-to-regexp";

- globToRegExp("*.js", { os: "windows" });
+ globToRegExp("*.js");

Verified

This commit was signed with the committer’s verified signature.
ignatiusmb Ignatius Bagus
@github-actions github-actions bot added the path label Jun 2, 2024

Verified

This commit was signed with the committer’s verified signature.
ignatiusmb Ignatius Bagus
@iuioiua iuioiua changed the title BREAKING(fs): remove GlobToRegExpOptions.os BREAKING(path): remove GlobToRegExpOptions.os Jun 2, 2024
fix

Verified

This commit was signed with the committer’s verified signature.
ignatiusmb Ignatius Bagus
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.17%. Comparing base (267bc32) to head (f63ac06).

Files Patch % Lines
path/glob_to_regexp.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4928      +/-   ##
==========================================
- Coverage   92.17%   92.17%   -0.01%     
==========================================
  Files         487      487              
  Lines       38765    38765              
  Branches     5394     5394              
==========================================
- Hits        35732    35731       -1     
- Misses       2977     2978       +1     
  Partials       56       56              

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

@iuioiua iuioiua changed the title BREAKING(path): remove GlobToRegExpOptions.os BREAKING(path): remove GlobToRegExpOptions.os and OSType export Jun 2, 2024
@iuioiua iuioiua marked this pull request as ready for review June 2, 2024 22:25
@iuioiua iuioiua requested a review from kt3k as a code owner June 2, 2024 22:25

Verified

This commit was signed with the committer’s verified signature.
ignatiusmb Ignatius Bagus
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 1ac8985 into main Jun 4, 2024
12 checks passed
@iuioiua iuioiua deleted the fs-remove-GlobToRegExpOptions-osType branch June 4, 2024 04:03
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.

None yet

2 participants