Generate Random Objects!
See original GitHub issueHi – thanks for the great library!
It seems it would be extremely easy and useful to implement getting whole random objects – like person, web etc. It would mostly compile a set of random values for their fields.
This would be very useful for testing (suppose somebody wants randomly generated objects). A similar, albeit more advanced, idea would be to have a chance.newObject(obj)
where obj is an object describing the structure of the resulting object (i.e., allowing chance to fill in the values of the template).
I would be interested to hear thoughts, and if you agree on the features I can send a pull request:)
Thanks again!
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Random Object Generator - Perchance.org
title = Random Object Generator subtitle = Simply generates a random everyday object at each click :) fontSize = 200 fontColor = black...
Read more >Random Object Generator - The Word Finder
Generate one (or many) objects at random with our generator tool! For example:Scissors, bottle, chair, pen, etc.
Read more >Generate a list of random things - Random Lists
Create a scavenger hunt by generating a couple lists of 10 things. Pass out those lists and race your friends to collect all...
Read more >Random Object Generator | (1500+ Objects)
The Random Object Tool generates random object. This tool support unlimited object generation, It means you can generate multiple object at a single...
Read more >Random Object Generator - The Story Shack
Generate thousands of random objects with this Random Object Generator ⚡️ Ideas can be saved and copied ⚡️ Fuel your creativity and start...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What about generating objects by their jsonschema or typescript type or class descriptions? This would be valuable in unit tests.
@oliversalzburg I tend to agree with you, generating random objects with so many possible different permutations and requirements would I think be an endless rabbit hole. It’s a rabbit hole I’ve been down before and there is no end in sight. Right now chance js gives you the ability to generate all sort of of data types. Users can use those data types to create there own random objects very easily. I don’t see the advantage of having the library attempt do things like that for you and in the end seems like a futile endeavor.