json-2-csv
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "json-2-csv", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"homepage": "https://github.com/mrodrig/json-2-csv", | ||
@@ -5,0 +5,0 @@ "moduleType": [ |
@@ -43,2 +43,8 @@ 'use strict'; | ||
json2csv: function (array, callback, opts) { | ||
// If this was promisified (callback and opts are swapped) then fix the argument order. | ||
if (_.isObject(callback) && !_.isFunction(callback)) { | ||
var func = opts; | ||
opts = callback; | ||
callback = func; | ||
} | ||
buildOptions(opts, function (err, options) { // Build the options | ||
@@ -59,2 +65,8 @@ if (err) { | ||
csv2json: function (csv, callback, opts) { | ||
// If this was promisified (callback and opts are swapped) then fix the argument order. | ||
if (_.isObject(callback) && !_.isFunction(callback)) { | ||
var func = opts; | ||
opts = callback; | ||
callback = func; | ||
} | ||
buildOptions(opts, function (err, options) { // Build the options | ||
@@ -61,0 +73,0 @@ if (err) { |
@@ -5,3 +5,3 @@ { | ||
"description": "A JSON to CSV and CSV to JSON converter that natively supports sub-documents and auto-generates the CSV heading.", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"repository": { | ||
@@ -31,5 +31,5 @@ "type": "git", | ||
"devDependencies": { | ||
"mocha": "~1.14.0", | ||
"should": "~2.0.2", | ||
"async": "~0.2.9" | ||
"mocha": "~2.2.4", | ||
"should": "~5.2.0", | ||
"async": "~0.2.10" | ||
}, | ||
@@ -36,0 +36,0 @@ "engines": { |
@@ -146,2 +146,3 @@ # Convert JSON to CSV or CSV to JSON | ||
- Allows for custom field delimiters, end of line delimiters, etc. | ||
- Promisifiable via bluebird's .promisify(<function) and .promisifyAll() (as of 1.1.1) | ||
@@ -148,0 +149,0 @@ ## F.A.Q. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97951
296
155