MCPcopy
hub / github.com/angular/angular-cli / basename

Function basename

packages/angular_devkit/core/src/virtual-fs/path.ts:83–90  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

81 * Return the basename of the path, as a Path. See path.basename
82 */
83export function basename(path: Path): PathFragment {
84 const i = path.lastIndexOf(NormalizedSep);
85 if (i == -1) {
86 return fragment(path);
87 } else {
88 return fragment(path.slice(path.lastIndexOf(NormalizedSep) + 1));
89 }
90}
91
92/**
93 * Return the dirname of the path, as a Path. See path.dirname

Callers 10

parseNameFunction · 0.90
index.tsFile · 0.90
findUniqueFolderPathMethod · 0.90
readWorkspaceFunction · 0.90
path_spec.tsFile · 0.90
potentialSassImportsFunction · 0.85
createTypescriptContextFunction · 0.85
extnameFunction · 0.85
readAssetMethod · 0.85
resolvePackageJsonMethod · 0.85

Calls 1

fragmentFunction · 0.85

Tested by

no test coverage detected