[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

case-insensitive checks

Oskar Löfgren (Feb 22, 2023, 12:17 AM +0100) a82276cc 88a4988a

+2 -2
+2 -2
packages/core/src/prompts/select-key.ts
··· 11 11 super(opts, false); 12 12 13 13 this.options = opts.options; 14 - const keys = this.options.map(({ value: [initial] }) => initial); 14 + const keys = this.options.map(({ value: [initial] }) => initial?.toLowerCase()); 15 15 this.cursor = Math.max(keys.indexOf(opts.initialValue), 0); 16 16 17 17 this.on('key', (key) => { 18 18 if (!keys.includes(key)) return; 19 - const value = this.options.find(({ value: [initial] }) => initial === key); 19 + const value = this.options.find(({ value: [initial] }) => initial?.toLowerCase() === key); 20 20 if (value) { 21 21 this.value = value.value; 22 22 this.state = 'submit';