Socket
Socket
Sign inDemoInstall

svg-sprite

Package Overview
Dependencies
Maintainers
2
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-sprite - npm Package Compare versions

Comparing version 3.0.0-alpha1 to 3.0.0-alpha2

8

lib/svg-sprite.js

@@ -166,4 +166,4 @@ 'use strict';

if (isFunction(transform[1])) {
return () => {
transform[1](shape, this, cb);
return callback => {
transform[1](shape, this, callback);
};

@@ -174,4 +174,4 @@ }

if (transform[0] in this._shapeTransformers && isObject(transform[1])) {
return () => {
this._shapeTransformers[transform[0]](shape, transform[1], this, cb);
return callback => {
this._shapeTransformers[transform[0]](shape, transform[1], this, callback);
};

@@ -178,0 +178,0 @@ }

@@ -176,3 +176,2 @@ 'use strict';

SVGSpriteBase.prototype._buildCSSResources = function(files, cb) {
const tasks = [];
const createResourceTask = (renderConfig, data, spriter, ext) => {

@@ -194,2 +193,4 @@ return _cb => {

const tasks = [];
if (this.config.render) {

@@ -196,0 +197,0 @@ for (const [extension, value] of Object.entries(this.config.render)) {

@@ -838,6 +838,6 @@ 'use strict';

const ids = [];
let classnames = [];
const classnames = new Set();
const classnameFilter = classname => {
if (`.${classname}` in substClassnames) {
classnames.push(classname);
classnames.add(classname);
}

@@ -883,9 +883,7 @@ };

// Substitute class names within the selector
if (classnames.length) {
// TODO
classnames = [...new Set(classnames)]
.sort((a, b) => b.length - a.length)
.forEach(classname => { // eslint-disable-line unicorn/no-array-for-each
selText = selText.split(`.${classname}`).join(`.${substClassnames[`.${classname}`]}`);
});
if (classnames.size) {
const sortedClassnames = [...classnames].sort((a, b) => b.length - a.length);
for (const classname of sortedClassnames) {
selText = selText.split(`.${classname}`).join(`.${substClassnames[`.${classname}`]}`);
}
}

@@ -892,0 +890,0 @@

{
"name": "svg-sprite",
"version": "3.0.0-alpha1",
"version": "3.0.0-alpha2",
"author": "Joschi Kuphal <joschi@kuphal.net> (https://jkphl.is)",

@@ -37,3 +37,3 @@ "description": "SVG sprites & stacks galore — A low-level Node.js module that takes a bunch of SVG files, optimizes them and bakes them into SVG sprites of several types along with suitable stylesheet resources (e.g. CSS, Sass, LESS, Stylus, etc.)",

"dependencies": {
"@resvg/resvg-js": "^2.2.0",
"@resvg/resvg-js": "^2.4.1",
"@xmldom/xmldom": "^0.8.6",

@@ -55,9 +55,9 @@ "async": "^3.2.4",

"xpath": "^0.0.32",
"yargs": "^17.6.2"
"yargs": "^17.7.1"
},
"devDependencies": {
"eslint-plugin-jest": "^27.1.6",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-jest-formatting": "^3.1.0",
"eslint-plugin-jsdoc": "^39.6.4",
"jest": "^29.3.1",
"eslint-plugin-jsdoc": "^39.9.1",
"jest": "^29.5.0",
"less": "^4.1.3",

@@ -67,3 +67,3 @@ "pixelmatch": "^5.3.0",

"pngjs": "^6.0.0",
"sass": "^1.56.1",
"sass": "^1.59.2",
"stylus": "^0.59.0",

@@ -182,2 +182,3 @@ "xo": "^0.53.1"

"jest/no-hooks": "off",
"jest/no-untyped-mock-factory": "off",
"jest/prefer-lowercase-title": "off"

@@ -184,0 +185,0 @@ }

@@ -396,5 +396,5 @@ # svg-sprite

[ci-url]: https://github.com/svg-sprite/svg-sprite/actions?query=workflow%3ATests+branch%3Amain
[ci-image]: https://img.shields.io/github/workflow/status/svg-sprite/svg-sprite/Tests/main?label=CI&logo=github
[ci-image]: https://img.shields.io/github/actions/workflow/status/svg-sprite/svg-sprite/test.yml?branch=main&label=CI&logo=github
[coveralls-url]: https://coveralls.io/github/svg-sprite/svg-sprite?branch=main
[coveralls-image]: https://img.shields.io/coveralls/github/svg-sprite/svg-sprite/main
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