Fixed bug where ordering of key parameters in object definition may affect preset behavior.
This commit is contained in:
1 parent
c896dd2010
commit
acf63a3fd7
1 file changed
+13
-5
+13
-5
@@ -294,11 +294,19 @@ exports.processDevicePreset = (deviceId, devicePreset, callback) ->
|
|||||||
|
|
||||||
|
|
||||||
getObjectHash = (object) ->
|
getObjectHash = (object) ->
|
||||||
return object._id if not object._keys? or object._keys.length == 0
|
if object._keys?.length
|
||||||
hash = ''
|
keys = object._keys
|
||||||
for k in object._keys
|
else
|
||||||
hash += "#{k}=#{object[k]}"
|
keys = (k for k in Object.keys(object) when k[0] != '_')
|
||||||
return hash
|
|
||||||
|
keys.sort()
|
||||||
|
|
||||||
|
hash = []
|
||||||
|
for k in keys
|
||||||
|
hash.push(k)
|
||||||
|
hash.push(common.getParamValueFromPath(object, k))
|
||||||
|
|
||||||
|
return JSON.stringify(hash)
|
||||||
|
|
||||||
|
|
||||||
accumulateConfigurations = (presets, objects) ->
|
accumulateConfigurations = (presets, objects) ->
|
||||||
|
|||||||
Reference in new issue
Block a user