code: function incInt(str, base = 10) {
    if (!isNumStr(str, base)) throw new Error('in incInt, str is not an integer in the given base');
    let minus = String.fromCharCode(consts.minus);
  
    let rec = rectify(str);
  
    // If the rectified value is negative, call decrement on the absolute value.
    if (rec[0] == minus) {
      let dec = decInt(rec.slice(1), base);
      return (dec == consts.alphabet[0]) ? dec : minus + dec; // avoid '-0'
    }
  
    // Find the first character from the right that is not maximal.
    // This is the character to increment.
    let maximalChar = consts.alphabet[base - 1];
    let incIndex = -1;
    for (let i = rec.length - 1; i >= 0; i--) {
      if (rec[i] != maximalChar) {
        incIndex = i;
        break;
      }
    }
  
    // If all characters are maximal, extend the int string by prepending a '0'.
    // The prepended character becomes the character to increment.
    if (incIndex < 0) {
      rec = consts.alphabet[0] + rec;
      incIndex = 0;
    }
  
    // Increment the appropriate character.
    let incrementedChar = incChar(rec[incIndex], base);
    let inc = rec.slice(0, incIndex) + incrementedChar;
  
    // Reset all lesser character places to zero.
    inc = inc.padEnd(rec.length, consts.alphabet[0]);
  
    return inc;
  }
docs: /* Increment an integer string in a given base.
  *