Skip to content

Commit

Permalink
Fix(inquirer): Fix backward compatibility issue with when returning f…
Browse files Browse the repository at this point in the history
…alsy value. Fix #1555
  • Loading branch information
SBoudrias committed Sep 17, 2024
1 parent a6ac2fa commit b61337a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/inquirer/src/ui/prompt.mts
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ export default class PromptsRunner<A extends Answers> {
const { when } = question;
if (typeof when === 'function') {
const shouldRun = await runAsync(when)(this.answers);
return shouldRun !== false;
return Boolean(shouldRun);
}

return when !== false;
Expand Down

0 comments on commit b61337a

Please sign in to comment.