Closed tylersticka closed 8 years ago
👍
Nice! 👍
@erikjung @mrgerardorodriguez While I'm in here changing stuff, how crazy would it be to rename this to something like randomItem
? I'm making a different helper for a prototype I'm working on that piggy-backs on chance to generate almost any random content:
{{random}} //=> 19854343893
{{random min=1 max=10}} //=> 7
{{random "dollar" max=20}} //=> $17.43
{{random "cc" type="Mastercard"}} //=> 5171206237468496
{{random "sentence" words=5}} //=> Waddik jeasmov cakgilta ficub up.
It started as a randomNumber
helper, but I realized it wouldn't be difficult to open it up to any method... and I'm having a hard time thinking of a better word for this separate helper than {{random}}
! 😆
@tylersticka I'm cool with randomItem
. 😉
@tylersticka Considering the undocumented nature of these helpers, and that other projects using them are installing specific tags, I'm fine with renaming it to randomItem
.
@erikjung @mrgerardorodriguez Rename achieved. 👍
Let me know if this is still looking okay for a merge. I figured I'd wait to bump the version till my next PR (the new helper I set out to write in the first place).
👍
Sometimes it's helpful when prototyping to be able to pass along multiple arguments to choose from at random instead of an array. See
lib/random.js
example for more info.@erikjung @mrgerardorodriguez