mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Removed excess debugging from change node (sorry)
This commit is contained in:
		| @@ -22,8 +22,7 @@ function ChangeNode(n) { | ||||
|     this.property = n.property || ""; | ||||
|     this.from = n.from || " "; | ||||
|     this.to = n.to || " "; | ||||
|     this.reg = n.reg || true; | ||||
|     console.log("Type=",this.reg); | ||||
|     this.reg = n.reg; | ||||
|     var node = this; | ||||
|  | ||||
|     var makeNew = function( stem, path, value ) { | ||||
| @@ -37,14 +36,14 @@ function ChangeNode(n) { | ||||
|  | ||||
|     this.on('input', function (msg) { | ||||
|         if (node.action == "change") { | ||||
|             var from = node.from; | ||||
|             if (node.reg === false) { | ||||
|                 this.from = this.from.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||||
|                 from = from.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||||
|             } | ||||
|             //console.log("Regex is:",this.from); | ||||
|             try { | ||||
|                 node.re = new RegExp(this.from, "g"); | ||||
|                 node.re = new RegExp(from, "g"); | ||||
|             } catch (e) { | ||||
|                 node.error("Invalid regex: "+this.from); | ||||
|                 node.error("Invalid regex: "+from); | ||||
|             } | ||||
|             if (typeof msg[node.property] === "string") { | ||||
|                 msg[node.property] = (msg[node.property]).replace(node.re, node.to); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user