mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 13:09:41 +00:00
Fix some formatting
This commit is contained in:
parent
ba2753edc2
commit
e22e853f21
1 changed files with 4 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue