mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Let CSV node handle null columns in input array. array-> csv
This commit is contained in:
		@@ -58,6 +58,7 @@ module.exports = function(RED) {
 | 
			
		||||
                            if ((Array.isArray(msg.payload[s])) || (typeof msg.payload[s] !== "object")) {
 | 
			
		||||
                                if (typeof msg.payload[s] !== "object") { msg.payload = [ msg.payload ]; }
 | 
			
		||||
                                for (var t = 0; t < msg.payload[s].length; t++) {
 | 
			
		||||
                                    if (!msg.payload[s][t]) { msg.payload[s][t] = ""; }
 | 
			
		||||
                                    if (msg.payload[s][t].toString().indexOf(node.quo) !== -1) { // add double quotes if any quotes
 | 
			
		||||
                                        msg.payload[s][t] = msg.payload[s][t].toString().replace(/"/g, '""');
 | 
			
		||||
                                        msg.payload[s][t] = node.quo + msg.payload[s][t].toString() + node.quo;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user