-
-
Notifications
You must be signed in to change notification settings - Fork 939
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
Method to get any random animal #1618
Comments
Perhaps we should have a new function in the I'm pretty sure we shouldn't use |
Instead of returning a complex breed or race of animal, the new method should return the type or category (e.g. dog, cat, ...). Not sure what the actual name for that is. Maybe just |
We could still stick to what we discussed for other stuff and just use To shorten it for the long run, we could also use Beside that |
I also thought about that but I would expect sample to return something like a mixture of the others e.g. Messouri Fox Trotter (Horse) or Red House Cat.
I think |
I did ask for any kind of animal. Right now you have to choose a category, as there's no method that returns any kind of animal |
Oh thanks for the clarification, so I really misunderstood you first, I'm sorry 🙇 So yeah, we could go with |
Honestly, at first i was thinking something like |
We had this discussion already with the word module. |
Team decision If you want/need this feature, please upvote this issue. You can use the following as a workaround in the meantime. faker.helpers.objectValue(faker.animal)(); |
This is for now an okay-ish workaround, but keep in mind that it is not future proof to do this, as well as it theoretically comes with a "bug" on the expectation point of view.
|
Would it be good to have a method which just returns a "simple" animal? Like i might just want a common one word animal name like:
rather than |
|
Is that localizable though? |
faker/src/modules/animal/index.ts Lines 206 to 208 in 6ba21c6
Sure. |
hmm but it looks like its supposed to return one of the other method names, ie you can do:
|
Seems like in v5.5.3 they were already localized (seems wired to me and like a design issue) |
I'm not sure whether |
Would you consider adding additional animals to the definitions.animal.type which don't correspond to method names to be a breaking change? |
No, neither the jsdocs nor the implementation hint at it being a key of callable methods. Also FR already has its own translations: |
Then I think we could just add a bunch more simple animals to this method? It's common to use animals as placeholder names eg on google docs |
Thank you for your feature proposal. We marked it as "waiting for user interest" for now to gather some feedback from our community:
We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements. We will start the implementation based on:
We do this because:
|
fix faker-js#1618 This adds more common animals and uses more common names for existing ones e.g. cetecean->whale, crocodilia->crocodile
Clear and concise description of the problem
Hi! I just want a method that returns an animal, of any type. Sometimes you just want any kind of animal rather than one of a specific species.
Suggested solution
maybe something like
Alternative
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: