urlGlob.ts ×4

Frontier kind: Code frontier

unlabeled · c_24b75e8d1eca

64 tests · 3421 LOC · 19 files · introduces 0 tests · 41 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges41 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
485 ranges3421 lines · 19 files · Browse complete extent
All tests (intent)
64 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: 41 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/url/common/urlGlob.ts 41 introduced LOC · 4 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- urlGlob.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { URI } from '../../../base/common/uri.js';
7 >
8 > /**
9 > * Normalizes a URL by removing trailing slashes and query/fragment components.
10 > * @param url The URL to normalize.
11 > * @returns URI - The normalized URI object.
12 > */
13 function normalizeURL(url: string | URI): URI {
14 const uri = typeof url === 'string' ? URI.parse(url) : url;
21 });
22 }
23 > urlGlob.ts
24 > /**
25 > * Checks if a given URL matches a glob URL pattern.
26 > * The glob URL pattern can contain wildcards (*) and subdomain matching (*.)
27 > * @param uri The URL to check.
28 > * @param globUrl The glob URL pattern to match against.
29 > * @returns boolean - True if the URL matches the glob URL pattern, false otherwise.
30 > */
31 > export function testUrlMatchesGlob(uri: string | URI, globUrl: string): boolean {
32 const normalizedUrl = normalizeURL(uri);
33 let normalizedGlobUrl: URI;
56 );
57 }
58 > urlGlob.ts
59 > /**
60 > * @param normalizedUrlPart The normalized URL part to match.
61 > * @param normalizedGlobUrlPart The normalized glob URL part to match against.
62 > * @param includePortLogic Whether to include port logic in the matching process.
63 > * @returns boolean - True if the URL part matches the glob URL part, false otherwise.
64 > */
65 function doMemoUrlMatch(
66 normalizedUrlPart: string,
74 return doUrlPartMatch(memo, includePortLogic, normalizedUrlPart, normalizedGlobUrlPart, 0, 0);
75 }
76 > urlGlob.ts
77 > /**
78 > * Recursively checks if a URL part matches a glob URL part.
79 > * This function uses memoization to avoid recomputing results for the same inputs.
80 > * It handles various cases such as exact matches, wildcard matches, and port logic.
81 > * @param memo A memoization table to avoid recomputing results for the same inputs.
82 > * @param includePortLogic Whether to include port logic in the matching process.
83 > * @param urlPart The URL part to match with.
84 > * @param globUrlPart The glob URL part to match against.
85 > * @param urlOffset The current offset in the URL part.
86 > * @param globUrlOffset The current offset in the glob URL part.
87 > * @returns boolean - True if the URL part matches the glob URL part, false otherwise.
88 > */
89 function doUrlPartMatch(
90 memo: (boolean | undefined)[][],