babel-plugin-react-inline-svg-unique-id
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -80,2 +80,7 @@ "use strict"; | ||
var isXlinkHrefAttribute = function isXlinkHrefAttribute(attribute) { | ||
var nameNode = attribute.get('name'); | ||
return nameNode.isJSXNamespacedName() && nameNode.node.namespace.name === 'xlink' && nameNode.node.name.name === 'href'; | ||
}; | ||
var createIdValuesContainer = function createIdValuesContainer(_createIdIdentifier) { | ||
@@ -236,3 +241,3 @@ var idIdentifierByIdValueMap = new Map(); | ||
path.get('attributes').forEach(function (attribute) { | ||
return updateAttributeIdReference({ | ||
updateAttributeIdReference({ | ||
attribute: attribute, | ||
@@ -243,2 +248,11 @@ valueBuilder: buildIriUrlExpression, | ||
}); | ||
if (isXlinkHrefAttribute(attribute)) { | ||
updateAttributeIdReference({ | ||
attribute: attribute, | ||
valueBuilder: buildIdExpression, | ||
idValueRegex: idExactMatchRegex, | ||
idValuesContainer: state.idValuesContainer | ||
}); | ||
} | ||
}); | ||
@@ -245,0 +259,0 @@ } |
{ | ||
"name": "babel-plugin-react-inline-svg-unique-id", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Babel plugin for applying generated ids to inline React SVG components", | ||
@@ -39,3 +39,3 @@ "author": "Laurynas Aleksiūnas <laurynas.aleksiunas@gmail.com>", | ||
}, | ||
"gitHead": "af5d2f9e382cc0ab89f03f271f0fedc9d571875b" | ||
"gitHead": "17cff0f6b1d7e9daa5e5c372407a77a3f8918911" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17127
264