UNPKG

majas

Version:

Format-agnostic structure converter.

9 lines (8 loc) 207 B
export function uniqify(individual, inCrowd) { let n = 1; let modividual = individual; while (inCrowd(modividual)) { modividual = `${individual} (${n++})`; } return modividual; }