falso
falso copied to clipboard
feat(toCollection): add a new generators to generate collection from …
…a generator function
PR Checklist
Please check if your PR fulfills the following requirements:
- [x] The commit message follows our guidelines: https://github.com/ngneat/falso/blob/master/CONTRIBUTING.md#commit
- [x] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
Generate a collection from a custom generators functions
@category util
@example
toCollection(() => { return { data: randNumber(); } })
@example
toCollection(() => { return { data: randNumber(); } }, { length: 10 }) // default is no length.
It is a wrapper for the internal fake function.
[ ] Bugfix
[x ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:
What is the current behavior?
The fake function is internal and can Not bu used externaly.
Issue Number: #301
What is the new behavior?
Does this PR introduce a breaking change?
[ ] Yes
[x ] No