deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

feat(cli/unstable): add generic for `promptSelect()` and `promptMultipleSelect()`

Open MAKS11060 opened this issue 6 months ago • 3 comments

This PR adds generic for

  • promptSelect()
  • promptMultipleSelect()

If we pass a read-only array, then the output value is already known.

const result = promptSelect('Select browser:', ["safari", "chrome", "firefox"])
result // 'safari' | 'chrome' | 'firefox' | null

const result2 = promptMultipleSelect('Select browser:', ["safari", "chrome", "firefox"])
result2 // ('safari' | 'chrome' | 'firefox')[] | null

MAKS11060 avatar Jun 05 '25 11:06 MAKS11060

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 05 '25 11:06 CLAassistant

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.63%. Comparing base (b2b2d57) to head (5683fc7). Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6713      +/-   ##
==========================================
- Coverage   94.70%   94.63%   -0.07%     
==========================================
  Files         569      575       +6     
  Lines       46832    47013     +181     
  Branches     6588     6604      +16     
==========================================
+ Hits        44350    44491     +141     
- Misses       2440     2480      +40     
  Partials       42       42              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jun 05 '25 11:06 codecov[bot]

Does anyone have any concern on this change?

kt3k avatar Jun 06 '25 00:06 kt3k