path.ts ×10

Frontier kind: Code frontier

unlabeled · c_e2256daa628f

39 tests · 3461 LOC · 18 files · introduces 0 tests · 21 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges21 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
510 ranges3461 lines · 18 files · Browse complete extent
All tests (intent)
39 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 21 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/path.ts 21 introduced LOC · 10 ranges

Open complete file

345
346 normalize(path: string): string {
347 > validateString(path, 'path'); path.ts
348 > const len = path.length;
349 > if (len === 0) {
350 return '.';
351 }
352 > let rootEnd = 0; path.ts
353 > let device;
354 > let isAbsolute = false;
355 > const code = path.charCodeAt(0);
356 >
357 > // Try to match a root
358 > if (len === 1) {
359 // `path` contains just a single char, exit early to avoid
360 // unnecessary work
361 return isPosixPathSeparator(code) ? '\\' : path;
362 }
363 > if (isPathSeparator(code)) { path.ts
364 // Possible UNC root
365
407 rootEnd = 1;
408 }
409 > } else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) { path.ts
410 // Possible device root
411 device = path.slice(0, 2);
418 }
419 }
420 > path.ts
421 > let tail = rootEnd < len ?
422 > normalizeString(path.slice(rootEnd), !isAbsolute, '\\', isPathSeparator) :
423 '';
424 > if (tail.length === 0 && !isAbsolute) { path.ts
425 tail = '.';
426 }
427 > if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) { path.ts
428 tail += '\\';
429 }
430 > if (!isAbsolute && device === undefined && path.includes(':')) { path.ts
431 // If the original path was not absolute and if we have not been able to
432 // resolve it relative to a particular device, we need to ensure that the
445 } while ((index = path.indexOf(':', index + 1)) !== -1);
446 }
447 > if (device === undefined) { path.ts
448 return isAbsolute ? `\\${tail}` : tail;
449 }
450 > return isAbsolute ? `${device}\\${tail}` : `${device}${tail}`; path.ts
451 > },
452
453 isAbsolute(path: string): boolean {