How to use svgo

Comprehensive svgo code examples:

How to use svgo.optimize:

39
40
41
42
43
44
45
46
47
48
// normalize all escaped quote characters from svg attributes
// from <svg attr=\"value\"... /> to <svg attr="value"... />
// see: https://github.com/cssnano/cssnano/issues/1194
svg = svg.replace(escapedQuotes, '$1="$2"');

const result = optimize(svg, opts);

return {
  result: /** @type {import('svgo').Output}*/ (result).data,
  isUriEncoded,