code: function optimizeSync(svgstr, info) {
    const { config } = this
  
    if (config.error) {
      throw config.error
    }
  
    const maxPassCount = config.multipass ? 10 : 1
    let counter = 0
    let prevResultSize = Number.POSITIVE_INFINITY
  
    let result
  
    const optimizeOnceCallback = svgjs => {
      if (svgjs.error) {
        throw svgjs.error
      }
  
      // eslint-disable-next-line no-plusplus
      if (++counter < maxPassCount && svgjs.data.length < prevResultSize) {
        prevResultSize = svgjs.data.length
        this._optimizeOnce(svgjs.data, info, optimizeOnceCallback)
      } else {
        if (config.datauri) {
          svgjs.data = encodeSVGDatauri(svgjs.data, config.datauri)
        }
        if (info.path) {
          svgjs.path = info.path
        }
  
        result = svgjs
      }
    }
  
    this._optimizeOnce(svgstr, info, optimizeOnceCallback)
    return result
  }
docs: See https://github.com/svg/svgo/blob/master/lib/svgo.js#L24 _optimizeOnce is synchronous internally