File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as Sarif from 'sarif' ;
22import * as fs from 'fs-extra' ;
3- import Assembler = require ( 'stream-json/Assembler' ) ;
3+ import { connectTo } from 'stream-json/Assembler' ;
44import { getErrorMessage } from './pure/helpers-pure' ;
5- import Pick = require ( 'stream-json/filters/Pick' ) ;
5+ import { withParser } from 'stream-json/filters/Pick' ;
66
77const DUMMY_TOOL : Sarif . Tool = { driver : { name : '' } } ;
88
99export async function sarifParser ( interpretedResultsPath : string ) : Promise < Sarif . Log > {
1010 try {
1111 // Parse the SARIF file into token streams, filtering out only the results array.
12- const pipeline = fs . createReadStream ( interpretedResultsPath ) . pipe ( Pick . withParser ( { filter : 'runs.0.results' } ) ) ;
12+ const pipeline = fs . createReadStream ( interpretedResultsPath ) . pipe ( withParser ( { filter : 'runs.0.results' } ) ) ;
1313
1414 // Creates JavaScript objects from the token stream
15- const asm = Assembler . connectTo ( pipeline ) ;
15+ const asm = connectTo ( pipeline ) ;
1616
1717 // Returns a constructed Log object with the results of an empty array if no results were found.
1818 // If the parser fails for any reason, it will reject the promise.
You can’t perform that action at this time.
0 commit comments