Skip to content

Commit

Permalink
fix: allow one option in maybeSelect (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 authored Dec 6, 2024
1 parent c617d51 commit fd3324f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/console/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export function select(opts: SelectOptions) {
}

export function maybeSelect(opts: SelectOptions) {
if (opts.options.length <= 1) {
throw new Error(`You must provide at least two options. (Prompt: '${opts.message}')`);
if (opts.options.length < 1) {
throw new Error(`You must provide at least one option. (Prompt: '${opts.message}')`);
}

return createSelection({
Expand Down

0 comments on commit fd3324f

Please sign in to comment.