build/bump.js
function setVersion(type, ver) {

  const idx = verMap[type];
  let cur = verArr[idx];
  let next = cur + 1;

  if (isTruthy(ver))
    next = ver;

  if (isTruthy(ver)) {
    verArr[idx] = ver;
  }

  else {
    if (type === 'patch') {
      if (next > maxPatch) {
        // zero current stepping
        // up to minor.
        verArr[idx] = 0;
        return setVersion('minor');
      }
      else {
        verArr[idx] = next;
      }
    }
    else if (type === 'minor') {
      if (next > maxMinor) {
        // zero current stepping
        // up to major.
        verArr[idx] = 0;
        return setVersion('major');
      }
      else {
        verArr[idx] = next;
      }
    }
    else {
      verArr[idx] = next;
    }
  }

}
function setVersion(type, ver) {

  const idx = verMap[type];
  let cur = verArr[idx];
  let next = cur + 1;

  if (isTruthy(ver))
    next = ver;

  if (isTruthy(ver)) {
    verArr[idx] = ver;
  }

  else {
    if (type === 'patch') {
      if (next > maxPatch) {
        // zero current stepping
        // up to minor.
        verArr[idx] = 0;
        return setVersion('minor');
      }
      else {
        verArr[idx] = next;
      }
    }
    else if (type === 'minor') {
      if (next > maxMinor) {
        // zero current stepping
        // up to major.
        verArr[idx] = 0;
        return setVersion('major');
      }
      else {
        verArr[idx] = next;
      }
    }
    else {
      verArr[idx] = next;
    }
  }

}
function setVersion ( type , ver ) { const idx = verMap [ type ] ; let cur = verArr [ idx ] ; let next = cur + 1 ; if ( isTruthy ( ver ) ) next = ver ; if ( isTruthy ( ver ) ) { verArr [ idx ] = ver ; } else { if ( type === 'patch' ) { if ( next > maxPatch ) { // zero current stepping // up to minor. verArr [ idx ] = 0 ; return setVersion ( 'minor' ) ; } else { verArr [ idx ] = next ; } } else if ( type === 'minor' ) { if ( next > maxMinor ) { // zero current stepping // up to major. verArr [ idx ] = 0 ; return setVersion ( 'major' ) ; } else { verArr [ idx ] = next ; } } else { verArr [ idx ] = next ; } } }
Recursive for setting version.
Recursive for setting version .