import { Emitter , Create } from './emitter' ; import { Vertex , Edge } from 'lsif-protocol' ; import { Writer } from '../common/writer' ; export const create = ( writer ) : Emitter => { let isFirst = true ; return { start : ( ) => { writer . writeln ( '[' ) ; } , emit : ( element ) => { if ( ! isFirst ) { writer . writeln ( ',' ) ; } writer . write ( '\t' , JSON . stringify ( element , undefined , 0 ) ) ; isFirst = false ; } , flush : ( ) => { return writer . flush ( ) ; } , end : ( ) => { if ( ! isFirst ) { writer . writeEOL ( ) ; } writer . writeln ( ']' ) ; return writer . close ( ) ; } } ; } ;