The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

JS::SourceMap::Decoder - Decoder for JS source maps

SYNOPSIS

  use JS::SourceMap::Decoder;
  JS::SourceMap::Decoder->new->decode($sourcemap_string);

DESCRIPTION

  • new [ %options ]

    Construct a decoder instance. Options:

    • json_options => $options_as_arrayref

      Specify an array of options to pass to the JSON constructor when parsing JSON. We use the JSON defaults unless this option is given.

    • assertions => 0|1

      If turned on this option will force every token parsed to pass a series of assertions which will die if failed. Useful for testing, defaults to off.

  • decode $string

    Parse a sourcemap and return a JS::SourceMap::Index instance that can be used to query the data it contains.

    Returns undef if the decoding failed for any reason; in this case at least one call to warn will have been made with more information about why. Otherwise returns a JS::SourceMap::Index instance.

SEE ALSO

JS::SourceMap::Index, JS::SourceMap::Token

AUTHOR

attila <attila@stalphonsos.com>

LICENSE

ISC/BSD c.f. LICENSE in the source distribution.