MCPcopy Index your code
hub / github.com/angular/angular-cli / asWindowsPath

Function asWindowsPath

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

Source from the content-addressed store, hash-verified

288};
289
290export function asWindowsPath(path: Path): WindowsPath {
291 const drive = path.match(/^\/(\w)(?:\/(.*))?$/);
292 if (drive) {
293 const subPath = drive[2] ? drive[2].replace(/\//g, '\\') : '';
294
295 return `${drive[1]}:\\${subPath}` as WindowsPath;
296 }
297
298 return path.replace(/\//g, '\\') as WindowsPath;
299}
300
301export function asPosixPath(path: Path): PosixPath {
302 return path as string as PosixPath;

Callers 2

path_spec.tsFile · 0.90
getSystemPathFunction · 0.85

Calls 1

matchMethod · 0.45

Tested by

no test coverage detected