New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json-csv

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-csv - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

test/or-operator.coffee

18

exporter.js

@@ -75,2 +75,20 @@ var es = require('event-stream');

var val = self.getValue(data, field.name)
// vinicioslc support to OR || operator allowing multiples names to the same column
// the code will use the last non null and non empty value
if (field.name.includes('||')) {
// by default column is empty
val = ''
let fields = field.name.split('||');
// for each alternative
fields.forEach(field => {
// get value and associate
let fieldVal = self.getValue(data, field)
// remove whitespaces and check if non null before assign
if (typeof val !== 'undefined' && val !== null && fieldVal.trim().length > 0 && fieldVal.trim() != "") {
val = fieldVal
}
//do this for every field
});
}
if (field.filter) {

@@ -77,0 +95,0 @@ val = field.filter(val)

2

package.json
{
"name": "json-csv",
"version": "2.0.2",
"version": "2.0.3",
"description": "Export a richly structured, JSON array to CSV",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/IWSLLC/json-csv",

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