Get dirname of path
@param {String} path
@return {String}
12295
function (path) {
            var result = path.match(splitPathRe) || [],
                root = result[1] || '',
                dir = result[2] || '';

            if (!root && !dir) {
                // No dirname
                return '.';
            }

            if (dir) {
                // It has a dirname, strip trailing slash
                dir = dir.substring(0, dir.length - 1);
            }

            return root + dir;
        }
605793
function getPathParts(path) {
  // split the path specified into an array on `.`
  const pathParts = String(path).split('.');

  // create an empty array which will be the result
  const parts = [];

  // create an index variable so we can skip indexes if
  // need be when parsing the paths
  let index = 0;

  // while the index is smaller then the parts array length
  while (index < pathParts.length) {
    // get the part from the parts array
    let parsedPart = pathParts[index];

    // while (if) the part starts with `\` remove it and
    // append `.` and then next part from the array to it
    // this should result in `test\\.test` being parsed
    // into `test.test`. This is done so users can escape
    // dots from the dot notation
    while (parsedPart[parsedPart.length - 1] === '\\'
          && pathParts[index + 1] !== undefined
          && pathParts[index + 1] !== null) {
      // remove `\` and append the `.`
      parsedPart = `${parsedPart.slice(0, -1)}.`;
      // increase the index so next iteration it will skip
      // the next path which is about to be added to this path
      index += 1;
      // add the next path to the current one because they are
      // apart of the same object key
      parsedPart += pathParts[index];
    }

    // increase the index so we can continue to the next path
    // in the array
    index += 1;

    // append the parsed path to the results array
    parts.push(parsedPart);
  }

  // return all the parsed paths
  return parts;
}
1075009
function getDotSeparatedPath(path) {
  return path.split('.').reduce((splitPath, pathItem) => !pathItem ? splitPath : [...splitPath, getKey(pathItem)], []);
}
909366
function getName () {
    const pathname = url.parse(parts[parts.length - 1]).pathname;

    return pathname ? pathname.replace('/', '') : pathname;
  }
1341501
private static final String getFileName(String path) {
        int index = path.lastIndexOf('/');//stop using File.separatorChar as we are not even remotely close to be using that ANYwhere else - apparently. This makes it fail on Windows systems
        int prefixLength = prefixLength(path);
        if (index < prefixLength) return path.substring(prefixLength);
        return path.substring(index + 1);
    }
1166812
function getPathTokens(path) {
	const cleanPath = path.startsWith('/') ? path.substr(1) : path;
	return cleanPath.split('/').filter((s) => s !== '');
}
120497
public static function dirname(string $path): string
    {
        $dirname = dirname($path);

        return self::normalizeDirname($dirname);
    }
402208
protected function _dirname($path) {
		return ($stat = $this->stat($path)) ? ($stat['phash'] ? $this->decode($stat['phash']) : $this->root) : false;
	}
498365
function (path) {
    if ($bc_$4.pN) {
      var _path = path || ($bc_$4.pN.path.tempDir() + 'tmp.txt');
      return $bc_$4.pN.path.getFileOrDirIconPath(_path)
    }

    return ''
  }
279930
function getNamespace (path, relative) {
  // ignore parent path
  let final = ''
  if (relative) {
    const s = path.split('/')
    final = s[s.length - 1]
  } else {
    final = path.startsWith('./') ? path.slice(2) : path
  }
  // remove '.js'
  return final.slice(0, final.length - 3)
}
316911
def Dirname(self):
    """"""
    result = self.Copy()

    while 1:
      last_directory = posixpath.dirname(result.last.path)
      if last_directory != "/" or len(result) <= 1:
        result.last.path = last_directory
        # Make sure to clear the inode information.
        result.last.inode = None

        break

      result.Pop(-1)

    return result
409104
function(path) {
  var loc = window.location;

  if (path[path.length-1] === '/') {
    path = path.slice(0, -1);
  }

  if (~path.indexOf('//')) { 
    return path;
  }

  var auth = /^[^:\/]+:\/\/[^\/]+/.exec(loc.href)[0];

  if (path[0] === '/') {
    path = auth + path;
  } else {
    path = path.replace(/^\.?\//, '');
    loc = loc.pathname.replace(/^\/|\/$/g, '');
    path = [auth, loc, path].join('/');
  }

  return path;
}
1263350
function splitPath(path) {
  const delim = /[./]/;
  const result = R.pipe(
    R.split(delim),
    R.without('')
  )(path);
  return result;
}
151609
function getModuleName(filepath, source) {

        filepath = PathModule.resolve(filepath);

        if (/\bdefine\s*\(\s*("|')([\s\S]+?)\1\s*,\s*/g.test(source)) {
            return {
                type: "id",
                value: RegExp.$2,
                path: filepath
            };
        }

        return {
            type: "path",
            value: PathModule.resolve(filepath),
            path: filepath
        };

    }
577754
def jsName(path,name):
    ''''''
    shortPath=path.replace(
            "C:\\Users\\scheinerbock\\Desktop\\"+
            "ideogram\\scrapeSource\\test\\","")
    noDash = shortPath.replace("-","_dash_")
    jsPath=noDash.replace("\\","_slash_").replace(".","_dot_")
    jsName=jsPath+'_slash_'+name
    return jsName
1294762
function parsePath(path) {
        var lastSlash = path.lastIndexOf("/"), folder, rest;
        if (lastSlash === path.length - 1) {
            lastSlash = path.slice(0, path.length - 1).lastIndexOf("/");
        }
        if (lastSlash >= 0) {
            rest = " - " + (lastSlash ? path.slice(0, lastSlash) : "/");
            folder = path.slice(lastSlash + 1);
        } else {
            rest = "/";
            folder = path;
        }

        return {path: path, folder: folder, rest: rest};
    }
558143
static String[] getPathNames(String path) {
    if (path == null || !path.startsWith(Path.SEPARATOR)) {
      return null;
    }
    return StringUtils.split(path, Path.SEPARATOR_CHAR);
  }