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

choices on string #134

Open
ThodorisElissaios opened this issue Dec 24, 2019 · 1 comment
Open

choices on string #134

ThodorisElissaios opened this issue Dec 24, 2019 · 1 comment

Comments

@ThodorisElissaios
Copy link

how can this work ?

@Sembiance
Copy link

Sembiance commented May 9, 2020

This is the way I worked around the numbers only choice limitation:

choice({
  tag : function() { return ["ABC", "MNO", "XYZ"].indexOf(this.someVar)+1 || -1; },
  choices :
  {
    1 : abcParser,
    2 : mnoParser,
    3 : xyzParser
  },
  defaultChoice : unknownParser
});

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

No branches or pull requests

2 participants