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

fix(word): Fixed issue with passing length to any.word #248

Merged
merged 1 commit into from
Aug 11, 2017

Conversation

trevtrich
Copy link
Contributor

Since we started defaulting to passing syllables we broke the ability to pass length as
chance.word does not allow passing both length & syllables.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8f51ba7 on richardson-trevor:default-word into 494d22f on travi:master.

any.js Outdated
const sentence = options => chance.sentence(options);
const paragraph = options => chance.paragraph(options);
const url = options => chance.url(options);
const boolean = options => chance.bool(options);
const email = options => chance.email(options);
const date = () => chance.date({string: true});

function word(options) {
return options && options.length ? chance.word(options) : chance.word({syllables: 3, ...options});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than checking if options are provided, it might be better to default options to an empty object in the signature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done

Since we started defaulting to passing syllables we broke the ability to pass `length` as
`chance.word` does not allow passing both length & syllables.

- closes travi#246
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling e96b53f on richardson-trevor:default-word into 494d22f on travi:master.

@travi travi merged commit 415cb6f into travi:master Aug 11, 2017
@trevtrich trevtrich deleted the default-word branch August 11, 2017 18:37
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.

Only passing length to any.word breaks
3 participants