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

For async mkdir, call the callback when passed as the third argument #18

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

elliottsj
Copy link
Member

This is for parity with the Node.js fs.mkdir implementation, which may optionally accept options as the 2nd argument.

Previously, using memory-fs along with mkdirp results in this error:

var fs = new MemoryFileSystem();
mkdirp('/some/dir', { fs: fs }, cb => {/*...*/})
TypeError: callback is not a function
    at MemoryFileSystem.(anonymous function) [as mkdir] (node_modules/memory-fs/lib/MemoryFileSystem.js:281:11)
    at mkdirP (node_modules/mkdirp/index.js:27:9)

This PR will resolve such errors.

This is for parity with the Node.js fs.mkdir implementation, which
may accept optional options as the 2nd argument.
@sokra sokra merged commit 804dfa1 into webpack:master Sep 7, 2016
@sokra
Copy link
Member

sokra commented Sep 7, 2016

Thanks

@elliottsj elliottsj deleted the mkdir-callback branch September 8, 2016 04:27
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.

None yet

2 participants