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

ng-inline-svg

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-inline-svg - npm Package Compare versions

Comparing version 5.1.3 to 5.1.4

3

lib/inline-svg.directive.js

@@ -60,3 +60,4 @@ "use strict";

var elSvgUse = document.createElementNS('http://www.w3.org/2000/svg', 'use');
elSvgUse.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.inlineSVG);
var url = this._svgCache.getAbsoluteUrl(this.inlineSVG);
elSvgUse.setAttributeNS('http://www.w3.org/1999/xlink', 'href', url);
elSvg.appendChild(elSvgUse);

@@ -63,0 +64,0 @@ this._insertEl(elSvg);

@@ -17,5 +17,5 @@ import { HttpClient } from '@angular/common/http';

setBaseUrl(config: InlineSVGConfig): void;
private _getAbsoluteUrl(url);
getAbsoluteUrl(url: string): string;
private _svgElementFromString(str);
private _cloneSVG(svg);
}

@@ -28,3 +28,3 @@ "use strict";

if (cache === void 0) { cache = true; }
var absUrl = this._getAbsoluteUrl(url);
var absUrl = this.getAbsoluteUrl(url);
if (cache && SVGCacheService._cache.has(absUrl)) {

@@ -55,3 +55,3 @@ return Observable_1.Observable.of(this._cloneSVG(SVGCacheService._cache.get(absUrl)));

};
SVGCacheService.prototype._getAbsoluteUrl = function (url) {
SVGCacheService.prototype.getAbsoluteUrl = function (url) {
if (SVGCacheService._baseUrl && !/^https?:\/\//i.test(url)) {

@@ -58,0 +58,0 @@ url = SVGCacheService._baseUrl + url;

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"SVGCacheService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],null],"parameters":[{"__symbolic":"reference","module":"./inline-svg.config","name":"InlineSVGConfig"},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient"}]}],"getSVG":[{"__symbolic":"method"}],"setBaseUrl":[{"__symbolic":"method"}],"_getAbsoluteUrl":[{"__symbolic":"method"}],"_svgElementFromString":[{"__symbolic":"method"}],"_cloneSVG":[{"__symbolic":"method"}]},"statics":{"_cache":{"__symbolic":"error","message":"Variable not initialized","line":13,"character":17},"_inProgressReqs":{"__symbolic":"error","message":"Variable not initialized","line":14,"character":17},"_baseUrl":{"__symbolic":"error","message":"Variable not initialized","line":16,"character":17}}}}},{"__symbolic":"module","version":1,"metadata":{"SVGCacheService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],null],"parameters":[{"__symbolic":"reference","module":"./inline-svg.config","name":"InlineSVGConfig"},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient"}]}],"getSVG":[{"__symbolic":"method"}],"setBaseUrl":[{"__symbolic":"method"}],"_getAbsoluteUrl":[{"__symbolic":"method"}],"_svgElementFromString":[{"__symbolic":"method"}],"_cloneSVG":[{"__symbolic":"method"}]},"statics":{"_cache":{"__symbolic":"error","message":"Variable not initialized","line":13,"character":17},"_inProgressReqs":{"__symbolic":"error","message":"Variable not initialized","line":14,"character":17},"_baseUrl":{"__symbolic":"error","message":"Variable not initialized","line":16,"character":17}}}}}]
[{"__symbolic":"module","version":3,"metadata":{"SVGCacheService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],null],"parameters":[{"__symbolic":"reference","module":"./inline-svg.config","name":"InlineSVGConfig"},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient"}]}],"getSVG":[{"__symbolic":"method"}],"setBaseUrl":[{"__symbolic":"method"}],"getAbsoluteUrl":[{"__symbolic":"method"}],"_svgElementFromString":[{"__symbolic":"method"}],"_cloneSVG":[{"__symbolic":"method"}]},"statics":{"_cache":{"__symbolic":"error","message":"Variable not initialized","line":13,"character":17},"_inProgressReqs":{"__symbolic":"error","message":"Variable not initialized","line":14,"character":17},"_baseUrl":{"__symbolic":"error","message":"Variable not initialized","line":16,"character":17}}}}},{"__symbolic":"module","version":1,"metadata":{"SVGCacheService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}],null],"parameters":[{"__symbolic":"reference","module":"./inline-svg.config","name":"InlineSVGConfig"},{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClient"}]}],"getSVG":[{"__symbolic":"method"}],"setBaseUrl":[{"__symbolic":"method"}],"getAbsoluteUrl":[{"__symbolic":"method"}],"_svgElementFromString":[{"__symbolic":"method"}],"_cloneSVG":[{"__symbolic":"method"}]},"statics":{"_cache":{"__symbolic":"error","message":"Variable not initialized","line":13,"character":17},"_inProgressReqs":{"__symbolic":"error","message":"Variable not initialized","line":14,"character":17},"_baseUrl":{"__symbolic":"error","message":"Variable not initialized","line":16,"character":17}}}}}]
{
"name": "ng-inline-svg",
"version": "5.1.3",
"version": "5.1.4",
"description": "Angular 4+ directive for inserting an SVG inline within an element.",

@@ -5,0 +5,0 @@ "repository": {

@@ -102,3 +102,4 @@ import {

const elSvgUse = document.createElementNS('http://www.w3.org/2000/svg', 'use');
elSvgUse.setAttributeNS('http://www.w3.org/1999/xlink', 'href', this.inlineSVG);
const url = this._svgCache.getAbsoluteUrl(this.inlineSVG);
elSvgUse.setAttributeNS('http://www.w3.org/1999/xlink', 'href', url);
elSvg.appendChild(elSvgUse);

@@ -105,0 +106,0 @@

@@ -36,3 +36,3 @@ import { Injectable, Optional } from '@angular/core';

getSVG(url: string, cache: boolean = true): Observable<SVGElement> {
const absUrl = this._getAbsoluteUrl(url);
const absUrl = this.getAbsoluteUrl(url);

@@ -73,3 +73,3 @@ // Return cached copy if it exists

private _getAbsoluteUrl(url: string): string {
getAbsoluteUrl(url: string): string {
// Prepend user-configured base if present and URL doesn't seem to have its own

@@ -76,0 +76,0 @@ if (SVGCacheService._baseUrl && !/^https?:\/\//i.test(url)) {

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