bug: giving default a function returns the stringified version of the function
3stacks opened this issue · comments
Luke Boyle commented
prompt.get([
{
name: 'themeName'
},
{
name: 'themeSlug',
default: function() {
return 'foo';
},
pattern: /^[a-z]+(-[a-z]+)*$/gm
}
], (err, result) => {...})
The default value of the themeSlug prompt is function() { return 'foo'; }
as a string.
EDIT: I just installed the package by pointing to the git repo and it's working correctly.
Was this feature not added as of ^1.0.0 which I am currently on? (installed from npm without explicitly adding version)
Acker Dawn Apple commented
Thank you for reporting this issue as it saved me time.
Yes and confirmed, do not use npm version if default function needed.
npm install github:flatiron/prompt
Cyril Auburtin commented
@AckerApple why isn't npm package up to date?
Luke Boyle commented
Closing this issue because it most likely won't be addressed! I've switched to enquirer (https://www.npmjs.com/package/enquirer)