@ Override public void appendIndexMapTo ( Appendable out , String name , List < SourceMapSection > sections ) throws IOException { // Add the header fields. out . append ( "{\n" ) ; appendFirstField ( out , "version" , "3" ) ; appendField ( out , "file" , escapeString ( name ) ) ; // Add the line character maps. appendFieldStart ( out , "sections" ) ; out . append ( "[\n" ) ; boolean first = true ; for ( SourceMapSection section : sections ) { if ( first ) { first = false ; } else { out . append ( ",\n" ) ; } out . append ( "{\n" ) ; appendFieldStart ( out , "offset" , true ) ; appendOffsetValue ( out , section . getLine ( ) , section . getColumn ( ) ) ; if ( section . getSectionType ( ) == SourceMapSection . SectionType . URL ) { appendField ( out , "url" , escapeString ( section . getSectionValue ( ) ) ) ; } else if ( section . getSectionType ( ) == SourceMapSection . SectionType . MAP ) { appendField ( out , "map" , section . getSectionValue ( ) ) ; } else { throw new IOException ( "Unexpected section type" ) ; } out . append ( "\n}" ) ; } out . append ( "\n]" ) ; appendFieldEnd ( out ) ; out . append ( "\n}\n" ) ; }
Appends the index source map to the given buffer .