mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-06 16:10:09 +00:00
Add type cast
This commit is contained in:
@@ -86,22 +86,24 @@ function getPreviewableOutputs(outputs?: TaskOutput): ResultItemImpl[] {
|
||||
return []
|
||||
}
|
||||
|
||||
return (items as ResultItem[])
|
||||
.filter((item) => typeof item === 'object' && item !== null)
|
||||
.map(
|
||||
(item) =>
|
||||
new ResultItemImpl({
|
||||
...item,
|
||||
nodeId,
|
||||
mediaType
|
||||
})
|
||||
)
|
||||
return items.filter(isResultItem).map(
|
||||
(item) =>
|
||||
new ResultItemImpl({
|
||||
...item,
|
||||
nodeId,
|
||||
mediaType
|
||||
})
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
return ResultItemImpl.filterPreviewable(resultItems)
|
||||
}
|
||||
|
||||
function isResultItem(item: unknown): item is ResultItem {
|
||||
return typeof item === 'object' && item !== null
|
||||
}
|
||||
|
||||
export function getPreviewableOutputsFromJobDetail(
|
||||
jobDetail?: JobDetail
|
||||
): ResultItemImpl[] {
|
||||
|
||||
Reference in New Issue
Block a user