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:
@ -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();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user