Socket
Socket
Sign inDemoInstall

@dicebear/converter

Package Overview
Dependencies
67
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.0.1

20

lib/utils/svg.js
export function ensureSize(svg, defaultSize = 512) {
let size = defaultSize;
svg = svg.replace(/<svg([^>]*?(?:width="(\d+)"[^>]*)?)>/, (match, g1, g2) => {
if (g2) {
size = parseInt(g2);
svg = svg.replace(/<svg([^>]*)/, (match, g1) => {
const found = g1.match(/width="([^"]+)"/);
if (found) {
size = parseInt(found[1]);
}
if (g1.match(/width="([^"]+)"/)) {
g1 = g1.replace(/width="([^"]+)"/, `width="${size}"`);
}
else {
g1 += ` width="${size}" height="${size}"`;
g1 += ` width="${size}"`;
}
return `<svg${g1}>`;
if (g1.match(/height="([^"]+)"/)) {
g1 = g1.replace(/height="([^"]+)"/, `height="${size}"`);
}
else {
g1 += ` height="${size}"`;
}
return `<svg${g1}`;
});
return { svg, size };
}
{
"name": "@dicebear/converter",
"version": "5.0.0",
"version": "5.0.1",
"description": "SVG Converter for DiceBear",

@@ -74,3 +74,3 @@ "keywords": [

},
"gitHead": "e8a60b4611b5738c7f46910f77b97ef1967f32dc"
"gitHead": "2853e690ca9908cf78108bad39284c9de15a471e"
}
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc