MCPcopy
hub / github.com/snyk/cli / printDepGraph

Function printDepGraph

src/lib/snyk-test/common.ts:142–157  ·  view source on GitHub ↗
(
  depGraph: DepGraphData,
  targetName: string,
  destination: Writable,
)

Source from the content-addressed store, hash-verified

140 * stream as expected by the `depgraph` CLI workflow.
141 */
142export 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
159export function shouldPrintDepGraph(opts: Options): boolean {
160 return opts['print-graph'] && !opts['print-deps'];

Callers 3

printUnmanagedDepGraphFunction · 0.90
sendAndParseResultsFunction · 0.90
assembleLocalPayloadsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected