Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-sprite-loader

Package Overview
Dependencies
Maintainers
2
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-sprite-loader - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

14

lib/web/angular-base-workaround.js
if ('angular' in window) {
angular.module('ng').run(['$rootScope', '$window', function ($rootScope, $window) {
angular.module('ng').run(['$rootScope', function ($rootScope) {
$rootScope.$watch(function() {
return $window.location.pathname + $window.location.search;
}, function (newUrl, oldUrl) {
if (newUrl === oldUrl) {
return;
}
function dispatchLocationUpdateEvent(newUrl) {
var evt = document.createEvent('CustomEvent');

@@ -16,4 +10,8 @@ evt.initCustomEvent('spriteLoaderLocationUpdated', false, false, {

window.dispatchEvent(evt);
}
$rootScope.$on('$locationChangeSuccess', function (e, newUrl) {
dispatchLocationUpdateEvent(newUrl);
});
}]);
}

@@ -40,2 +40,12 @@ /**

/**
* Handles forbidden symbols which cannot be directly used inside attributes with url(...) content.
* Adds leading slash for the brackets
* @param url
* @return encoded url
*/
function encodeUrlForEmbedding(url) {
return url.replace(/\(|\)/, "\\$&");
}
/**
* Replaces prefix in `url()` functions

@@ -64,3 +74,4 @@ * @param {Element} svg

if (match && match[1].indexOf(currentUrlPrefix) === 0) {
node.setAttribute(attribute.localName, 'url(' + newUrlPrefix + match[1].split(currentUrlPrefix)[1] + ')');
var referenceUrl = encodeUrlForEmbedding(newUrlPrefix + match[1].split(currentUrlPrefix)[1]);
node.setAttribute(attribute.localName, 'url(' + referenceUrl + ')');
}

@@ -67,0 +78,0 @@ }

{
"name": "svg-sprite-loader",
"version": "0.0.13",
"version": "0.0.14",
"description": "SVG sprite webpack loader",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc