( name: string, indent: boolean = false, )
| 36 | * @param indent - Whether to indent the debug output |
| 37 | */ |
| 38 | export function debug<T>( |
| 39 | name: string, |
| 40 | indent: boolean = false, |
| 41 | ): PipedOperator<T, T> { |
| 42 | return (stream: IStreamBuilder<T>): IStreamBuilder<T> => { |
| 43 | const output = new StreamBuilder<T>( |
| 44 | stream.graph, |
| 45 | new DifferenceStreamWriter<T>(), |
| 46 | ) |
| 47 | const operator = new DebugOperator<T>( |
| 48 | stream.graph.getNextOperatorId(), |
| 49 | stream.connectReader(), |
| 50 | output.writer, |
| 51 | name, |
| 52 | indent, |
| 53 | ) |
| 54 | stream.graph.addOperator(operator) |
| 55 | return output |
| 56 | } |
| 57 | } |
no test coverage detected