def concat_source_maps(a, b)
      return a || b unless a && b
      a = make_index_map(a)
      b = make_index_map(b)

      offset = 0
      if a["sections"].count != 0 && !a["sections"].last["map"]["mappings"].empty?
        last_line_count = a["sections"].last["map"].delete("x_sprockets_linecount")
        offset += last_line_count

        last_offset = a["sections"].last["offset"]["line"]
        offset += last_offset
      end

      a["sections"] += b["sections"].map do |section|
        {
          "offset" => section["offset"].merge({ "line" => section["offset"]["line"] + offset }),
          "map"    => section["map"].merge({
            "sources" => section["map"]["sources"].map do |source|
              PathUtils.relative_path_from(a["file"], PathUtils.join(File.dirname(b["file"]), source))
            end
          })
        }
      end
      a
    end
def concat_source_maps(a, b)
      return a || b unless a && b
      a = make_index_map(a)
      b = make_index_map(b)

      offset = 0
      if a["sections"].count != 0 && !a["sections"].last["map"]["mappings"].empty?
        last_line_count = a["sections"].last["map"].delete("x_sprockets_linecount")
        offset += last_line_count

        last_offset = a["sections"].last["offset"]["line"]
        offset += last_offset
      end

      a["sections"] += b["sections"].map do |section|
        {
          "offset" => section["offset"].merge({ "line" => section["offset"]["line"] + offset }),
          "map"    => section["map"].merge({
            "sources" => section["map"]["sources"].map do |source|
              PathUtils.relative_path_from(a["file"], PathUtils.join(File.dirname(b["file"]), source))
            end
          })
        }
      end
      a
    end
Public: Concatenate two source maps.

 For an example, if two js scripts are concatenated, the individual source
 maps for those files can be concatenated to map back to the originals.

 Examples

     script3 = "#{script1}#{script2}"
     map3    = concat_source_maps(map1, map2)

 a - Source map hash
 b - Source map hash

 Returns a new source map hash.