Socket
Socket
Sign inDemoInstall

json-2-csv

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-2-csv - npm Package Compare versions

Comparing version 3.7.11 to 3.7.12

10

package.json
{
"author": {
"name": "Mike Rodrigues",
"email": "rodrigues.mi@husky.neu.edu"
"email": "rodrigues.mi@northeastern.edu"
},
"name": "json-2-csv",
"description": "A JSON to CSV and CSV to JSON converter that natively supports sub-documents and auto-generates the CSV heading.",
"version": "3.7.11",
"version": "3.7.12",
"repository": {

@@ -45,8 +45,8 @@ "type": "git",

"babel-eslint": "10.1.0",
"eslint": "7.10.0",
"mocha": "8.1.3",
"eslint": "7.14.0",
"mocha": "8.2.1",
"nyc": "15.1.0",
"should": "13.2.3",
"tslint": "6.1.3",
"typescript": "4.0.3"
"typescript": "4.1.2"
},

@@ -53,0 +53,0 @@ "engines": {

@@ -36,2 +36,3 @@ {

"unwindArrays": false,
"useDateIso8601Format": false,
"useLocaleFormat": false

@@ -38,0 +39,0 @@ },

@@ -162,3 +162,3 @@ 'use strict';

*/
function unwindRecordsIfNecessary(params) {
function unwindRecordsIfNecessary(params, finalPass = false) {
if (options.unwindArrays) {

@@ -182,2 +182,8 @@ const originalRecordsLength = params.records.length;

// Run a final time in case the earlier unwinding exposed additional
// arrays to unwind...
if (!finalPass) {
return unwindRecordsIfNecessary(params, true);
}
// If keys were provided, set the headerFields to the provided keys:

@@ -184,0 +190,0 @@ if (options.keys) {

@@ -6,3 +6,4 @@ 'use strict';

const dateStringRegex = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
const dateStringRegex = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,
MAX_ARRAY_LENGTH = 100000;

@@ -289,2 +290,15 @@ module.exports = {

function flatten(array) {
// Node 11+ - use the native array flattening function
if (array.flat) {
return array.flat();
}
// #167 - allow browsers to flatten very long 200k+ element arrays
if (array.length > MAX_ARRAY_LENGTH) {
let safeArray = [];
for (let a = 0; a < array.length; a += MAX_ARRAY_LENGTH) {
safeArray = safeArray.concat(...array.slice(a, a + MAX_ARRAY_LENGTH));
}
return safeArray;
}
return [].concat(...array);

@@ -291,0 +305,0 @@ }

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