LCOV - code coverage report
Current view: top level - src/platform/assets/utils - clearDeletedAssetWidgetValues.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 0.0 % 10 0
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import type { LGraph, Subgraph } from '@/lib/litegraph/src/litegraph'
       2              : 
       3              : import {
       4              :   createDeletedValueMatcher,
       5              :   findNodesReferencingValues
       6              : } from './clearNodePreviewCacheForValues'
       7              : 
       8              : /** Blanks widget values referencing deleted assets so the saved workflow drops them. */
       9            0 : export function clearDeletedAssetWidgetValues(
      10              :   rootGraph: LGraph | Subgraph,
      11              :   deletedValues: ReadonlySet<string>
      12              : ): void {
      13            0 :   if (deletedValues.size === 0) return
      14            0 :   const isDeleted = createDeletedValueMatcher(deletedValues)
      15            0 :   for (const node of findNodesReferencingValues(rootGraph, deletedValues, {
      16              :     includeSubgraphNodes: true
      17              :   })) {
      18            0 :     if (!node.widgets) continue
      19            0 :     for (const widget of node.widgets) {
      20            0 :       if (!isDeleted(widget.value)) continue
      21            0 :       widget.value = ''
      22            0 :       widget.callback?.('')
      23              :     }
      24            0 :     node.graph?.setDirtyCanvas(true)
      25              :   }
      26              : }
        

Generated by: LCOV version 2.0-1