Skip to content

Collection of handy online tools for developers, with great UX.

223 B
Raw Blame
export { generateNumeronym };

function generateNumeronym(word: string): string {
  const wordLength = word.length;

  if (wordLength <= 3) {
    return word;
  }

  return `${word.at(0)}${wordLength - 2}${word.at(-1)}`;
}