module Sprockets::SourceMapUtils

def combine_source_maps(first, second)

Returns a source map hash.

minified output can be traced back to the original CoffeeScript file.
map can be combined with the Uglifier map so the source lines of the
Uglifier processes the result and produces another map. The CoffeeScript
For an example, CoffeeScript may transform a file producing a map. Then

the source.
source maps. These steps can be combined into a single mapping back to
Source transformations may happen in discrete steps producing separate

mapping.
Public: Combine two separate source map transformations into a single
def combine_source_maps(first, second)
  return second unless first
  _first  = decode_source_map(first)
  _second = decode_source_map(second)
  new_mappings = []
  _second[:mappings].each do |m|
    first_line = bsearch_mappings(_first[:mappings], m[:original])
    new_mappings << first_line.merge(generated: m[:generated]) if first_line
  end
  _first[:mappings] = new_mappings
  encode_source_map(_first)
end