Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2csv

Package Overview
Dependencies
Maintainers
3
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2csv - npm Package Compare versions

Comparing version 3.7.0 to 3.7.1

1

index.d.ts

@@ -20,2 +20,3 @@ declare namespace json2csv {

flatten?: boolean;
unwindPath?: string;
excelStrings?: boolean;

@@ -22,0 +23,0 @@ includeEmptyRows?: boolean;

14

lib/json2csv.js

@@ -16,3 +16,3 @@ /**

* @property {Array} data - array of JSON objects
* @property {Array} fields - see documentation for details
* @property {Array} [fields] - see documentation for details
* @property {String[]} [fieldNames] - names for fields at the same indexes. Must be same length as fields array

@@ -277,2 +277,3 @@ * (Optional. Maintained for backwards compatibility. Use fields config object for more features)

var dataRows = params.data;
if (params.unwindPath) {

@@ -282,3 +283,5 @@ dataRows = [];

var unwindArray = lodashGet(dataEl, params.unwindPath);
if (Array.isArray(unwindArray)) {
var isArr = Array.isArray(unwindArray);
if (isArr && unwindArray.length) {
unwindArray.forEach(function(unwindEl) {

@@ -289,2 +292,6 @@ var dataCopy = lodashCloneDeep(dataEl);

});
} else if (isArr && !unwindArray.length) {
var dataCopy = lodashCloneDeep(dataEl);
lodashSet(dataCopy, params.unwindPath, undefined);
dataRows.push(dataCopy);
} else {

@@ -295,3 +302,4 @@ dataRows.push(dataEl);

}
return dataRows;
}
}
{
"name": "json2csv",
"preferGlobal": "true",
"version": "3.7.0",
"version": "3.7.1",
"description": "Convert JSON to CSV",

@@ -6,0 +6,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc