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

fix: fix some possible issues with file paths #377

Merged
merged 3 commits into from
Nov 10, 2022

Conversation

RAX7
Copy link
Contributor

@RAX7 RAX7 commented Nov 8, 2022

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

  • flag isAbsolute is not relevant then we use it the second time, because the first time we are testing resourcePath and converting the filename to a relative path. We need to test it again before using it a second time.
  • function isAbsoluteURL does not test Windows paths correctly.
  • I added a function to change the file extension. It should be safe for windows and posix style path. path.parse and path.join are platform dependent.

@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Base: 76.32% // Head: 76.71% // Increases project coverage by +0.39% 🎉

Coverage data is based on head (ab3e336) compared to base (d19392e).
Patch coverage: 92.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #377      +/-   ##
==========================================
+ Coverage   76.32%   76.71%   +0.39%     
==========================================
  Files           4        4              
  Lines         697      713      +16     
  Branches      268      276       +8     
==========================================
+ Hits          532      547      +15     
- Misses        136      137       +1     
  Partials       29       29              
Impacted Files Coverage Δ
src/utils.js 61.32% <91.30%> (+1.53%) ⬆️
src/loader.js 96.15% <100.00%> (-0.94%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

Looks good, let's add tests cases so we will see do we have problem or not on windows

@RAX7
Copy link
Contributor Author

RAX7 commented Nov 8, 2022

@alexander-akait I don't know how to test it. Without this RP everything works fine, except #370

@RAX7
Copy link
Contributor Author

RAX7 commented Nov 9, 2022

@alexander-akait I've added some simple tests for isAbsolute but I still don't know how to reproduce this bug on Windows.

@alexander-akait
Copy link
Member

Thank you I will wait answer #370 for a while, if there's no response by the end of the week, I'll make a release

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

Successfully merging this pull request may close these issues.

None yet

2 participants