@opentelemetry/core
Version:
OpenTelemetry Core provides constants and utilities shared by all OpenTelemetry SDK packages.
19 lines (18 loc) • 555 B
JavaScript
//#region src/utils/url.ts
function urlMatches(url, urlToMatch) {
if (typeof urlToMatch === "string") return url === urlToMatch;
else return !!url.match(urlToMatch);
}
/**
* Check if {@param url} should be ignored when comparing against {@param ignoredUrls}
* @param url
* @param ignoredUrls
*/
function isUrlIgnored(url, ignoredUrls) {
if (!ignoredUrls) return false;
for (const ignoreUrl of ignoredUrls) if (urlMatches(url, ignoreUrl)) return true;
return false;
}
//#endregion
export { isUrlIgnored, urlMatches };
//# sourceMappingURL=url.mjs.map