index.js
function (dir, appname, version) {
  if (appname) {
    dir = path.join(dir, appname);
    if (version) {
      dir = path.join(dir, version);
    }
  }
  return dir;
}
function (dir, appname, version) {
  if (appname) {
    dir = path.join(dir, appname);
    if (version) {
      dir = path.join(dir, version);
    }
  }
  return dir;
}
function ( dir , appname , version ) { if ( appname ) { dir = path . join ( dir , appname ) ; if ( version ) { dir = path . join ( dir , version ) ; } } return dir ; }
Append the name and and version to a path.

Both the appname and version are optional. The version is only appended if
the appname.

@param {string} dir Base directory.
@param {string} [appname] Optional name to append.
@param {string} [version] Optional version to append.
@returns {string} Resulting path
@private
Append the name and and version to a path .