Get only the filename from a full path.

@param {string} path
@returns {string} filename

@private
function baseName (path) {
  const parts = path.split('/');
  if (path.substr(-1) === '/') {
    return parts[parts.length-2]+'/';
  } else {
    return parts[parts.length-1];
  }
}