Inquirer.js: filter function does not seem to work on confirms

Created on 30 Mar 2020  路  2Comments  路  Source: SBoudrias/Inquirer.js

Hi, I have been trying to flip the boolean I receive from a confirm question and the filter doesn't seem to return the desired results

      message: `Create a new folder for the ${componentType} and its dependent components?`,
      name: 'flatFile',
      type: 'confirm',
      filter: (input: boolean) => {
        return !input;
      },

Even If i hardcode a boolean it will still return the answered value instead of the filtered value

Most helpful comment

Also I would be happy to send PR here if @SBoudrias or anyone from team is okay with it?

All 2 comments

confirm prompts don't have options for filter, validation or default value.

I wish they would allow that, not sure why they removed it from confirms.

I went on to create my own plugin inquirer-confirm-extra

Also I would be happy to send PR here if @SBoudrias or anyone from team is okay with it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jahvi picture jahvi  路  6Comments

bugzpodder picture bugzpodder  路  4Comments

fuechter picture fuechter  路  3Comments

szul picture szul  路  5Comments

sindresorhus picture sindresorhus  路  4Comments