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

Improve path handling #14

Merged
merged 9 commits into from
Nov 8, 2017
Merged

Improve path handling #14

merged 9 commits into from
Nov 8, 2017

Conversation

smikula
Copy link
Owner

@smikula smikula commented Nov 8, 2017

This introduces the NormalizedPath type. It's just an alias for string, but uses a trick to simulate nominal typing. (See Microsoft/Typescript #202 for details.) Any instance of NormalizedPath is guaranteed to be normalized because it can only be created by a call to normalizePath. Any variables that contain paths throughout the code have been updated to use this type.

This also includes a minor fix to normalize the drive letter to upper-case in Windows paths.

@smikula smikula merged commit c5416df into master Nov 8, 2017
@smikula smikula deleted the paths branch November 8, 2017 21:13
smikula added a commit that referenced this pull request Nov 8, 2017
The previous path handling changes (#14) end up leaking the `NormalizedPath` type.  Consumers should be allowed to just pass simple strings in for those paths.  This change introduces a new `NormalizedOptions` type that is used for options internally, separate from the `Options` object the consumer passes in.
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.

1 participant