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

feat: basepath should be case-insensitive #138

Merged
merged 3 commits into from
Oct 22, 2020
Merged

feat: basepath should be case-insensitive #138

merged 3 commits into from
Oct 22, 2020

Conversation

cbbfcd
Copy link
Contributor

@cbbfcd cbbfcd commented Oct 20, 2020

hello, @molefrog

The wouter matcher is case-insensitive by default, so the basepath should be case-insensitive default too ?

keep pathname and basepath with the same default behavior, so we can reducing user confusion.

Of course, we can also provide a sensitive parameter, but it should be applied to matcher and basepath at the same time, otherwise, we will ignore case by default.

Do you have any suggestions?

use-location.js Outdated
@@ -20,7 +20,7 @@ export default ({ base = "" } = {}) => {
// unfortunately, we can't rely on `path` value here, since it can be stale,
// that's why we store the last pathname in a ref.
const checkForUpdates = () => {
const pathname = currentPathname(base);
Copy link
Owner

Choose a reason for hiding this comment

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

Can we get the old name back, please 🙏
currentPathname is just more readable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, I just want to reduce the number of bytes

use-location.js Outdated Show resolved Hide resolved
@cbbfcd
Copy link
Contributor Author

cbbfcd commented Oct 22, 2020

@molefrog done. please review again.

@cbbfcd cbbfcd requested a review from molefrog October 22, 2020 03:17
@codecov-io
Copy link

Codecov Report

Merging #138 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #138   +/-   ##
=======================================
  Coverage   99.50%   99.50%           
=======================================
  Files           7        7           
  Lines         200      200           
  Branches       35       35           
=======================================
  Hits          199      199           
  Misses          1        1           
Impacted Files Coverage Δ
use-location.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89704a9...91ffb79. Read the comment docs.

Copy link
Owner

@molefrog molefrog left a comment

Choose a reason for hiding this comment

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

Great work @cbbfcd!
The CI is failing, but that's because of a problem with codecov command. I'll fix that later.

@molefrog molefrog merged commit a9daf2d into molefrog:master Oct 22, 2020
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.

3 participants