Created
December 9, 2016 08:58
-
-
Save yvele/41690372d8bebe5070349a31f1e15784 to your computer and use it in GitHub Desktop.
SVGO Optimize Sync
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SVGO from "svgo"; | |
import deasync from "deasync"; | |
function svgoOptimizeSync(svgo, content) { | |
let res; | |
svgo.optimize(content, result => res = result); | |
deasync.loopWhile(() => !res); | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment