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

Fslib API #533

Merged
merged 4 commits into from
Oct 16, 2019
Merged

Fslib API #533

merged 4 commits into from
Oct 16, 2019

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Oct 16, 2019

What's the problem this PR addresses?

  • The toPortablePath / fromPortablePath were exposed from both NodeFS and path.ts.
  • There was no way to implement a partial FakeFS without implementing each and every method.
  • Checking whether a path is contained in another path is common but annoying to reimplement.

How did you fix it?

  • The toPortablePath and fromPortablePath are moved into npath. Callsites are updated.
  • A new NoFS implementation will throw at runtime for each unimplemented method.
  • Both npath and ppath now expose an utility called contains which returns null if the second parameter isn't contained in the first one, or the subpath otherwise.

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