-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix mkdir and mkdirSync options #175
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,6 +95,14 @@ typedef FsWriteFileOptions = { | |
autoClose: true | ||
} | ||
**/ | ||
/** | ||
* options for `Fs.mkdir` and `Fs.mkdirSync` | ||
*/ | ||
typedef FsMakeDirOptions = { | ||
@:optional var recursive:Bool; | ||
@:optional var mode:FsMode; | ||
}; | ||
|
||
/** | ||
Options for `Fs.createReadStream`. | ||
**/ | ||
|
@@ -695,12 +703,12 @@ extern class Fs { | |
`mode` defaults to 0777. | ||
**/ | ||
@:overload(function(path:FsPath, callback:Error->Void):Void {}) | ||
static function mkdir(path:FsPath, mode:FsMode, callback:Error->Void):Void; | ||
static function mkdir(path:FsPath, options:FsMakeDirOptions, callback:Error->Void):Void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Shouldn't we do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, there's more to it:
and
for It's a bit tricky to have proper typing for this, so we can ignore this for now, but we'll have to look into this at some point. Maybe some |
||
|
||
/** | ||
Synchronous mkdir(2). | ||
**/ | ||
static function mkdirSync(path:FsPath, ?mode:FsMode):Void; | ||
static function mkdirSync(path:FsPath, ?options:FsMakeDirOptions):Void; | ||
|
||
/** | ||
Creates a unique temporary directory. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be called
FsMkdirOptions
to be consistent with the function names :)