@grafana/faro-web-sdk
Version:
Faro instrumentations, metas, transports for web.
25 lines • 974 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isUrlIgnored = exports.getIgnoreUrls = void 0;
var faro_core_1 = require("@grafana/faro-core");
/**
* Retrieves a list of URLs to be ignored by aggregating the ignore URLs from all transports.
*
* @returns {string[]} An array of URLs to be ignored.
*/
function getIgnoreUrls() {
return faro_core_1.faro.transports.transports.flatMap(function (transport) { return transport.getIgnoreUrls(); });
}
exports.getIgnoreUrls = getIgnoreUrls;
/**
* Checks if the given URL should be ignored based on a list of ignored URLs.
*
* @param url - The URL to check.
* @returns `true` if the URL is in the list of ignored URLs, `false` otherwise.
*/
function isUrlIgnored(url) {
if (url === void 0) { url = ''; }
return getIgnoreUrls().some(function (ignoredUrl) { return url && url.match(ignoredUrl) != null; });
}
exports.isUrlIgnored = isUrlIgnored;
//# sourceMappingURL=url.js.map