CSV - swap to regex replace for node14 support

This commit is contained in:
Dave Conway-Jones 2022-12-19 13:48:21 +00:00
parent f6901cd19f
commit 2429191838
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
1 changed files with 2 additions and 2 deletions

View File

@ -19,9 +19,9 @@ module.exports = function(RED) {
function CSVNode(n) {
RED.nodes.createNode(this,n);
this.template = (n.temp || "");
this.sep = (n.sep || ',').replaceAll("\\t","\t").replaceAll("\\n","\n").replaceAll("\\r","\r");
this.sep = (n.sep || ',').replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r");
this.quo = '"';
this.ret = (n.ret || "\n").replaceAll("\\n","\n").replaceAll("\\r","\r");
this.ret = (n.ret || "\n").replace(/\\n/g,"\n").replace(/\\r/g,"\r");
this.winflag = (this.ret === "\r\n");
this.lineend = "\n";
this.multi = n.multi || "one";