(url: URL, token: string)
| 342 | /** Match `token` as a separator-bounded run inside a URL hostname or path, |
| 343 | * used as a low-confidence detection hint when introspection fails. */ |
| 344 | const urlMatchesToken = (url: URL, token: string): boolean => { |
| 345 | const re = new RegExp(`(?:^|[^a-z0-9])${token}(?:$|[^a-z0-9])`, "i"); |
| 346 | return re.test(url.hostname) || re.test(url.pathname); |
| 347 | }; |
| 348 | |
| 349 | /** Derive an integration slug from an endpoint URL. */ |
| 350 | const slugFromEndpoint = (endpoint: string): string => { |