Skip to content

Create a pickPlural helper #23

@macarie

Description

@macarie
type Count = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other'

type PickPlural = <
  T extends Partial<Record<Count, string>>,
  C extends Count
>(translations: T, count: C) => T[C]

'other' as the default fallback. It could be configurable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestt-utilsChanges regarding the `t-utils` package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions