From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/svgo/plugins/removeEmptyContainers.js | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 node_modules/svgo/plugins/removeEmptyContainers.js (limited to 'node_modules/svgo/plugins/removeEmptyContainers.js') diff --git a/node_modules/svgo/plugins/removeEmptyContainers.js b/node_modules/svgo/plugins/removeEmptyContainers.js new file mode 100644 index 00000000..356a5835 --- /dev/null +++ b/node_modules/svgo/plugins/removeEmptyContainers.js @@ -0,0 +1,32 @@ +'use strict'; + +exports.type = 'perItemReverse'; + +exports.active = true; + +exports.description = 'removes empty container elements'; + +var container = require('./_collections').elemsGroups.container; + +/** + * Remove empty containers. + * + * @see http://www.w3.org/TR/SVG/intro.html#TermContainerElement + * + * @example + * + * + * @example + * + * + * @param {Object} item current iteration item + * @return {Boolean} if false, item will be filtered out + * + * @author Kir Belevich + */ +exports.fn = function(item) { + + return !(item.isElem(container) && !item.isElem('svg') && item.isEmpty() && + (!item.isElem('pattern') || !item.hasAttrLocal('href'))); + +}; -- cgit v1.2.3