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.11.1 to 3.12.0

3

lib/constants.json

@@ -38,3 +38,4 @@ {

"useLocaleFormat": false,
"parseValue": null
"parseValue": null,
"wrapBooleans": false
},

@@ -41,0 +42,0 @@

@@ -146,5 +146,8 @@ 'use strict';

function generateCsvHeader(params) {
// #185 - generate a keys list to avoid finding native Map() methods
let fieldTitleMapKeys = Object.keys(options.fieldTitleMap);
params.header = params.headerFields
.map(function(field) {
const headerKey = options.fieldTitleMap[field] ? options.fieldTitleMap[field] : field;
const headerKey = fieldTitleMapKeys.includes(field) ? options.fieldTitleMap[field] : field;
return wrapFieldValueIfNecessary(headerKey);

@@ -363,3 +366,4 @@ })

fieldValue.includes(options.delimiter.wrap) ||
fieldValue.match(crlfSearchRegex)) {
fieldValue.match(crlfSearchRegex) ||
options.wrapBooleans && (fieldValue === 'true' || fieldValue === 'false')) {
// wrap the field's value in a wrap delimiter (quotation marks by default)

@@ -366,0 +370,0 @@ fieldValue = wrapDelimiter + fieldValue + wrapDelimiter;

@@ -8,3 +8,3 @@ {

"description": "A JSON to CSV and CSV to JSON converter that natively supports sub-documents and auto-generates the CSV heading.",
"version": "3.11.1",
"version": "3.12.0",
"homepage": "https://mrodrig.github.io/json-2-csv",

@@ -57,5 +57,5 @@ "repository": {

"engines": {
"node": ">= 10"
"node": ">= 12"
},
"license": "MIT"
}

@@ -141,2 +141,4 @@ # json-2-csv

* Note: If selected, values will be converted using `toLocaleString()` rather than `toString()`
* `wrapBooleans` - Boolean - Should boolean values be wrapped in wrap delimiters to prevent Excel from converting them to Excel's TRUE/FALSE Boolean values.
* Default: `false`

@@ -143,0 +145,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