node-red-viseo-helper
Advanced tools
Comparing version 0.0.10 to 0.0.11
18
index.js
@@ -44,2 +44,3 @@ 'use strict'; | ||
//if {obj.a|obj.b} then use obj.a if exists, obj.b otherwise | ||
let split = prop.split('|'); | ||
@@ -49,4 +50,10 @@ def = split.length > 1 ? getByString(obj, split[1], def) : def; | ||
let value = getByString(obj, prop, def); | ||
value = fastResolve(value); | ||
//basic use case | ||
let value = getByString(obj, prop, ""); | ||
//just in case : check in config | ||
if(value === "") { | ||
value = global.CONFIG ? getByString(global.CONFIG, prop, def) : def; | ||
} | ||
value = fastResolve(value); | ||
@@ -64,10 +71,3 @@ str = str.replace(match, value) | ||
str = str.replace('{timestamp}', Date.now()); | ||
if (str.indexOf('{server.url}') !== -1) { | ||
if (CONFIG.server !== undefined && CONFIG.server.url !== undefined) { | ||
str = str.replace('{server.url}', CONFIG.server.url); | ||
} else { | ||
str = str.replace('{server.url}', ''); | ||
} | ||
} | ||
return str | ||
@@ -74,0 +74,0 @@ } |
{ | ||
"name" : "node-red-viseo-helper", | ||
"version" : "0.0.10", | ||
"version" : "0.0.11", | ||
"description" : "Utility libarary for Node-RED", | ||
@@ -5,0 +5,0 @@ "dependencies" : { }, |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
19925
72