DOCS: Avoid passing incorrect/unneeded args to faker.* methods #707
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
faker.company.companyName for its first arg expects either a format string
or an integer in the range [0,2]:
https://github.com/Marak/faker.js/blob/3a4bb358614c1e1f5d73f4df45c13a1a7aa013d7/lib/company.js#L26-L39
Passing a value greater than 2 results in a returned value of
string parameter is required!
instead of a faked name. This wasn't obvious becausethe number of generated rows is dynamic (via
getRandomInt
), so it onlyshows up if the # of generated rows is enough to trigger the error, and then
you have to scroll to the bottom of the table to notice it.
Also remove the argument passed to
department
because it doesn't accept an argument:https://github.com/Marak/faker.js/blob/3a4bb358614c1e1f5d73f4df45c13a1a7aa013d7/lib/commerce.js#L22-L24
Ditto for
productName
:https://github.com/Marak/faker.js/blob/3a4bb358614c1e1f5d73f4df45c13a1a7aa013d7/lib/commerce.js#L31-L35
The issue can be seen at "sorting" page of the current published docs site. If you reload the page enough times so that the table renders more than 3 rows, the 4th row will say "string parameter is required!":
