grunt-prompt
grunt-prompt copied to clipboard
Allow choices to be a function
If choices is a function you currently get an error:
Warning: Object function () {...} has no method 'map' Use --force to continue.
published as [email protected]
- many thanks for the PR!
I have the same need, I need to define the choices dynamically.
You say you has already in 1.1.0
, but the documentation does not detail how to use anything. How can this be done?
I tried something like:
choices: function() { return {name: 'x', value: true} }
But the following error ocurred:
Warning: Object #
I'm sorry, I did wrong. But anyway it would be interesting if there were registered in the documentation:
choices: function() { return [{name: 'x', value: true}] }