Makes a list of names fit, or null when one cannot. Each loses a trailing full stop, and one whose
label still runs past SHORT_TEXT_MAX is cut when it is all Latin or Cyrillic, to the most letters
that fit, no more than mostLetters and no fewer than three. The names must still all differ after
the cut, or two days would read the same.
Parameters
names: string[]
The names as Intl gives them.
labelOf: (name:string,index:number)=>string
The label a name goes out in, which the limit is measured on.
mostLetters: number = Infinity
The most letters a cut keeps. Left out, a cut keeps as many as fit.
Returns string[]|null
The fitted names in the same order, or null when one cannot fit or two end up the same.
Makes a list of names fit, or null when one cannot. Each loses a trailing full stop, and one whose label still runs past
SHORT_TEXT_MAXis cut when it is all Latin or Cyrillic, to the most letters that fit, no more thanmostLettersand no fewer than three. The names must still all differ after the cut, or two days would read the same.