add decode fn

pull/7/head
yann300 7 years ago
parent f05d3bc043
commit d46b09ac32
  1. 17
      src/util/sourceMappingDecoder.js

@ -18,6 +18,23 @@ function SourceMappingDecoder () {
*/
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
*

Loading…
Cancel
Save