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

V2 #8

Closed
wants to merge 18 commits into from
Closed

V2 #8

wants to merge 18 commits into from

Conversation

caseyWebb
Copy link

@caseyWebb caseyWebb commented Jan 18, 2019

  • Adds unit test & TravisCI config (xplat)
  • Remove globby dependency (no deps! 🎉)
  • Adds async version
  • Adds TypeScript defs

Closes #3
Closes #5

Might close #2

Fixes issue in barsh/UniversitySite

https://travis-ci.org/caseyWebb/true-case-path

Breaking Changes

  • Named exports (was module.exports = trueCasePathSync, now module.exports = { trueCasePath, trueCasePathSync }
  • Anything relying on (undocumented) glob matching no longer works
  • Drop Node 6

How does it work

First, make the path absolute if not already. Then, split on the delimiter (\ on Windows, / everywhere else). Then, starting at the fs root, get the contents, and try matching each against a case insensitive regex constructed with the segment. When found, append the real dir/file name. Continue.

@rmehner
Copy link

rmehner commented Apr 24, 2019

👋 @caseyWebb,

In regards to #9, I've tested this with the bug I've found and your version indeed fixes this. Couldn't test it on old HFS devices tho.

Have you published this version somewhere in the meanwhile? If so, I'd look into replacing the existing dep at Gatsby with your version.

Thanks for your work!

Btw. I've added a test to your branch, but can't figure out how to PR onto this branch, so here's the diff: https://gist.github.com/rmehner/f6b92c2cc00dae7ba7a666a988cb03c1

@caseyWebb
Copy link
Author

@rmehner, I haven't published this, but @barsh is actually my boss. He's out of town right now, but I'll give him a ping to publish this when he's back.

@caseyWebb
Copy link
Author

Forked to https://github.com/Profiscience/true-case-path, published on npm as 2.0.0

@caseyWebb caseyWebb closed this Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants