mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Format all plugins with prettier
This commit is contained in:
@ -4,8 +4,8 @@ exports.type = 'perItem';
|
||||
|
||||
exports.active = false;
|
||||
|
||||
exports.description = 'removes attributes of elements that match a css selector';
|
||||
|
||||
exports.description =
|
||||
'removes attributes of elements that match a css selector';
|
||||
|
||||
/**
|
||||
* Removes attributes of elements that match a css selector.
|
||||
@ -23,7 +23,7 @@ exports.description = 'removes attributes of elements that match a css selector'
|
||||
*
|
||||
* <rect x="0" y="0" width="100" height="100" fill="#00ff00" stroke="#00ff00"/>
|
||||
* ↓
|
||||
* <rect x="0" y="0" width="100" height="100" stroke="#00ff00"/>
|
||||
* <rect x="0" y="0" width="100" height="100" stroke="#00ff00"/>
|
||||
*
|
||||
* <caption>A selector removing multiple attributes</caption>
|
||||
* plugins:
|
||||
@ -35,7 +35,7 @@ exports.description = 'removes attributes of elements that match a css selector'
|
||||
*
|
||||
* <rect x="0" y="0" width="100" height="100" fill="#00ff00" stroke="#00ff00"/>
|
||||
* ↓
|
||||
* <rect x="0" y="0" width="100" height="100"/>
|
||||
* <rect x="0" y="0" width="100" height="100"/>
|
||||
*
|
||||
* <caption>Multiple selectors removing attributes</caption>
|
||||
* plugins:
|
||||
@ -57,14 +57,12 @@ exports.description = 'removes attributes of elements that match a css selector'
|
||||
*
|
||||
* @author Bradley Mease
|
||||
*/
|
||||
exports.fn = function(item, params) {
|
||||
|
||||
var selectors = Array.isArray(params.selectors) ? params.selectors : [params];
|
||||
|
||||
selectors.map(function(i) {
|
||||
if (item.matches(i.selector)) {
|
||||
item.removeAttr(i.attributes);
|
||||
}
|
||||
});
|
||||
exports.fn = function (item, params) {
|
||||
var selectors = Array.isArray(params.selectors) ? params.selectors : [params];
|
||||
|
||||
selectors.map(function (i) {
|
||||
if (item.matches(i.selector)) {
|
||||
item.removeAttr(i.attributes);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
Reference in New Issue
Block a user