path.ts ×6

Frontier kind: Code frontier

unlabeled · c_0e4183b6bfe7

2679 tests · 3361 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)
470 ranges3361 lines · 18 files · Browse complete extent
All tests (intent)
2679 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

86 }
87
88 > function isPosixPathSeparator(code: number | undefined) { path.ts
89 > return code === CHAR_FORWARD_SLASH;
90 > }
91
92 function isWindowsDeviceRoot(code: number) {
96
97 // Resolves . and .. elements in a path with directory names
98 > function normalizeString(path: string, allowAboveRoot: boolean, separator: string, isPathSeparator: (code?: number) => boolean) { path.ts
99 > let res = '';
100 > let lastSegmentLength = 0;
101 > let lastSlash = -1;
102 > let dots = 0;
103 > let code = 0;
104 > for (let i = 0; i <= path.length; ++i) {
105 > if (i < path.length) {
106 > code = path.charCodeAt(i);
107 > }
108 > else if (isPathSeparator(code)) {
109 break;
110 }
112 code = CHAR_FORWARD_SLASH;
113 }
114 > path.ts
115 > if (isPathSeparator(code)) {
116 > if (lastSlash === i - 1 || dots === 1) {
117 // NOOP
118 > } else if (dots === 2) { path.ts
119 if (res.length < 2 || lastSegmentLength !== 2 ||
120 res.charCodeAt(res.length - 1) !== CHAR_DOT ||
153 lastSegmentLength = i - lastSlash - 1;
154 }
155 > lastSlash = i; path.ts
156 > dots = 0;
157 > } else if (code === CHAR_DOT && dots !== -1) {
158 ++dots;
159 } else {
160 dots = -1;
161 }
162 > } path.ts
163 > return res;
164 > }
165
166 function formatExt(ext: string): string {