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.10 to 3.7.11

2

package.json

@@ -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.7.10",
"version": "3.7.11",
"repository": {

@@ -11,0 +11,0 @@ "type": "git",

@@ -127,2 +127,5 @@ # json-2-csv

* Note: This may result in CSV output that does not map back exactly to the original JSON.
* `useDateIso8601Format` - Boolean - Should date values be converted to an ISO8601 date string?
* Default: `false`
* Note: If selected, values will be converted using `toISOString()` rather than `toString()` or `toLocaleString()` depending on the other options provided.
* `useLocaleFormat` - Boolean - Should values be converted to a locale specific string?

@@ -129,0 +132,0 @@ * Default: `false`

@@ -85,2 +85,7 @@ export interface ISharedOptions {

/**
* Should dates be output in ISO 8601 "Z" format:
* @default false
*/
useDateIso8601Format?: boolean;
}

@@ -87,0 +92,0 @@

@@ -275,8 +275,10 @@ 'use strict';

function recordFieldValueToString(fieldValue) {
if (Array.isArray(fieldValue) || utils.isObject(fieldValue) && !utils.isDate(fieldValue)) {
const isDate = utils.isDate(fieldValue); // store to avoid checking twice
if (utils.isNull(fieldValue) || Array.isArray(fieldValue) || utils.isObject(fieldValue) && !isDate) {
return JSON.stringify(fieldValue);
} else if (utils.isUndefined(fieldValue)) {
return 'undefined';
} else if (utils.isNull(fieldValue)) {
return 'null';
} else if (isDate && options.useDateIso8601Format) {
return fieldValue.toISOString();
} else {

@@ -283,0 +285,0 @@ return !options.useLocaleFormat ? fieldValue.toString() : fieldValue.toLocaleString();

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