faressoft / inquirer-checkbox-plus-prompt

Checkbox with autocomplete and other additions for Inquirer
MIT License
39 stars 25 forks source link

`answersSoFar` is always undefined #10

Closed ShaMan123 closed 2 years ago

ShaMan123 commented 2 years ago
const { tests: filteredTests } = await inquirer.prompt([
        {
            type: 'checkbox-plus',
            name: 'tests',
            message: 'Select test files',
            highlight: true,
            searchable: true,
            default: selected,
            async source(answersSoFar, input = '') {
               console.log(answersSoFar) ///??? undefined
                const res = fuzzy.filter(input, tests, {
                    extract: (item) => item.path
                }).map((element) => element.original.path);
                return res;
            }
        }
    ]);