Skip to content
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(helpers): introduce multiple method #1545

Merged
merged 17 commits into from
Dec 7, 2022
Merged

feat(helpers): introduce multiple method #1545

merged 17 commits into from
Dec 7, 2022

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Nov 9, 2022

Adds a new method to generate multiple values from a method.

In our code we have a few of places that generate multiple values from a single method:

Example

faker.helpers.multiple(faker.person.firstName) // [ 'Aniya', 'Norval', 'Dallin' ]
faker.helpers.multiple(faker.person.firstName, { count: 3 }) // [ 'Santos', 'Lavinia', 'Lavinia' ]
faker.helpers.multiple(faker.person.firstName, { count: 3, unique: true }) // [ 'Santos', 'Nedra', 'Lavinia' ]

Planned features

@ST-DDT ST-DDT added c: feature Request for new feature p: 1-normal Nothing urgent m: helpers Something is referring to the helpers module labels Nov 9, 2022
@ST-DDT ST-DDT self-assigned this Nov 9, 2022
@ST-DDT
Copy link
Member Author

ST-DDT commented Nov 9, 2022

@ST-DDT ST-DDT added the s: on hold Blocked by something or frozen to avoid conflicts label Nov 9, 2022
@codecov
Copy link

codecov bot commented Nov 9, 2022

Codecov Report

Merging #1545 (d79499b) into next (50fb72c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1545   +/-   ##
=======================================
  Coverage   99.62%   99.62%           
=======================================
  Files        2222     2222           
  Lines      240495   240500    +5     
  Branches     1069     1066    -3     
=======================================
+ Hits       239593   239598    +5     
  Misses        881      881           
  Partials       21       21           
Impacted Files Coverage Δ
src/modules/color/index.ts 99.73% <100.00%> (ø)
src/modules/datatype/index.ts 100.00% <100.00%> (ø)
src/modules/date/index.ts 99.60% <100.00%> (+<0.01%) ⬆️
src/modules/helpers/index.ts 98.61% <100.00%> (+0.05%) ⬆️
src/modules/internet/index.ts 100.00% <100.00%> (ø)
src/modules/lorem/index.ts 100.00% <100.00%> (ø)
src/modules/random/index.ts 98.98% <100.00%> (-0.02%) ⬇️
src/modules/system/index.ts 100.00% <100.00%> (ø)
src/modules/word/index.ts 98.50% <100.00%> (ø)

@ST-DDT ST-DDT changed the title feat(helpers): introduce multiple method feat(helpers): introduce multiple method Nov 9, 2022
@ST-DDT ST-DDT removed the s: on hold Blocked by something or frozen to avoid conflicts label Nov 21, 2022
@ST-DDT ST-DDT marked this pull request as ready for review November 21, 2022 20:38
@ST-DDT ST-DDT requested a review from a team as a code owner November 21, 2022 20:38
@ST-DDT ST-DDT requested a review from a team November 21, 2022 20:43
src/modules/internet/index.ts Outdated Show resolved Hide resolved
src/modules/internet/index.ts Outdated Show resolved Hide resolved
Shinigami92
Shinigami92 previously approved these changes Dec 6, 2022
@ST-DDT ST-DDT added the s: accepted Accepted feature / Confirmed bug label Dec 6, 2022
import-brain
import-brain previously approved these changes Dec 6, 2022
@ST-DDT ST-DDT dismissed stale reviews from import-brain and Shinigami92 via 1a5cb44 December 6, 2022 23:25
@ST-DDT ST-DDT requested review from Shinigami92, import-brain and a team December 6, 2022 23:26
import-brain
import-brain previously approved these changes Dec 6, 2022
Copy link
Member

@xDivisionByZerox xDivisionByZerox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will already approve as I don't think the test name reword is thaaat important.

ST-DDT and others added 2 commits December 7, 2022 10:32
Co-authored-by: Leyla Jähnig <leyla.jaehnig@gmx.de>
@ST-DDT ST-DDT enabled auto-merge (squash) December 7, 2022 09:33
@ST-DDT ST-DDT merged commit f06126a into next Dec 7, 2022
@Shinigami92 Shinigami92 deleted the feat/helpers/multiple branch December 7, 2022 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature m: helpers Something is referring to the helpers module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants