listed

tcmts.cli.main.listed · #zoqhinwj · term · runs anywhere

Names, the first n of them and how many more.

export function listed(names: string[], n: number): string {
  return names.length > n ? `${names.slice(0, n).join(", ")}, and ${names.length - n} more` : names.join(", ");
}

used by