Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make options optional #437

Merged
merged 3 commits into from Jun 13, 2022
Merged

Make options optional #437

merged 3 commits into from Jun 13, 2022

Conversation

olebergen
Copy link

Fixes #435

@antonmedv
Copy link
Collaborator

Tests failed.

@antongolub
Copy link
Contributor

antongolub commented Jun 13, 2022

export async function question(query: string, {choices}: { choices?: string[] } = {}) {
  let completer = undefined
  if (Array.isArray(choices)) {
    completer = function completer(line: string) {
      const completions = choices
      const hits = completions.filter((c) => c.startsWith(line))
      return [hits.length ? hits : completions, line]
    }
  }

@olebergen
Copy link
Author

My bad, this is my first PR. Thanks for the fix, should work now, I ran the tests and commited the suggested change.

@olebergen olebergen requested a review from antonmedv June 13, 2022 13:21
@antonmedv antonmedv merged commit 113f6e8 into google:v6 Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants