issue_tree
    Preparing search index...

    Function inferFormat

    • Resolve the output format: an explicit --format always wins; otherwise it is inferred from the --out file extension; otherwise it defaults to svg.

      Parameters

      • explicit: string | undefined

        the --format flag value, if any

      • out: string | undefined

        the --out path, if any

      Returns OutputFormat

      the resolved output format

      Error on an unknown explicit format

      inferFormat(undefined, 'g.png')  // => 'png'
      inferFormat('svg', 'g.png') // => 'svg'