refactor: init cypress-cucumber-preprocessor install.

This commit is contained in:
2021-09-02 17:02:45 +02:00
parent 89ec2d42ac
commit 1aa57bbd0a
5000 changed files with 408119 additions and 231 deletions

View File

@@ -0,0 +1,30 @@
var SMConsumer = require('source-map').SourceMapConsumer;
/**
* @name mappingsFromMap
* @function
* @param map {Object} the JSON.parse()'ed map
* @return {Array} array of mappings
*/
module.exports = function (map) {
var consumer = new SMConsumer(map);
var mappings = [];
consumer.eachMapping(function (mapping) {
// only set source if we have original position to handle edgecase (see inline-source-map tests)
mappings.push({
original: mapping.originalColumn != null ? {
column: mapping.originalColumn
, line: mapping.originalLine
} : undefined
, generated: {
column: mapping.generatedColumn
, line: mapping.generatedLine
}
, source: mapping.originalColumn != null ? mapping.source : undefined
, name: mapping.name
});
});
return mappings;
}