LCOV - code coverage report
Current view: top level - src/platform/distribution - cloudPreviewUtil.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 100.0 % 1 1
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { getMediaTypeFromFilename } from '@/utils/formatUtil'
       2              : 
       3              : import { isCloud } from './types'
       4              : 
       5              : /**
       6              :  * Appends `res=512` to the given URLSearchParams when in cloud mode
       7              :  * and the file is an image (or filename is unknown).
       8              :  *
       9              :  * The cloud backend resizes images server-side to prevent
      10              :  * the frontend from loading very large originals for previews.
      11              :  */
      12        11608 : export function appendCloudResParam(
      13              :   params: URLSearchParams,
      14              :   filename?: string
      15              : ): void {
      16              :   if (!isCloud) return
      17              :   if (
      18              :     filename &&
      19              :     (getMediaTypeFromFilename(filename) !== 'image' ||
      20              :       filename.toLowerCase().endsWith('.svg'))
      21              :   )
      22              :     return
      23              :   params.set('res', '512')
      24              : }
        

Generated by: LCOV version 2.0-1