diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/merge-source-map | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
download | wallet-core-bbff7403fbf46f9ad92240ac213df8d30ef31b64.tar.xz |
update packages
Diffstat (limited to 'node_modules/merge-source-map')
-rw-r--r-- | node_modules/merge-source-map/README.md | 1 | ||||
-rw-r--r-- | node_modules/merge-source-map/index.js | 38 | ||||
-rw-r--r-- | node_modules/merge-source-map/package.json | 4 |
3 files changed, 24 insertions, 19 deletions
diff --git a/node_modules/merge-source-map/README.md b/node_modules/merge-source-map/README.md index 26d677631..a8fa80227 100644 --- a/node_modules/merge-source-map/README.md +++ b/node_modules/merge-source-map/README.md @@ -1,6 +1,7 @@ # merge-source-map [![npm-version](https://img.shields.io/npm/v/merge-source-map.svg?style=flat-square)](https://npmjs.org/package/merge-source-map) +[![downloads](http://img.shields.io/npm/dm/merge-source-map.svg?style=flat-square)](https://npmjs.org/package/merge-source-map) [![travis-ci](https://img.shields.io/travis/keik/merge-source-map.svg?style=flat-square)](https://travis-ci.org/keik/merge-source-map) [![Coverage Status](https://img.shields.io/coveralls/keik/merge-source-map.svg?style=flat-square)](https://coveralls.io/github/keik/merge-source-map) diff --git a/node_modules/merge-source-map/index.js b/node_modules/merge-source-map/index.js index ef208d99c..2867fb7f5 100644 --- a/node_modules/merge-source-map/index.js +++ b/node_modules/merge-source-map/index.js @@ -13,11 +13,8 @@ module.exports = merge * @return {object|undefined} merged source map object, or undefined when both old and new source map are undefined */ function merge(oldMap, newMap) { - - if (!oldMap) - return newMap - if (!newMap) - return oldMap + if (!oldMap) return newMap + if (!newMap) return oldMap var oldMapConsumer = new SourceMapConsumer(oldMap) var newMapConsumer = new SourceMapConsumer(newMap) @@ -25,15 +22,16 @@ function merge(oldMap, newMap) { // iterate on new map and overwrite original position of new map with one of old map newMapConsumer.eachMapping(function(m) { - // pass when `originalLine` is null. // It occurs in case that the node does not have origin in original code. - if (m.originalLine == null) - return + if (m.originalLine == null) return + + var origPosInOldMap = oldMapConsumer.originalPositionFor({ + line: m.originalLine, + column: m.originalColumn + }) - var origPosInOldMap = oldMapConsumer.originalPositionFor({line: m.originalLine, column: m.originalColumn}) - if (origPosInOldMap.source == null) - return + if (origPosInOldMap.source == null) return mergedMapGenerator.addMapping({ original: { @@ -49,13 +47,19 @@ function merge(oldMap, newMap) { }) }) - var mergedMap = JSON.parse(mergedMapGenerator.toString()) - - mergedMap.sourcesContent = mergedMap.sources.map(function (source) { - return oldMapConsumer.sourceContentFor(source) + var consumers = [oldMapConsumer, newMapConsumer] + consumers.forEach(function(consumer) { + consumer.sources.forEach(function(sourceFile) { + mergedMapGenerator._sources.add(sourceFile) + var sourceContent = consumer.sourceContentFor(sourceFile) + if (sourceContent != null) { + mergedMapGenerator.setSourceContent(sourceFile, sourceContent) + } + }) }) - mergedMap.sourceRoot = oldMap.sourceRoot + mergedMapGenerator._sourceRoot = oldMap.sourceRoot + mergedMapGenerator._file = oldMap.file - return mergedMap + return JSON.parse(mergedMapGenerator.toString()) } diff --git a/node_modules/merge-source-map/package.json b/node_modules/merge-source-map/package.json index f57259ff1..167150558 100644 --- a/node_modules/merge-source-map/package.json +++ b/node_modules/merge-source-map/package.json @@ -1,6 +1,6 @@ { "name": "merge-source-map", - "version": "1.0.4", + "version": "1.1.0", "description": "Merge old source map and new source map in multi-transform flow", "main": "index.js", "scripts": { @@ -22,7 +22,7 @@ "source-map" ], "dependencies": { - "source-map": "^0.5.6" + "source-map": "^0.6.1" }, "devDependencies": { "babel-core": "^6.25.0", |