@technobuddha/library
Version: 
A large library of useful functions
19 lines (18 loc) • 827 B
TypeScript
/**
 * Return the plural version of the input string
 * @param input - The word to pluralize
 * @param quantity - The quantity to prepend to the word.  If omitted nothing is prepended.  If quantity is one the singular form is returned.
 * @param include - If true and quantity is supplied, the quantity is prepended to the output.
 * @returns The plural form of the input, or if a quantity is supplied - the quantity and the singular/plural form of the input (whichever is appropriate)
 * @example
 * ```typescript
 * plural('cat'); // cats
 * plural('mouse', 1); // mouse
 * plural('mouse', 2); // mice
 * plural('dog', 1, true); // 1 dog
 * plural('dog', 2, true); // 2 dogs
 * ```
 * @group String
 * @category Parts of Speech
 */
export declare function plural(input: string, quantity?: number, include?: boolean): string;