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

@svgr/babel-preset

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@svgr/babel-preset - npm Package Compare versions

Comparing version 6.5.1 to 7.0.0

29

dist/index.js

@@ -12,13 +12,2 @@ 'use strict';

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var addJSXAttribute__default = /*#__PURE__*/_interopDefaultLegacy(addJSXAttribute);
var removeJSXAttribute__default = /*#__PURE__*/_interopDefaultLegacy(removeJSXAttribute);
var removeJSXEmptyExpression__default = /*#__PURE__*/_interopDefaultLegacy(removeJSXEmptyExpression);
var replaceJSXAttributeValue__default = /*#__PURE__*/_interopDefaultLegacy(replaceJSXAttributeValue);
var svgDynamicTitle__default = /*#__PURE__*/_interopDefaultLegacy(svgDynamicTitle);
var svgEmDimensions__default = /*#__PURE__*/_interopDefaultLegacy(svgEmDimensions);
var transformReactNativeSVG__default = /*#__PURE__*/_interopDefaultLegacy(transformReactNativeSVG);
var transformSvgComponent__default = /*#__PURE__*/_interopDefaultLegacy(transformSvgComponent);
const getAttributeValue = (value) => {

@@ -90,6 +79,6 @@ const literal = typeof value === "string" && value.startsWith("{") && value.endsWith("}");

const plugins = [
[transformSvgComponent__default["default"], opts],
[transformSvgComponent, opts],
...opts.icon !== false && opts.dimensions ? [
[
svgEmDimensions__default["default"],
svgEmDimensions,
opts.icon !== true ? { width: opts.icon, height: opts.icon } : opts.native ? { width: 24, height: 24 } : {}

@@ -99,14 +88,14 @@ ]

[
removeJSXAttribute__default["default"],
removeJSXAttribute,
{ elements: ["svg", "Svg"], attributes: toRemoveAttributes }
],
[
addJSXAttribute__default["default"],
addJSXAttribute,
{ elements: ["svg", "Svg"], attributes: toAddAttributes }
],
removeJSXEmptyExpression__default["default"]
removeJSXEmptyExpression
];
if (opts.replaceAttrValues) {
plugins.push([
replaceJSXAttributeValue__default["default"],
replaceJSXAttributeValue,
{ values: replaceMapToValues(opts.replaceAttrValues) }

@@ -116,9 +105,9 @@ ]);

if (opts.titleProp) {
plugins.push(svgDynamicTitle__default["default"]);
plugins.push(svgDynamicTitle);
}
if (opts.descProp) {
plugins.push([svgDynamicTitle__default["default"], { tag: "desc" }, "desc"]);
plugins.push([svgDynamicTitle, { tag: "desc" }, "desc"]);
}
if (opts.native) {
plugins.push(transformReactNativeSVG__default["default"]);
plugins.push(transformReactNativeSVG);
}

@@ -125,0 +114,0 @@ return { plugins };

{
"name": "@svgr/babel-preset",
"description": "SVGR preset that apply transformations from config",
"version": "6.5.1",
"version": "7.0.0",
"main": "./dist/index.js",

@@ -24,3 +24,3 @@ "types": "./dist/index.d.ts",

"engines": {
"node": ">=10"
"node": ">=14"
},

@@ -34,10 +34,10 @@ "homepage": "https://react-svgr.com",

"dependencies": {
"@svgr/babel-plugin-add-jsx-attribute": "^6.5.1",
"@svgr/babel-plugin-remove-jsx-attribute": "*",
"@svgr/babel-plugin-remove-jsx-empty-expression": "*",
"@svgr/babel-plugin-replace-jsx-attribute-value": "^6.5.1",
"@svgr/babel-plugin-svg-dynamic-title": "^6.5.1",
"@svgr/babel-plugin-svg-em-dimensions": "^6.5.1",
"@svgr/babel-plugin-transform-react-native-svg": "^6.5.1",
"@svgr/babel-plugin-transform-svg-component": "^6.5.1"
"@svgr/babel-plugin-add-jsx-attribute": "^7.0.0",
"@svgr/babel-plugin-remove-jsx-attribute": "^7.0.0",
"@svgr/babel-plugin-remove-jsx-empty-expression": "^7.0.0",
"@svgr/babel-plugin-replace-jsx-attribute-value": "^7.0.0",
"@svgr/babel-plugin-svg-dynamic-title": "^7.0.0",
"@svgr/babel-plugin-svg-em-dimensions": "^7.0.0",
"@svgr/babel-plugin-transform-react-native-svg": "^7.0.0",
"@svgr/babel-plugin-transform-svg-component": "^7.0.0"
},

@@ -49,6 +49,6 @@ "peerDependencies": {

"reset": "rm -rf dist",
"build": "rollup -c ../../build/rollup.config.js",
"build": "rollup -c ../../build/rollup.config.mjs",
"prepublishOnly": "npm run reset && npm run build"
},
"gitHead": "d5efedd372999692f84d30072e502b5a6b8fe734"
"gitHead": "3b04a923ae6e0945a9401ad7da7efe26204c8390"
}

Sorry, the diff of this file is not supported yet

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