@putout/bundle 4.6.7 → 4.6.9
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 +22 -2
- package/bundle/putout.min.js +2 -2
- package/package.json +2 -3
package/bundle/putout.js
CHANGED
|
@@ -62984,12 +62984,12 @@ var onceExports = once$9.exports;
|
|
|
62984
62984
|
|
|
62985
62985
|
const noop$3 = () => {};
|
|
62986
62986
|
|
|
62987
|
-
var
|
|
62987
|
+
var empty = /*#__PURE__*/Object.freeze({
|
|
62988
62988
|
__proto__: null,
|
|
62989
62989
|
default: noop$3
|
|
62990
62990
|
});
|
|
62991
62991
|
|
|
62992
|
-
var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(
|
|
62992
|
+
var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(empty);
|
|
62993
62993
|
|
|
62994
62994
|
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
|
62995
62995
|
|
|
@@ -70005,6 +70005,26 @@ 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
|
+
|
|
70021
|
+
jsx.setAttributeValue = (node, name, value) => {
|
|
70022
|
+
const attributeNode = getAttributeNode(node, name);
|
|
70023
|
+
|
|
70024
|
+
if (attributeNode)
|
|
70025
|
+
setLiteralValue(attributeNode.value, value);
|
|
70026
|
+
};
|
|
70027
|
+
|
|
70008
70028
|
/**
|
|
70009
70029
|
* The MIT License (MIT)
|
|
70010
70030
|
* Copyright (c) 2017-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
|