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

json2csv

Package Overview
Dependencies
Maintainers
4
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 4.0.1 to 4.0.2

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="4.0.2"></a>
## [4.0.2](https://github.com/zemirco/json2csv/compare/v4.0.1...v4.0.2) (2018-03-09)
### Bug Fixes
* **parser:** RangeError ([#271](https://github.com/zemirco/json2csv/issues/271)) ([c8d5a87](https://github.com/zemirco/json2csv/commit/c8d5a87))
<a name="4.0.1"></a>

@@ -7,0 +17,0 @@ ## [4.0.1](https://github.com/zemirco/json2csv/compare/v4.0.0...v4.0.1) (2018-03-05)

43

lib/JSON2CSVBase.js

@@ -65,2 +65,3 @@ 'use strict';

: [row];
if (this.opts.flatten) {

@@ -235,28 +236,26 @@ return processedRow.map(this.flatten);

unwindData(dataRow, unwindPaths) {
return Array.prototype.concat.apply([],
unwindPaths.reduce((data, unwindPath) =>
Array.prototype.concat.apply([],
data.map((dataEl) => {
const unwindArray = lodashGet(dataEl, unwindPath);
return unwindPaths
.reduce((data, unwindPath) =>
data.map((dataEl) => {
const unwindArray = lodashGet(dataEl, unwindPath);
if (!Array.isArray(unwindArray)) {
return dataEl;
}
if (!Array.isArray(unwindArray)) {
return dataEl;
}
if (unwindArray.length) {
return unwindArray.map((unwindEl) => {
const dataCopy = lodashCloneDeep(dataEl);
lodashSet(dataCopy, unwindPath, unwindEl);
return dataCopy;
});
}
if (unwindArray.length) {
return unwindArray.map((unwindEl) => {
const dataCopy = lodashCloneDeep(dataEl);
lodashSet(dataCopy, unwindPath, unwindEl);
return dataCopy;
});
}
const dataCopy = lodashCloneDeep(dataEl);
lodashSet(dataCopy, unwindPath, undefined);
return dataCopy;
})
),
[dataRow]
)
const dataCopy = lodashCloneDeep(dataEl);
lodashSet(dataCopy, unwindPath, undefined);
return dataCopy;
}).reduce((tempData, rows) => tempData.concat(rows), []),
[dataRow]
)
.reduce((tempData, rows) => tempData.concat(rows), []);
}

@@ -263,0 +262,0 @@ }

@@ -16,5 +16,6 @@ 'use strict';

if (!this.opts.fields) {
const dataFields = Array.prototype.concat.apply([],
processedData.map(item => Object.keys(item))
);
const dataFields = processedData
.map(item => Object.keys(item))
.reduce((tempData, rows) => tempData.concat(rows), []);
this.opts.fields = dataFields

@@ -47,5 +48,5 @@ .filter((field, pos, arr) => arr.indexOf(field) == pos);

return Array.prototype.concat.apply([],
processedData.map(row => this.preprocessRow(row))
);
return processedData
.map(row => this.preprocessRow(row))
.reduce((tempData, rows) => tempData.concat(rows), []);
}

@@ -52,0 +53,0 @@

{
"name": "json2csv",
"preferGlobal": "true",
"version": "4.0.1",
"version": "4.0.2",
"description": "Convert JSON to CSV",

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

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

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

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