memfs
memfs copied to clipboard
Typing mismatch between fs.mkdir and memfs.mkdir
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.
Just ran into this exact issue myself while creating some unit tests.
:tada: This issue has been resolved in version 3.4.12 :tada:
The release is available on:
Your semantic-release bot :package::rocket: