diff --git a/src/util/sourceMappingDecoder.js b/src/util/sourceMappingDecoder.js index 39ea602a7a..eb1154499d 100644 --- a/src/util/sourceMappingDecoder.js +++ b/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 *