| 39 | } |
| 40 | |
| 41 | const isStreamingOutput = (output: any): boolean => { |
| 42 | if (typeof ReadableStream !== 'undefined' && output instanceof ReadableStream) { |
| 43 | return true |
| 44 | } |
| 45 | |
| 46 | if (typeof output !== 'object' || !output) { |
| 47 | return false |
| 48 | } |
| 49 | |
| 50 | return ( |
| 51 | output.isStreaming === true || |
| 52 | ('executionData' in output && |
| 53 | typeof output.executionData === 'object' && |
| 54 | output.executionData?.isStreaming === true) || |
| 55 | 'stream' in output |
| 56 | ) |
| 57 | } |
| 58 | |
| 59 | const shouldSkipEntry = (output: any): boolean => { |
| 60 | if (typeof output !== 'object' || !output) { |