-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
feat: new plant module #2126
feat: new plant module #2126
Conversation
src/locales/en/plant/tree.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the trees, i think it would be better to keep the names to simpler, mostly one-word tree names. Then those could be used in other patterns like https://github.com/faker-js/faker/blob/next/src/locales/en/location/street_pattern.ts
For example "Pine Street" or "Ash Drive" is realistic, but "Lavender Twist Redbud Avenue" is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a separate method/option for simple names?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #2126 +/- ##
==========================================
- Coverage 99.59% 99.58% -0.02%
==========================================
Files 2823 2828 +5
Lines 255523 255871 +348
Branches 1106 1110 +4
==========================================
+ Hits 254488 254808 +320
- Misses 1007 1034 +27
- Partials 28 29 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. Please note that we are approaching the v8.0 release and this PR likely wont make it in there.
Please run pnpm run preflight
.
@@ -54,6 +54,9 @@ export type { | |||
PhoneNumberDefinition, | |||
/** @deprecated Use PhoneNumberDefinition instead */ | |||
PhoneNumberDefinition as PhoneNumberDefinitions, | |||
PlantDefinition, | |||
/** @deprecated Use AnimalDefinition instead */ | |||
PlantDefinition as PlantDefinitions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant as this is a new definition that didnt exist before.
const definition = this.faker.helpers.arrayElement( | ||
this.faker.definitions.plant.tree | ||
); | ||
return this.faker.helpers.fake(definition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to call fake()
on them since the names dont have templates attached to them.
const definition = this.faker.helpers.arrayElement( | ||
this.faker.definitions.plant.flower | ||
); | ||
return this.faker.helpers.fake(definition); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
I also noticed the issue is marked as waiting for user interest. |
I think a new contributor making a pull request should count as 5 upvotes 🤣 |
It looks like some lint errors have creeped in over time. |
Close as stale. We can reopen this when required/updated. |
Adds faker.plant.tree and faker.plant.flower as described in #2022
Changes made:
plant
plant.tree
andplant.flower
that return random tree and flower namesen
locale dataplant.spec.ts
and snapshots