Skip to content

fix(fs): accept exts without leading period in walk[Sync]() #5345

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

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jul 8, 2024

Previously, walk[Sync]() would return files and folders ending with strings, as defined in the exts option. E.g. It'd return the asserts folder when setting exts: ["ts"]. This is unexpected behaviour, as one would not expect folders to be turned when setting file extensions.

This change adds the leading period, ., to any extensions defined in exts, if missing, as there doesn't appear to be any good reason to require the user to have this leading period.

@iuioiua iuioiua requested a review from kt3k as a code owner July 8, 2024 00:14
@github-actions github-actions bot added the fs label Jul 8, 2024
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

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

Project coverage is 95.82%. Comparing base (b6906a9) to head (7760e94).

Files Patch % Lines
fs/walk.ts 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5345      +/-   ##
==========================================
- Coverage   95.82%   95.82%   -0.01%     
==========================================
  Files         458      458              
  Lines       37853    37859       +6     
  Branches     5563     5567       +4     
==========================================
+ Hits        36272    36277       +5     
- Misses       1541     1542       +1     
  Partials       40       40              

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

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 f222d80 into main Jul 8, 2024
13 checks passed
@iuioiua iuioiua deleted the fs-walk-period-prefix branch July 8, 2024 00:41
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