Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof aSourceMap === 'string') {
sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
}
var version = util.getArg(sourceMap, 'version');
var sources = util.getArg(sourceMap, 'sources');
var names = util.getArg(sourceMap, 'names');
var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
var mappings = util.getArg(sourceMap, 'mappings');
var file = util.getArg(sourceMap, 'file');
if (version !== this._version) {
throw new Error('Unsupported version: ' + version);
}
this._names = ArraySet.fromArray(names);
this._sources = ArraySet.fromArray(sources);
this._sourceRoot = sourceRoot;
this.file = file;
// `this._generatedMappings` and `this._originalMappings` hold the parsed
// mapping coordinates from the source map's "mappings" attribute. Each
// object in the array is of the form
//
// {
// generatedLine: The line number in the generated code,
// generatedColumn: The column number in the generated code,
// source: The path to the original source file that generated this
// chunk of code,
// originalLine: The line number in the original source that
// corresponds to this chunk of generated code,
// originalColumn: The column number in the original source that
sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
}
var version = util.getArg(sourceMap, 'version');
var sources = util.getArg(sourceMap, 'sources');
var names = util.getArg(sourceMap, 'names');
var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
var mappings = util.getArg(sourceMap, 'mappings');
var file = util.getArg(sourceMap, 'file');
if (version !== this._version) {
throw new Error('Unsupported version: ' + version);
}
this._names = ArraySet.fromArray(names);
this._sources = ArraySet.fromArray(sources);
this._sourceRoot = sourceRoot;
this.file = file;
// `this._generatedMappings` and `this._originalMappings` hold the parsed
// mapping coordinates from the source map's "mappings" attribute. Each
// object in the array is of the form
//
// {
// generatedLine: The line number in the generated code,
// generatedColumn: The column number in the generated code,
// source: The path to the original source file that generated this
// chunk of code,
// originalLine: The line number in the original source that
// corresponds to this chunk of generated code,
// originalColumn: The column number in the original source that
// corresponds to this chunk of generated code,