path.ts ×6

Frontier kind: Code frontier

unlabeled · c_ac2446772a8e

133 tests · 3405 LOC · 18 files · introduces 0 tests · 24 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges24 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
488 ranges3405 lines · 18 files · Browse complete extent
All tests (intent)
133 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: 24 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/base/common/path.ts 24 introduced LOC · 6 ranges

Open complete file

1428
1429 extname(path: string): string {
1430 > validateString(path, 'path'); path.ts
1431 > let startDot = -1;
1432 > let startPart = 0;
1433 > let end = -1;
1434 > let matchedSlash = true;
1435 > // Track the state of characters (if any) we see before our first dot and
1436 > // after any path separator we find
1437 > let preDotState = 0;
1438 > for (let i = path.length - 1; i >= 0; --i) {
1439 > const char = path[i];
1440 > if (char === '/') {
1441 // If we reached a path separator that was not part of a set of path
1442 // separators at the end of the string, stop now
1447 continue;
1448 }
1449 > if (end === -1) { path.ts
1450 > // We saw the first non-path separator, mark this as the end of our
1451 > // extension
1452 > matchedSlash = false;
1453 > end = i + 1;
1454 > }
1455 > if (char === '.') {
1456 // If this is our first dot, mark it as the start of our extension
1457 if (startDot === -1) {
1461 preDotState = 1;
1462 }
1463 > } else if (startDot !== -1) { path.ts
1464 // We saw a non-dot and non-path separator before our dot, so we should
1465 // have a good chance at having a non-empty extension
1466 preDotState = -1;
1467 }
1468 > } path.ts
1469 >
1470 > if (startDot === -1 ||
1471 end === -1 ||
1472 // We saw a non-dot character immediately before the dot
1475 (preDotState === 1 &&
1476 startDot === end - 1 &&
1477 > startDot === startPart + 1)) { path.ts
1478 return '';
1479 }
1480 return path.slice(startDot, end);
1481 > }, path.ts
1482
1483 format: _format.bind(null, '/'),