Support nested parameters in object configurations in presets.
This commit is contained in:
1 parent
0e0a5f5f77
commit
2bff1cd3fd
2 files changed
+35
-13
No files matched your search
+13
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user