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: expose textArrayElement as standalone method #1414

Open
ST-DDT opened this issue Oct 3, 2022 · 2 comments
Open

feat: expose textArrayElement as standalone method #1414

ST-DDT opened this issue Oct 3, 2022 · 2 comments
Labels
c: feature Request for new feature has workaround Workaround provided or linked m: helpers Something is referring to the helpers module m: lorem Something is referring to the lorem module m: word Something is referring to the word module p: 1-normal Nothing urgent s: waiting for user interest Waiting for more users interested in this feature
Milestone

Comments

@ST-DDT
Copy link
Member

ST-DDT commented Oct 3, 2022

Clear and concise description of the problem

Currently all word methods and the lorem.word method use the same implementation. It is likely that other developers might have a similar usecase for their word lists.

Suggested solution

Extract and expose the textArrayElement method from the helpers module.

textArrayElement(
    textList: string[],
    options:
      | number
      | {
          length?: number | { min: number; max: number };
          strategy?: 'fail' | 'closest' | 'shortest' | 'longest' | 'any-length';
        } = {}
  ): string

Alternative

No response

Additional context

Source: #1407 (comment)

@ST-DDT ST-DDT added c: feature Request for new feature p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision m: helpers Something is referring to the helpers module m: lorem Something is referring to the lorem module m: word Something is referring to the word module labels Oct 3, 2022
@ST-DDT ST-DDT added this to the v8 - Next Major milestone Oct 3, 2022
@ST-DDT ST-DDT added has workaround Workaround provided or linked s: waiting for user interest Waiting for more users interested in this feature and removed s: needs decision Needs team/maintainer decision labels Mar 16, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Mar 16, 2023

Workaround:

textList.filter(someCondition)

If you are interested in this features please upvote this issue.

@ST-DDT ST-DDT added s: waiting for user interest Waiting for more users interested in this feature and removed s: waiting for user interest Waiting for more users interested in this feature labels May 5, 2023
@github-actions
Copy link

github-actions bot commented May 5, 2023

Thank you for your feature proposal.

We marked it as "waiting for user interest" for now to gather some feedback from our community:

  • If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
  • If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.

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:

  • the number of votes (:+1:) and comments
  • the relevance for the ecosystem
  • availability of alternatives and workarounds
  • and the complexity of the requested feature

We do this because:

  • There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
  • Every feature we add to faker has "costs" associated to it:
    • initial costs: design, implementation, reviews, documentation
    • running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors

View more issues which are waiting for user interest

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 has workaround Workaround provided or linked m: helpers Something is referring to the helpers module m: lorem Something is referring to the lorem module m: word Something is referring to the word module p: 1-normal Nothing urgent s: waiting for user interest Waiting for more users interested in this feature
Projects
No open projects
Status: Todo
Development

No branches or pull requests

1 participant