Skip to content

Commit

Permalink
finish mkdirp
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Nov 16, 2015
1 parent b46f5bb commit 1aa7c39
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,15 +828,14 @@ var writers = {}
* })
*/
writers.writeData = function (outPath, data, opts_, cb) {
if (typeof cb === undefined) {
if (typeof cb === 'undefined') {
cb = opts_
opts_ = undefined
}
if (!data) {
reporters.warn('You didn\'t pass any data to write.')
}

if (opts_ && opts_.makeDirectories) {
if (_.isObject(opts_) && opts_.makeDirectories) {
helpers.makeDirectories(outPath, proceed)
} else {
proceed()
Expand Down Expand Up @@ -902,11 +901,10 @@ writers.writeDataSync = function (outPath, data, opts_) {
* })
*/
writers.appendData = function (outPath, data, opts_, cb) {
if (typeof cb === undefined) {
if (typeof cb === 'undefined') {
cb = opts_
opts_ = undefined
}
if (opts_ && opts_.makeDirectories) {
if (_.isObject(opts_) && opts_.makeDirectories) {
helpers.makeDirectories(outPath, proceed)
} else {
proceed()
Expand All @@ -921,7 +919,7 @@ writers.appendData = function (outPath, data, opts_, cb) {
readers.readData(outPath, function (err, existingData) {
if (!err) {
data = existingData.concat(data)
writers.writeData(outPath, data, cb)
writers.writeData(outPath, data, opts_, cb)
} else {
cb(err)
}
Expand Down Expand Up @@ -969,9 +967,8 @@ writers.appendDataSync = function (outPath, data, opts_) {
* })
*/
writers.writeDbfToData = function (inPath, outPath, opts_, cb) {
if (typeof cb === undefined) {
if (typeof cb === 'undefined') {
cb = opts_
opts_ = undefined
}
readers.readDbf(inPath, function (error, jsonData) {
if (error) {
Expand Down

0 comments on commit 1aa7c39

Please sign in to comment.