Skip to content

plural

plural(word): string

Defined in: packages/core/src/utils.ts:88

Returns the plural form of an English word using common suffix rules.

Handles the most common cases: words ending in s/x/z/ch/sh, consonant+y, and f/fe. Falls back to appending “s” for everything else.

string

The singular word to pluralise (e.g. "Post", "Category")

string

The pluralised word (e.g. "Posts", "Categories")

plural("Post") // "Posts"
plural("Category") // "Categories"
plural("Leaf") // "Leaves"