We should provide support for multiple arguments so we can call any method necessary.
A possible implementation idea is to just re-use the # separator that currently separates the chance method name from the configuration object (it's really just an argument). We could also make this separator configurable to any string.
The other problem to solve is to allow passing something like a raw number. I think we can solve this by going through this fallback process:
try JSON5.parse
try parseInt
try testing for 'false' and 'true' and convert to the respective Boolean
otherwise return raw string
This should cover a majority of argument types a user might want to use.
Right now, there is no way to call this method with both the
array
andquantity
arguments:(https://chancejs.com/helpers/pickset.html)
We should provide support for multiple arguments so we can call any method necessary.
A possible implementation idea is to just re-use the
#
separator that currently separates thechance
method name from theconfiguration
object (it's really just an argument). We could also make this separator configurable to any string.The other problem to solve is to allow passing something like a raw number. I think we can solve this by going through this fallback process:
JSON5.parse
parseInt
This should cover a majority of argument types a user might want to use.