@putout/bundle 4.6.7 → 4.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/putout.js +13 -0
- package/bundle/putout.min.js +2 -2
- package/package.json +2 -3
package/bundle/putout.js
CHANGED
|
@@ -70005,6 +70005,19 @@ jsx.addAttributeValue = (path, name, value) => {
|
|
|
70005
70005
|
setLiteralValue(attributeNode.value, `${attributeNode.value.value} ${value}`);
|
|
70006
70006
|
};
|
|
70007
70007
|
|
|
70008
|
+
jsx.removeAttributeValue = (path, name, attributeValue) => {
|
|
70009
|
+
if (!path)
|
|
70010
|
+
return;
|
|
70011
|
+
|
|
70012
|
+
const node = path.node || path;
|
|
70013
|
+
const classAttribute = getAttributeNode(node, name);
|
|
70014
|
+
|
|
70015
|
+
const {value} = classAttribute.value;
|
|
70016
|
+
|
|
70017
|
+
if (value.includes(attributeValue))
|
|
70018
|
+
setLiteralValue(classAttribute.value, value.replace(RegExp(`\\s?${attributeValue}`), ''));
|
|
70019
|
+
};
|
|
70020
|
+
|
|
70008
70021
|
/**
|
|
70009
70022
|
* The MIT License (MIT)
|
|
70010
70023
|
* Copyright (c) 2017-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
|