87
* @returns boolean - True if the URL part matches the glob URL part, false otherwise.
88
*/
90
>
memo: (boolean | undefined)[][],
91
>
includePortLogic: boolean,
92
>
urlPart: string,
93
>
globUrlPart: string,
94
>
urlOffset: number,
95
>
globUrlOffset: number
96
>
): boolean {
97
>
if (memo[urlOffset]?.[globUrlOffset] !== undefined) {
98
return memo[urlOffset][globUrlOffset]!;
99
}
101
>
const options = [];
102
>
103
>
// We've reached the end of the url.
104
>
if (urlOffset === urlPart.length) {
105
>
// We're also at the end of the glob url as well so we have an exact match.
106
>
if (globUrlOffset === globUrlPart.length) {
107
return true;
108
}
109
110
>
if (includePortLogic && globUrlPart[globUrlOffset] + globUrlPart[globUrlOffset + 1] === ':*') {
urlGlob.ts
111
// any port match. Consume a port if it exists otherwise nothing. Always consume the base.
112
return globUrlOffset + 2 === globUrlPart.length;