Support nested parameters in object configurations in presets.

This commit is contained in:
Zaid Abdulla committed 2015-05-25 11:34:35 +03:00
1 parent 0e0a5f5f77
commit 2bff1cd3fd
2 files changed
+35 -13

No files matched your search

+13 -1
View File
@@ -82,10 +82,22 @@ exports.parseDeviceId = (deviceId) ->
exports.extend = (obj, mixin) ->
obj[name] = method for name, method of mixin
obj[name] = method for name, method of mixin
obj
exports.flattenObject = (object) ->
newObj = {}
f = (obj, prefix) ->
for k, v of obj
if typeof(v) is 'object'
f(v, "#{prefix}#{k}.")
else
newObj["#{prefix}#{k}"] = v
f(object, '')
return newObj
exports.getParamValueFromPath = (obj, path) ->
pp = path.split('.')
ref = obj