LCOV - code coverage report
Current view: top level - src/platform/settings/utils - extensionPath.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 72.7 % 11 8
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { reportError } from '@comfyorg/telemetry/reportError'
       2              : 
       3           26 : export function extensionNameFromPath(path: string): string {
       4           26 :   const encodedName = path.split('/').filter(Boolean).at(-1) ?? path
       5           26 :   try {
       6           26 :     return decodeURIComponent(encodedName)
       7              :   } catch {
       8            0 :     return encodedName
       9              :   }
      10              : }
      11              : 
      12            3 : export function normalizeDisabledExtensionPaths(value: unknown): string[] {
      13            3 :   if (value === undefined) return []
      14            3 :   if (
      15              :     Array.isArray(value) &&
      16              :     value.every((path): path is string => typeof path === 'string')
      17              :   ) {
      18            3 :     return value
      19              :   }
      20              : 
      21            0 :   reportError(
      22              :     new TypeError('Disabled extension paths must be an array of strings'),
      23              :     {
      24              :       errorType: 'invalid_extension_path_setting',
      25              :       surface: 'platform',
      26              :       level: 'warning'
      27              :     }
      28              :   )
      29            0 :   return []
      30              : }
        

Generated by: LCOV version 2.0-1