Fix some formatting

This commit is contained in:
Blade Barringer 2015-08-05 08:18:03 -05:00
parent ba2753edc2
commit e22e853f21

View file

@ -1445,10 +1445,10 @@ api.wrap = (user, main=true) ->
returns random property (the value)
###
randomVal: (obj, options) ->
array = if options?.key then _.keys(obj) else _.values(obj)
rand = user.fns.predictableRandom(options?.seed)
array.sort()
array[Math.floor(rand * array.length)]
array = if options?.key then _.keys(obj) else _.values(obj)
rand = user.fns.predictableRandom(options?.seed)
array.sort()
array[Math.floor(rand * array.length)]
###
This allows you to set object properties by dot-path. Eg, you can run pathSet('stats.hp',50,user) which is the same as