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

Make optimize synchronous (#1322)

Ref https://github.com/svg/svgo/issues/1015

Looks like `sax` is synchronous and we do not need to listen "end"
event. This allows to avoid all callbacks and make `optimize` method
synchronous.
This commit is contained in:
Bogdan Chadkin
2021-02-14 14:59:50 +03:00
committed by GitHub
parent b85d7f9885
commit 1dc5ee3ee1
8 changed files with 75 additions and 113 deletions

View File

@ -44,10 +44,9 @@ describe('plugins tests', function() {
js2svg : { pretty: true }
});
return svgo.optimize(orig, {path: file}).then(function(result) {
//FIXME: results.data has a '\n' at the end while it should not
normalize(result.data).should.be.equal(should);
});
const result = svgo.optimize(orig, {path: file});
//FIXME: results.data has a '\n' at the end while it should not
normalize(result.data).should.be.equal(should);
});
});
@ -69,4 +68,4 @@ function readFile(file) {
resolve(data);
});
});
}
}