function getUnique(exists, requested, attempt = requested, n = 1) {
    if (!exists(attempt)) {
        return attempt;
    }
    const newAttempt = requested.slice(0, -n.toString().length) + n;
    return getUnique(exists, requested, newAttempt, n + 1);
}
@param {(val: string) => boolean} exists
@param {string} requested
@param {string} attempt
@param {number} n

@returns {string}