文件操作 - removeDesc.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/vite-plugin-svg-icons/node_modules/svgo/plugins/removeDesc.js
编辑文件内容
'use strict'; const { detachNodeFromParent } = require('../lib/xast.js'); exports.name = 'removeDesc'; exports.type = 'visitor'; exports.active = true; exports.description = 'removes <desc>'; const standardDescs = /^(Created with|Created using)/; /** * Removes <desc>. * Removes only standard editors content or empty elements 'cause it can be used for accessibility. * Enable parameter 'removeAny' to remove any description. * * https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc * * @author Daniel Wabyick * * @type {import('../lib/types').Plugin<{ removeAny?: boolean }>} */ exports.fn = (root, params) => { const { removeAny = true } = params; return { element: { enter: (node, parentNode) => { if (node.name === 'desc') { if ( removeAny || node.children.length === 0 || (node.children[0].type === 'text' && standardDescs.test(node.children[0].value)) ) { detachNodeFromParent(node, parentNode); } } }, }, }; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件