Skip to main content
variable pluralize
import { pluralize } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

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

If num is either -1 or 1, return the singular form of the word. If num is any other number, return the plural form. Omit the third argument to use the default of the singular word + s, or supply a custom pluralized word when necessary.

type

(
num: number,
word: string,
plural?,
) => unknown