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

Typing mismatch between fs.mkdir and memfs.mkdir #546

Closed
chmac opened this issue Jun 5, 2020 · 2 comments · Fixed by #882
Closed

Typing mismatch between fs.mkdir and memfs.mkdir #546

chmac opened this issue Jun 5, 2020 · 2 comments · Fixed by #882

Comments

@chmac
Copy link

chmac commented Jun 5, 2020

Firstly and most importantly, huge thanks for this package, it's awesome.

I tried to drop in the output from createFsFromVolume() instead of the native fs and I hit a snag. There's a minor typing mismatch.

Conversion of type 'IFs' to type 'FS' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
  The types returned by 'promises.mkdir(...)' are incompatible between these types.
    Type 'Promise<void>' is not comparable to type 'Promise<string>'.
      Type 'void' is not comparable to type 'string'.ts(2352)

Looking into this a little, the node fs.mkdir and fs.promises.mkdir optionally return the path to the first directory created when the recursive: true option is set. While memfs.mkdir always returns void.

@chet-manley
Copy link

Just ran into this exact issue myself while creating some unit tests.

@streamich
Copy link
Owner

🎉 This issue has been resolved in version 3.4.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants