Skip to content
New issue

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

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

Already on GitHub? # to your account

Add generics to randomGenerator.element() #10

Merged
merged 1 commit into from
May 25, 2019

Conversation

bobjackman
Copy link
Contributor

This change allows code like this, that would normally cause either cannot find declaration to go to or getter `values` isn't defined for the class Object, to resolve properly:

var items = [
  {'a': 'foo', 'b': 'bar'},
  {'a': 'zip', 'b': 'zap'}
]
var chosenItem = faker.randomGenerator.element(items).values;

@bobjackman
Copy link
Contributor Author

bobjackman commented May 6, 2019

@drager it looks like the failed check above is due to a bad configuration for TravisCI...

$ ./tool/travis.sh
Setting VM flags failed: Unrecognized flags: checked

https://travis-ci.org/drager/faker/jobs/528987224

@drager
Copy link
Owner

drager commented May 17, 2019

Thanks for the PR @kogi! I think the code looks good! I will check out the Travis error.

@drager drager merged commit 48a17c2 into drager:master May 25, 2019
@bobjackman bobjackman deleted the bugfix/generics-for-random-element branch May 29, 2019 20:34
@bobjackman bobjackman restored the bugfix/generics-for-random-element branch June 5, 2020 17:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants