Something went wrong. Try again.
because I got bored of customising my CV for every job
Something went wrong. Try again.
675 B · 33 lines
TypeScript
12345678910111213141516171819202122232425262728293031323334const PLURAL_SPECIAL_CASES: Record<string, string> = { child: "children", person: "people", mouse: "mice", foot: "feet", tooth: "teeth", goose: "geese", man: "men", woman: "women", ox: "oxen", leaf: "leaves", knife: "knives", life: "lives", elf: "elves", loaf: "loaves", potato: "potatoes", tomato: "tomatoes", cactus: "cacti", focus: "foci", analysis: "analyses", basis: "bases", crisis: "crises", thesis: "theses",};
export const pluralize = (word: string, count: number): string => { if (count === 1) { return word; }
const lowerWord = word.toLowerCase(); return PLURAL_SPECIAL_CASES[lowerWord] ?? `${word}s`;};