module Sprockets::SourceMapUtils

def make_index_map(map)

}
]
}
}
"names" => [..]
"sources" => [..],
"mappings" => "AAAA;AACA;..;AACA",
"file" => "..",
"version" => 3,
"map" => {
"offset" => { "line" => 0, "column" => 0 },
{
"sections" => [
"file" => "..",
"version" => 3,
# => {
make_index_map(map)
}
"names" => [..]
"sources" => [..],
"mappings" => "AAAA;AACA;..;AACA",
"file" => "..",
"version" => 3,
# => {
map

Example:

Public: Converts source map to index map
def make_index_map(map)
  return map if map.key? "sections"
  {
    "version"  => map["version"],
    "file"     => map["file"],
    "sections" => [
      {
        "offset" => { "line" => 0, "column" => 0 },
        "map"    => map
      }
    ]
  }
end