1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-31 07:44:22 +03:00

Convert to xast doctype, instruction and comment nodes

Here we add [xast](https://github.com/syntax-tree/xast) support
to three basic nodes: doctype, instruction and comment

Some tests are rewritten instead of checking each field to `.include`
assertion which is able to match shape of object.
This commit is contained in:
Bogdan Chadkin
2021-03-10 14:06:06 +03:00
parent d1d6e5efe8
commit 8622a5f31b
6 changed files with 48 additions and 64 deletions

View File

@ -19,7 +19,7 @@ exports.description = 'removes comments';
* @author Kir Belevich
*/
exports.fn = function (item) {
if (item.comment && item.comment.charAt(0) !== '!') {
if (item.type === 'comment' && item.value.charAt(0) !== '!') {
return false;
}
};