sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::SourceMapUtils#make_index_map

Public: Converts source map to index map

Example:

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

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/source_map_utils.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--SourceMapUtils-make_index_map-for-pr


# Commit to git

git add lib/sprockets/source_map_utils.rbgit commit -m "better docs for Sprockets::SourceMapUtils#make_index_map"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Sprockets--SourceMapUtils-make_index_map-for-pr

hub pull-request


# Celebrate!