module Sprockets::SourceMapUtils

def encode_source_map(map)

Returns a compressed source map hash according to source map spec v3

map - Source map hash (uncompressed)

}
"names" => [..]
"sources" => [..],
"mappings" => "AAAA;AACA;..;AACA",
"file" => "..",
"version" => 3,
# => {
encode_source_map(map)

Example:

Public: Compress source map
def encode_source_map(map)
  return nil unless map
  {
    "version"  => map[:version],
    "file"     => map[:file],
    "mappings" => encode_vlq_mappings(map[:mappings], sources: map[:sources], names: map[:names]),
    "sources"  => map[:sources],
    "names"    => map[:names]
  }
end