Resolve the output format: an explicit --format always wins; otherwise it is inferred from the --out file extension; otherwise it defaults to svg.
--format
--out
svg
the --format flag value, if any
the --out path, if any
the resolved output format
Error on an unknown explicit format
inferFormat(undefined, 'g.png') // => 'png' inferFormat('svg', 'g.png') // => 'svg' Copy
inferFormat(undefined, 'g.png') // => 'png' inferFormat('svg', 'g.png') // => 'svg'
Resolve the output format: an explicit
--formatalways wins; otherwise it is inferred from the--outfile extension; otherwise it defaults tosvg.