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.16.1 to 3.17.0

5

lib/converter.d.ts

@@ -117,3 +117,6 @@ export interface ISharedOptions {

*/
parseValue?: (fieldValue: any) => string;
parseValue?: (
fieldValue: any,
defaultParser: (fieldValue: any) => string
) => string;
}

@@ -120,0 +123,0 @@

4

lib/json2csv.js

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

crlfSearchRegex = /\r?\n|\r/,
valueParserFn = options.parseValue && typeof options.parseValue === 'function' ? options.parseValue : recordFieldValueToString,
customValueParser = options.parseValue && typeof options.parseValue === 'function' ? options.parseValue : null,
expandingWithoutUnwinding = options.expandArrayObjects && !options.unwindArrays,

@@ -255,3 +255,3 @@ deeksOptions = {

fieldValue = trimRecordFieldValue(fieldValue);
fieldValue = valueParserFn(fieldValue);
fieldValue = customValueParser ? customValueParser(fieldValue, recordFieldValueToString) : recordFieldValueToString(fieldValue);
fieldValue = preventCsvInjection(fieldValue);

@@ -258,0 +258,0 @@ fieldValue = wrapFieldValueIfNecessary(fieldValue);

@@ -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.16.1",
"version": "3.17.0",
"homepage": "https://mrodrig.github.io/json-2-csv",

@@ -11,0 +11,0 @@ "repository": {

@@ -94,3 +94,3 @@ # json-2-csv

* Key Paths - If you are converting a nested object (ie. {info : {name: 'Mike'}}), then set this to ['info.name']
* `parseValue` - Function - Specify how values should be converted into CSV format. This function is provided a single field value at a time and must return a `String`.
* `parseValue` - Function - Specify how values should be converted into CSV format. This function is provided a single field value at a time and must return a `String`. The built-in parsing method is provided as the second argument for cases where default parsing is preferred.
* Default: A built-in method is used to parse out a variety of different value types to well-known formats.

@@ -97,0 +97,0 @@ * Note: Using this option may override other options, including `useDateIso8601Format` and `useLocaleFormat`.

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