Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$(urlSelector).each(function() {
const $element = $(this);
$element.nodeName = $element[0].name;
const attribute = URI.getDomAttribute($element);
if (!attribute) {
// element does not have a URL attribute
return;
}
const url = $element.attr(attribute);
if (url.slice(0, options.resolve.length) !== options.resolve) {
// URL is not using the absolute prefix
return;
}
let resolved = URI(url).relativeTo(absolute).toString();
if (!resolved) {
// the file is linking to itself
resolved = URI(fileName).filename();
}