1
0
mirror of https://github.com/svg/svgo.git synced 2025-08-01 18:46:52 +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

@ -30,10 +30,8 @@ describe('svg2js', function() {
throw err;
}
SVG2JS(data, function(result) {
root = result;
done();
});
root = SVG2JS(data)
done();
});
});
@ -423,9 +421,7 @@ describe('svg2js', function() {
}
try {
SVG2JS(data, function(result) {
root = result;
});
root = SVG2JS(data)
} catch (e) {
error = e;
}
@ -473,9 +469,7 @@ describe('svg2js', function() {
FS.readFile(filepath, 'utf8', function(err, data) {
if (err) throw err;
SVG2JS(data, function(result) {
root = result;
});
root = SVG2JS(data);
done();
});
});