( depGraph: DepGraphData, targetName: string, destination: Writable, )
| 140 | * stream as expected by the `depgraph` CLI workflow. |
| 141 | */ |
| 142 | export async function printDepGraph( |
| 143 | depGraph: DepGraphData, |
| 144 | targetName: string, |
| 145 | destination: Writable, |
| 146 | ): Promise<void> { |
| 147 | return new Promise((res, rej) => { |
| 148 | new ConcatStream( |
| 149 | Readable.from('DepGraph data:\n'), |
| 150 | new JsonStreamStringify(depGraph), |
| 151 | Readable.from(`\nDepGraph target:\n${targetName}\nDepGraph end\n\n`), |
| 152 | ) |
| 153 | .on('end', res) |
| 154 | .on('error', rej) |
| 155 | .pipe(destination); |
| 156 | }); |
| 157 | } |
| 158 | |
| 159 | export function shouldPrintDepGraph(opts: Options): boolean { |
| 160 | return opts['print-graph'] && !opts['print-deps']; |
no outgoing calls
no test coverage detected