function baseName (path) {
  const parts = path.split('/');
  if (path.substr(-1) === '/') {
    return parts[parts.length-2]+'/';
  } else {
    return parts[parts.length-1];
  }
}
function baseName (path) {
  const parts = path.split('/');
  if (path.substr(-1) === '/') {
    return parts[parts.length-2]+'/';
  } else {
    return parts[parts.length-1];
  }
}
function baseName ( path ) { const parts = path . split ( '/' ) ; if ( path . substr ( - 1 ) === '/' ) { return parts [ parts . length - 2 ] + '/' ; } else { return parts [ parts . length - 1 ] ; } }
Get only the filename from a full path.

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

@private
Get only the filename from a full path .