function resolveFileAndOptions(vfileCompatible, options) {
  const file = looksLikeAVFile(vfileCompatible)
    ? vfileCompatible
    : new VFile(vfileCompatible)
  const {format, ...rest} = options || {}
  return {
    file,
    options: {
      format:
        format === 'md' || format === 'mdx'
          ? format
          : file.extname && (rest.mdExtensions || md).includes(file.extname)
            ? 'md'
            : 'mdx',
      ...rest
    }
  }
}
Create a file and options from a given `vfileCompatible` and options that
might contain `format: 'detect'`.

@param {Readonly<Compatible>} vfileCompatible
  File.
@param {Readonly<CompileOptions> | null | undefined} [options]
  Configuration (optional).
@returns {{file: VFile, options: ProcessorOptions}}
  File and options.