Commit d46b09ac authored by yann300's avatar yann300

add decode fn

parent f05d3bc0
...@@ -19,6 +19,23 @@ function SourceMappingDecoder () { ...@@ -19,6 +19,23 @@ function SourceMappingDecoder () {
SourceMappingDecoder.prototype.atIndex = atIndex SourceMappingDecoder.prototype.atIndex = atIndex
/** /**
* Decode the given @arg value
*
* @param {string} value - source location to decode ( should be start:length:file )
* @return {Object} returns the decompressed source mapping {start, length, file}
*/
SourceMappingDecoder.prototype.decode = function (value) {
if (value) {
value = value.split(':')
return {
start: parseInt(value[0]),
length: parseInt(value[1]),
file: parseInt(value[2])
}
}
}
/**
* Decode the source mapping for the given compressed mapping * Decode the source mapping for the given compressed mapping
* *
* @param {String} mapping - compressed source mapping given by solc-bin * @param {String} mapping - compressed source mapping given by solc-bin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment