@putout/bundle 4.7.3 → 4.7.4
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 +8 -0
- package/bundle/putout.min.js +1 -1
- package/package.json +2 -2
package/bundle/putout.js
CHANGED
|
@@ -68394,6 +68394,7 @@ function getAttributeValue(path, attributeName) {
|
|
|
68394
68394
|
|
|
68395
68395
|
return attribute.value.value;
|
|
68396
68396
|
}
|
|
68397
|
+
|
|
68397
68398
|
jsx.addAttributeValue = addAttributeValue;
|
|
68398
68399
|
function addAttributeValue(path, name, value) {
|
|
68399
68400
|
const attributeNode = getAttributeNode(path, name);
|
|
@@ -68403,6 +68404,7 @@ function addAttributeValue(path, name, value) {
|
|
|
68403
68404
|
|
|
68404
68405
|
setLiteralValue(attributeNode.value, `${attributeNode.value.value} ${value}`);
|
|
68405
68406
|
}
|
|
68407
|
+
|
|
68406
68408
|
jsx.removeAttributeValue = removeAttributeValue;
|
|
68407
68409
|
function removeAttributeValue(path, name, attributeValue) {
|
|
68408
68410
|
if (!path)
|
|
@@ -68416,6 +68418,7 @@ function removeAttributeValue(path, name, attributeValue) {
|
|
|
68416
68418
|
if (value.includes(attributeValue))
|
|
68417
68419
|
setLiteralValue(classAttribute.value, value.replace(RegExp(`\\s?${attributeValue}`), ''));
|
|
68418
68420
|
}
|
|
68421
|
+
|
|
68419
68422
|
jsx.setAttributeValue = (node, name, value) => {
|
|
68420
68423
|
const attributeNode = getAttributeNode(node, name);
|
|
68421
68424
|
|
|
@@ -68446,6 +68449,11 @@ jsx.hasDataName = (path, value = '') => {
|
|
|
68446
68449
|
return attribute === value;
|
|
68447
68450
|
};
|
|
68448
68451
|
|
|
68452
|
+
jsx.hasAttributeValue = (path, name, value = '') => {
|
|
68453
|
+
const attribute = getAttributeValue(path, name);
|
|
68454
|
+
return attribute === value;
|
|
68455
|
+
};
|
|
68456
|
+
|
|
68449
68457
|
/**
|
|
68450
68458
|
* The MIT License (MIT)
|
|
68451
68459
|
* Copyright (c) 2017-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
|