JS::SourceMap::Decoder - Decoder for JS source maps
use JS::SourceMap::Decoder; JS::SourceMap::Decoder->new->decode($sourcemap_string);
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.
die
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.
undef
warn
JS::SourceMap::Index, JS::SourceMap::Token
attila <attila@stalphonsos.com>
ISC/BSD c.f. LICENSE in the source distribution.
To install JS::SourceMap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JS::SourceMap
CPAN shell
perl -MCPAN -e shell install JS::SourceMap
For more information on module installation, please visit the detailed CPAN module installation guide.