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

Function dirname

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

Source from the content-addressed store, hash-verified

93 * Return the dirname of the path, as a Path. See path.dirname
94 */
95export function dirname(path: Path): Path {
96 const index = path.lastIndexOf(NormalizedSep);
97 if (index === -1) {
98 return '' as Path;
99 }
100
101 const endIndex = index === 0 ? 1 : index; // case of file under root: '/file'
102
103 return normalize(path.slice(0, endIndex));
104}
105
106/**
107 * Join multiple paths together, and normalize the result. Accepts strings that will be

Callers 15

findModuleFromOptionsFunction · 0.90
parseNameFunction · 0.90
index.tsFile · 0.90
findUniqueFolderPathMethod · 0.90
getDirMethod · 0.90
parentMethod · 0.90
path_spec.tsFile · 0.90
_updateWatchersMethod · 0.90
writeMethod · 0.90
writeMethod · 0.90
generateFunction · 0.50
getAppModulePathFunction · 0.50

Calls 1

normalizeFunction · 0.85

Tested by

no test coverage detected