• Returns the singular or plural form of the word based on the input number

    Example

    pluralize('apple'); // 'apples'
    

    Example

    pluralize('apple', 0); // 'apples'
    

    Example

    pluralize('apple', 1); // 'apple'
    

    Example

    pluralize('apple', 2); // 'apples'
    

    Example

    pluralize('person', 2); // 'people'
    

    Example

    pluralize('people', 1); // 'person'
    

    Parameters

    • str: string
    • Optional count: number

    Returns string

Generated using TypeDoc