sorcery
Advanced tools
Comparing version 0.8.0 to 0.9.0
@@ -8,8 +8,2 @@ 'use strict'; | ||
var babelHelpers_classCallCheck = function (instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
}; | ||
var charToInteger = {}; | ||
@@ -217,2 +211,3 @@ var integerToChar = {}; | ||
var cache = {}; | ||
function decodeMappings(mappings) { | ||
@@ -239,6 +234,6 @@ var checksum = crc32(mappings); | ||
// this for an actual sourceMappingURL | ||
var SOURCEMAPPING_URL$1 = 'sourceMa'; | ||
SOURCEMAPPING_URL$1 += 'ppingURL'; | ||
var SOURCEMAPPING_URL$2 = 'sourceMa'; | ||
SOURCEMAPPING_URL$2 += 'ppingURL'; | ||
var SOURCEMAPPING_URL$2 = SOURCEMAPPING_URL$1; | ||
var SOURCEMAPPING_URL$3 = SOURCEMAPPING_URL$2; | ||
@@ -261,3 +256,3 @@ /** | ||
if (!match) { | ||
throw new Error(SOURCEMAPPING_URL$2 + ' is not base64-encoded'); | ||
throw new Error(SOURCEMAPPING_URL$3 + ' is not base64-encoded'); | ||
} | ||
@@ -283,3 +278,3 @@ | ||
// assume we want the last occurence | ||
index = str.lastIndexOf(SOURCEMAPPING_URL$2 + '='); | ||
index = str.lastIndexOf(SOURCEMAPPING_URL$3 + '='); | ||
@@ -320,31 +315,30 @@ if (index === -1) { | ||
var Node = (function () { | ||
function Node(_ref) { | ||
var file = _ref.file; | ||
var content = _ref.content; | ||
babelHelpers_classCallCheck(this, Node); | ||
function Node(_ref) { | ||
var file = _ref.file; | ||
var content = _ref.content; | ||
this.file = file ? path.resolve(file) : null; | ||
this.content = content || null; // sometimes exists in sourcesContent, sometimes doesn't | ||
this.file = file ? path.resolve(file) : null; | ||
this.content = content || null; // sometimes exists in sourcesContent, sometimes doesn't | ||
if (!this.file && this.content === null) { | ||
throw new Error('A source must specify either file or content'); | ||
} | ||
if (!this.file && this.content === null) { | ||
throw new Error('A source must specify either file or content'); | ||
} | ||
// these get filled in later | ||
this.map = null; | ||
this.mappings = null; | ||
this.sources = null; | ||
this.isOriginalSource = null; | ||
// these get filled in later | ||
this.map = null; | ||
this.mappings = null; | ||
this.sources = null; | ||
this.isOriginalSource = null; | ||
this._stats = { | ||
decodingTime: 0, | ||
encodingTime: 0, | ||
tracingTime: 0, | ||
this._stats = { | ||
decodingTime: 0, | ||
encodingTime: 0, | ||
tracingTime: 0, | ||
untraceable: 0 | ||
}; | ||
} | ||
untraceable: 0 | ||
}; | ||
} | ||
Node.prototype.load = function load(sourcesContentByPath, sourceMapByPath) { | ||
Node.prototype = { | ||
load: function load(sourcesContentByPath, sourceMapByPath) { | ||
var _this = this; | ||
@@ -382,5 +376,4 @@ | ||
}); | ||
}; | ||
Node.prototype.loadSync = function loadSync(sourcesContentByPath, sourceMapByPath) { | ||
}, | ||
loadSync: function loadSync(sourcesContentByPath, sourceMapByPath) { | ||
var _this2 = this; | ||
@@ -421,3 +414,3 @@ | ||
} | ||
}; | ||
}, | ||
@@ -439,4 +432,3 @@ /** | ||
*/ | ||
Node.prototype.trace = function trace(lineIndex, columnIndex, name) { | ||
trace: function trace(lineIndex, columnIndex, name) { | ||
// If this node doesn't have a source map, we have | ||
@@ -493,7 +485,5 @@ // to assume it is the original source | ||
return parent.trace(sourceCodeLine, null, this.map.names[nameIndex] || name); | ||
}; | ||
} | ||
}; | ||
return Node; | ||
})(); | ||
function getContent(node, sourcesContentByPath) { | ||
@@ -511,2 +501,9 @@ if (node.file in sourcesContentByPath) { | ||
// this looks ridiculous, but it prevents sourcemap tooling from mistaking | ||
// this for an actual sourceMappingURL | ||
var SOURCEMAPPING_URL = 'sourceMa'; | ||
SOURCEMAPPING_URL += 'ppingURL'; | ||
var SOURCEMAPPING_URL$1 = SOURCEMAPPING_URL; | ||
/** | ||
@@ -521,26 +518,21 @@ * Encodes a string as base64 | ||
var SourceMap = (function () { | ||
function SourceMap(properties) { | ||
babelHelpers_classCallCheck(this, SourceMap); | ||
function SourceMap(properties) { | ||
this.version = 3; | ||
this.version = 3; | ||
this.file = properties.file; | ||
this.sources = properties.sources; | ||
this.sourcesContent = properties.sourcesContent; | ||
this.names = properties.names; | ||
this.mappings = properties.mappings; | ||
} | ||
this.file = properties.file; | ||
this.sources = properties.sources; | ||
this.sourcesContent = properties.sourcesContent; | ||
this.names = properties.names; | ||
this.mappings = properties.mappings; | ||
} | ||
SourceMap.prototype.toString = function toString() { | ||
SourceMap.prototype = { | ||
toString: function toString() { | ||
return JSON.stringify(this); | ||
}; | ||
SourceMap.prototype.toUrl = function toUrl() { | ||
}, | ||
toUrl: function toUrl() { | ||
return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); | ||
}; | ||
} | ||
}; | ||
return SourceMap; | ||
})(); | ||
function slash(path) { | ||
@@ -550,20 +542,15 @@ return typeof path === 'string' ? path.replace(/\\/g, '/') : path; | ||
var SOURCEMAPPING_URL = 'sourceMa'; | ||
SOURCEMAPPING_URL += 'ppingURL'; | ||
var SOURCEMAP_COMMENT = new RegExp('\n*(?:' + ('\\/\\/[@#]\\s*' + SOURCEMAPPING_URL + '=([^\'"]+)|') + ( // js | ||
'\\/\\*#?\\s*' + SOURCEMAPPING_URL + '=([^\'"]+)\\s\\*\\/)') + // css | ||
var SOURCEMAP_COMMENT = new RegExp('\n*(?:' + ('\\/\\/[@#]\\s*' + SOURCEMAPPING_URL$1 + '=([^\'"]+)|') + ( // js | ||
'\\/\\*#?\\s*' + SOURCEMAPPING_URL$1 + '=([^\'"]+)\\s\\*\\/)') + // css | ||
'\\s*$', 'g'); | ||
var Chain = (function () { | ||
function Chain(node, sourcesContentByPath) { | ||
babelHelpers_classCallCheck(this, Chain); | ||
function Chain(node, sourcesContentByPath) { | ||
this.node = node; | ||
this.sourcesContentByPath = sourcesContentByPath; | ||
this.node = node; | ||
this.sourcesContentByPath = sourcesContentByPath; | ||
this._stats = {}; | ||
} | ||
this._stats = {}; | ||
} | ||
Chain.prototype.stat = function stat() { | ||
Chain.prototype = { | ||
stat: function stat() { | ||
return { | ||
@@ -578,5 +565,4 @@ selfDecodingTime: this._stats.decodingTime / 1e6, | ||
}; | ||
}; | ||
Chain.prototype.apply = function apply() { | ||
}, | ||
apply: function apply() { | ||
var _this = this; | ||
@@ -589,3 +575,3 @@ | ||
var applySegment = function (segment, result) { | ||
var applySegment = function applySegment(segment, result) { | ||
if (segment.length < 4) return; | ||
@@ -666,9 +652,7 @@ | ||
}); | ||
}; | ||
Chain.prototype.trace = function trace(oneBasedLineIndex, zeroBasedColumnIndex) { | ||
}, | ||
trace: function trace(oneBasedLineIndex, zeroBasedColumnIndex) { | ||
return this.node.trace(oneBasedLineIndex - 1, zeroBasedColumnIndex, null); | ||
}; | ||
Chain.prototype.write = function write(dest, options) { | ||
}, | ||
write: function write(dest, options) { | ||
if (typeof dest !== 'string') { | ||
@@ -694,5 +678,4 @@ options = dest; | ||
return Promise.all(promises); | ||
}; | ||
Chain.prototype.writeSync = function writeSync(dest, options) { | ||
}, | ||
writeSync: function writeSync(dest, options) { | ||
if (typeof dest !== 'string') { | ||
@@ -716,7 +699,5 @@ options = dest; | ||
} | ||
}; | ||
} | ||
}; | ||
return Chain; | ||
})(); | ||
function processWriteOptions(dest, chain, options) { | ||
@@ -749,6 +730,6 @@ var resolved = path.resolve(dest); | ||
if (ext === '.css') { | ||
return '\n/*# ' + SOURCEMAPPING_URL + '=' + url + ' */\n'; | ||
return '\n/*# ' + SOURCEMAPPING_URL$1 + '=' + url + ' */\n'; | ||
} | ||
return '\n//# ' + SOURCEMAPPING_URL + '=' + url + '\n'; | ||
return '\n//# ' + SOURCEMAPPING_URL$1 + '=' + url + '\n'; | ||
} | ||
@@ -805,3 +786,2 @@ | ||
exports.load = load; | ||
exports.loadSync = loadSync; | ||
//# sourceMappingURL=sorcery.cjs.js.map | ||
exports.loadSync = loadSync; |
@@ -5,8 +5,2 @@ import { resolve, dirname, relative, basename, extname } from 'path'; | ||
var babelHelpers_classCallCheck = function (instance, Constructor) { | ||
if (!(instance instanceof Constructor)) { | ||
throw new TypeError("Cannot call a class as a function"); | ||
} | ||
}; | ||
var charToInteger = {}; | ||
@@ -214,2 +208,3 @@ var integerToChar = {}; | ||
var cache = {}; | ||
function decodeMappings(mappings) { | ||
@@ -236,6 +231,6 @@ var checksum = crc32(mappings); | ||
// this for an actual sourceMappingURL | ||
var SOURCEMAPPING_URL$1 = 'sourceMa'; | ||
SOURCEMAPPING_URL$1 += 'ppingURL'; | ||
var SOURCEMAPPING_URL$2 = 'sourceMa'; | ||
SOURCEMAPPING_URL$2 += 'ppingURL'; | ||
var SOURCEMAPPING_URL$2 = SOURCEMAPPING_URL$1; | ||
var SOURCEMAPPING_URL$3 = SOURCEMAPPING_URL$2; | ||
@@ -258,3 +253,3 @@ /** | ||
if (!match) { | ||
throw new Error(SOURCEMAPPING_URL$2 + ' is not base64-encoded'); | ||
throw new Error(SOURCEMAPPING_URL$3 + ' is not base64-encoded'); | ||
} | ||
@@ -280,3 +275,3 @@ | ||
// assume we want the last occurence | ||
index = str.lastIndexOf(SOURCEMAPPING_URL$2 + '='); | ||
index = str.lastIndexOf(SOURCEMAPPING_URL$3 + '='); | ||
@@ -317,31 +312,30 @@ if (index === -1) { | ||
var Node = (function () { | ||
function Node(_ref) { | ||
var file = _ref.file; | ||
var content = _ref.content; | ||
babelHelpers_classCallCheck(this, Node); | ||
function Node(_ref) { | ||
var file = _ref.file; | ||
var content = _ref.content; | ||
this.file = file ? resolve(file) : null; | ||
this.content = content || null; // sometimes exists in sourcesContent, sometimes doesn't | ||
this.file = file ? resolve(file) : null; | ||
this.content = content || null; // sometimes exists in sourcesContent, sometimes doesn't | ||
if (!this.file && this.content === null) { | ||
throw new Error('A source must specify either file or content'); | ||
} | ||
if (!this.file && this.content === null) { | ||
throw new Error('A source must specify either file or content'); | ||
} | ||
// these get filled in later | ||
this.map = null; | ||
this.mappings = null; | ||
this.sources = null; | ||
this.isOriginalSource = null; | ||
// these get filled in later | ||
this.map = null; | ||
this.mappings = null; | ||
this.sources = null; | ||
this.isOriginalSource = null; | ||
this._stats = { | ||
decodingTime: 0, | ||
encodingTime: 0, | ||
tracingTime: 0, | ||
this._stats = { | ||
decodingTime: 0, | ||
encodingTime: 0, | ||
tracingTime: 0, | ||
untraceable: 0 | ||
}; | ||
} | ||
untraceable: 0 | ||
}; | ||
} | ||
Node.prototype.load = function load(sourcesContentByPath, sourceMapByPath) { | ||
Node.prototype = { | ||
load: function load(sourcesContentByPath, sourceMapByPath) { | ||
var _this = this; | ||
@@ -379,5 +373,4 @@ | ||
}); | ||
}; | ||
Node.prototype.loadSync = function loadSync(sourcesContentByPath, sourceMapByPath) { | ||
}, | ||
loadSync: function loadSync(sourcesContentByPath, sourceMapByPath) { | ||
var _this2 = this; | ||
@@ -418,3 +411,3 @@ | ||
} | ||
}; | ||
}, | ||
@@ -436,4 +429,3 @@ /** | ||
*/ | ||
Node.prototype.trace = function trace(lineIndex, columnIndex, name) { | ||
trace: function trace(lineIndex, columnIndex, name) { | ||
// If this node doesn't have a source map, we have | ||
@@ -490,7 +482,5 @@ // to assume it is the original source | ||
return parent.trace(sourceCodeLine, null, this.map.names[nameIndex] || name); | ||
}; | ||
} | ||
}; | ||
return Node; | ||
})(); | ||
function getContent(node, sourcesContentByPath) { | ||
@@ -508,2 +498,9 @@ if (node.file in sourcesContentByPath) { | ||
// this looks ridiculous, but it prevents sourcemap tooling from mistaking | ||
// this for an actual sourceMappingURL | ||
var SOURCEMAPPING_URL = 'sourceMa'; | ||
SOURCEMAPPING_URL += 'ppingURL'; | ||
var SOURCEMAPPING_URL$1 = SOURCEMAPPING_URL; | ||
/** | ||
@@ -518,26 +515,21 @@ * Encodes a string as base64 | ||
var SourceMap = (function () { | ||
function SourceMap(properties) { | ||
babelHelpers_classCallCheck(this, SourceMap); | ||
function SourceMap(properties) { | ||
this.version = 3; | ||
this.version = 3; | ||
this.file = properties.file; | ||
this.sources = properties.sources; | ||
this.sourcesContent = properties.sourcesContent; | ||
this.names = properties.names; | ||
this.mappings = properties.mappings; | ||
} | ||
this.file = properties.file; | ||
this.sources = properties.sources; | ||
this.sourcesContent = properties.sourcesContent; | ||
this.names = properties.names; | ||
this.mappings = properties.mappings; | ||
} | ||
SourceMap.prototype.toString = function toString() { | ||
SourceMap.prototype = { | ||
toString: function toString() { | ||
return JSON.stringify(this); | ||
}; | ||
SourceMap.prototype.toUrl = function toUrl() { | ||
}, | ||
toUrl: function toUrl() { | ||
return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString()); | ||
}; | ||
} | ||
}; | ||
return SourceMap; | ||
})(); | ||
function slash(path) { | ||
@@ -547,20 +539,15 @@ return typeof path === 'string' ? path.replace(/\\/g, '/') : path; | ||
var SOURCEMAPPING_URL = 'sourceMa'; | ||
SOURCEMAPPING_URL += 'ppingURL'; | ||
var SOURCEMAP_COMMENT = new RegExp('\n*(?:' + ('\\/\\/[@#]\\s*' + SOURCEMAPPING_URL + '=([^\'"]+)|') + ( // js | ||
'\\/\\*#?\\s*' + SOURCEMAPPING_URL + '=([^\'"]+)\\s\\*\\/)') + // css | ||
var SOURCEMAP_COMMENT = new RegExp('\n*(?:' + ('\\/\\/[@#]\\s*' + SOURCEMAPPING_URL$1 + '=([^\'"]+)|') + ( // js | ||
'\\/\\*#?\\s*' + SOURCEMAPPING_URL$1 + '=([^\'"]+)\\s\\*\\/)') + // css | ||
'\\s*$', 'g'); | ||
var Chain = (function () { | ||
function Chain(node, sourcesContentByPath) { | ||
babelHelpers_classCallCheck(this, Chain); | ||
function Chain(node, sourcesContentByPath) { | ||
this.node = node; | ||
this.sourcesContentByPath = sourcesContentByPath; | ||
this.node = node; | ||
this.sourcesContentByPath = sourcesContentByPath; | ||
this._stats = {}; | ||
} | ||
this._stats = {}; | ||
} | ||
Chain.prototype.stat = function stat() { | ||
Chain.prototype = { | ||
stat: function stat() { | ||
return { | ||
@@ -575,5 +562,4 @@ selfDecodingTime: this._stats.decodingTime / 1e6, | ||
}; | ||
}; | ||
Chain.prototype.apply = function apply() { | ||
}, | ||
apply: function apply() { | ||
var _this = this; | ||
@@ -586,3 +572,3 @@ | ||
var applySegment = function (segment, result) { | ||
var applySegment = function applySegment(segment, result) { | ||
if (segment.length < 4) return; | ||
@@ -663,9 +649,7 @@ | ||
}); | ||
}; | ||
Chain.prototype.trace = function trace(oneBasedLineIndex, zeroBasedColumnIndex) { | ||
}, | ||
trace: function trace(oneBasedLineIndex, zeroBasedColumnIndex) { | ||
return this.node.trace(oneBasedLineIndex - 1, zeroBasedColumnIndex, null); | ||
}; | ||
Chain.prototype.write = function write(dest, options) { | ||
}, | ||
write: function write(dest, options) { | ||
if (typeof dest !== 'string') { | ||
@@ -691,5 +675,4 @@ options = dest; | ||
return Promise.all(promises); | ||
}; | ||
Chain.prototype.writeSync = function writeSync(dest, options) { | ||
}, | ||
writeSync: function writeSync(dest, options) { | ||
if (typeof dest !== 'string') { | ||
@@ -713,7 +696,5 @@ options = dest; | ||
} | ||
}; | ||
} | ||
}; | ||
return Chain; | ||
})(); | ||
function processWriteOptions(dest, chain, options) { | ||
@@ -746,6 +727,6 @@ var resolved = resolve(dest); | ||
if (ext === '.css') { | ||
return '\n/*# ' + SOURCEMAPPING_URL + '=' + url + ' */\n'; | ||
return '\n/*# ' + SOURCEMAPPING_URL$1 + '=' + url + ' */\n'; | ||
} | ||
return '\n//# ' + SOURCEMAPPING_URL + '=' + url + '\n'; | ||
return '\n//# ' + SOURCEMAPPING_URL$1 + '=' + url + '\n'; | ||
} | ||
@@ -801,3 +782,2 @@ | ||
export { load, loadSync }; | ||
//# sourceMappingURL=sorcery.es6.js.map | ||
export { load, loadSync }; |
{ | ||
"name": "sorcery", | ||
"description": "Resolve a chain of sourcemaps back to the original source", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"author": "Rich Harris", | ||
@@ -13,15 +13,9 @@ "repository": "https://github.com/Rich-Harris/sorcery", | ||
"minimist": "^1.1.0", | ||
"sander": "^0.3.8", | ||
"sourcemap-codec": "^1.2.0" | ||
"sander": "^0.3.8" | ||
}, | ||
"devDependencies": { | ||
"babel": "^5.1.10", | ||
"browserify": "^11.2.0", | ||
"babel-preset-es2015-rollup": "^1.0.0", | ||
"codecov.io": "^0.1.6", | ||
"coffee-script": "^1.10.0", | ||
"eslint": "^1.7.1", | ||
"esperanto": "^0.7.5", | ||
"gobble": "^0.10.1", | ||
"gobble-cli": "^0.6.0", | ||
"gobble-rollup-babel": "^0.6.1", | ||
"istanbul": "^0.4.0", | ||
@@ -31,4 +25,9 @@ "less": "^2.5.3", | ||
"promise-map-series": "^0.2.1", | ||
"remap-istanbul": "^0.3.0", | ||
"remap-istanbul": "^0.4.0", | ||
"rollup": "^0.21.2", | ||
"rollup-plugin-babel": "^2.2.0", | ||
"rollup-plugin-commonjs": "^1.4.0", | ||
"rollup-plugin-npm": "^1.1.0", | ||
"source-map": "^0.5.1", | ||
"sourcemap-codec": "^1.2.0", | ||
"source-map-support": "^0.3.2", | ||
@@ -41,3 +40,3 @@ "uglify-js": "^2.4.20" | ||
"scripts": { | ||
"build": "gobble build -f dist", | ||
"build": "rollup -c -f cjs -o dist/sorcery.cjs.js && rollup -c -f es6 -o dist/sorcery.es6.js", | ||
"pretest": "npm run build", | ||
@@ -44,0 +43,0 @@ "prepare-tests": "node test/samples/prepare-tests.js", |
import { basename, dirname, extname, relative, resolve } from 'path'; | ||
import { writeFile, writeFileSync } from 'sander'; | ||
import { encode } from 'sourcemap-codec'; | ||
import SourceMap from './SourceMap'; | ||
import slash from './utils/slash'; | ||
import SourceMap from './SourceMap.js'; | ||
import slash from './utils/slash.js'; | ||
import SOURCEMAPPING_URL from './utils/sourceMappingUrl.js'; | ||
let SOURCEMAPPING_URL = 'sourceMa'; | ||
SOURCEMAPPING_URL += 'ppingURL'; | ||
const SOURCEMAP_COMMENT = new RegExp( `\n*(?:` + | ||
@@ -15,10 +13,10 @@ `\\/\\/[@#]\\s*${SOURCEMAPPING_URL}=([^'"]+)|` + // js | ||
export default class Chain { | ||
constructor ( node, sourcesContentByPath ) { | ||
this.node = node; | ||
this.sourcesContentByPath = sourcesContentByPath; | ||
export default function Chain ( node, sourcesContentByPath ) { | ||
this.node = node; | ||
this.sourcesContentByPath = sourcesContentByPath; | ||
this._stats = {}; | ||
} | ||
this._stats = {}; | ||
} | ||
Chain.prototype = { | ||
stat () { | ||
@@ -34,3 +32,3 @@ return { | ||
}; | ||
} | ||
}, | ||
@@ -116,7 +114,7 @@ apply ( options = {} ) { | ||
}); | ||
} | ||
}, | ||
trace ( oneBasedLineIndex, zeroBasedColumnIndex ) { | ||
return this.node.trace( oneBasedLineIndex - 1, zeroBasedColumnIndex, null ); | ||
} | ||
}, | ||
@@ -140,3 +138,3 @@ write ( dest, options ) { | ||
return Promise.all( promises ); | ||
} | ||
}, | ||
@@ -159,3 +157,3 @@ writeSync ( dest, options ) { | ||
} | ||
} | ||
}; | ||
@@ -162,0 +160,0 @@ function processWriteOptions ( dest, chain, options ) { |
import { resolve } from 'path'; | ||
import Node from './Node'; | ||
import Chain from './Chain'; | ||
import Node from './Node.js'; | ||
import Chain from './Chain.js'; | ||
@@ -5,0 +5,0 @@ export function load ( file, options ) { |
import { dirname, resolve } from 'path'; | ||
import { readFile, readFileSync, Promise } from 'sander'; | ||
import decodeMappings from './utils/decodeMappings'; | ||
import getMap from './utils/getMap'; | ||
import decodeMappings from './utils/decodeMappings.js'; | ||
import getMap from './utils/getMap.js'; | ||
export default class Node { | ||
constructor ({ file, content }) { | ||
this.file = file ? resolve( file ) : null; | ||
this.content = content || null; // sometimes exists in sourcesContent, sometimes doesn't | ||
export default function Node ({ file, content }) { | ||
this.file = file ? resolve( file ) : null; | ||
this.content = content || null; // sometimes exists in sourcesContent, sometimes doesn't | ||
if ( !this.file && this.content === null ) { | ||
throw new Error( 'A source must specify either file or content' ); | ||
} | ||
if ( !this.file && this.content === null ) { | ||
throw new Error( 'A source must specify either file or content' ); | ||
} | ||
// these get filled in later | ||
this.map = null; | ||
this.mappings = null; | ||
this.sources = null; | ||
this.isOriginalSource = null; | ||
// these get filled in later | ||
this.map = null; | ||
this.mappings = null; | ||
this.sources = null; | ||
this.isOriginalSource = null; | ||
this._stats = { | ||
decodingTime: 0, | ||
encodingTime: 0, | ||
tracingTime: 0, | ||
this._stats = { | ||
decodingTime: 0, | ||
encodingTime: 0, | ||
tracingTime: 0, | ||
untraceable: 0 | ||
}; | ||
} | ||
untraceable: 0 | ||
}; | ||
} | ||
Node.prototype = { | ||
load ( sourcesContentByPath, sourceMapByPath ) { | ||
@@ -59,3 +59,3 @@ return getContent( this, sourcesContentByPath ).then( content => { | ||
}); | ||
} | ||
}, | ||
@@ -94,3 +94,3 @@ loadSync ( sourcesContentByPath, sourceMapByPath ) { | ||
} | ||
} | ||
}, | ||
@@ -165,3 +165,3 @@ /** | ||
} | ||
} | ||
}; | ||
@@ -168,0 +168,0 @@ function getContent ( node, sourcesContentByPath ) { |
@@ -1,17 +0,17 @@ | ||
import btoa from './utils/btoa'; | ||
import btoa from './utils/btoa.js'; | ||
export default class SourceMap { | ||
constructor ( properties ) { | ||
this.version = 3; | ||
export default function SourceMap ( properties ) { | ||
this.version = 3; | ||
this.file = properties.file; | ||
this.sources = properties.sources; | ||
this.sourcesContent = properties.sourcesContent; | ||
this.names = properties.names; | ||
this.mappings = properties.mappings; | ||
} | ||
this.file = properties.file; | ||
this.sources = properties.sources; | ||
this.sourcesContent = properties.sourcesContent; | ||
this.names = properties.names; | ||
this.mappings = properties.mappings; | ||
} | ||
SourceMap.prototype = { | ||
toString () { | ||
return JSON.stringify( this ); | ||
} | ||
}, | ||
@@ -21,2 +21,2 @@ toUrl () { | ||
} | ||
} | ||
}; |
@@ -1,4 +0,4 @@ | ||
import getMapFromUrl from './getMapFromUrl'; | ||
import getSourceMappingUrl from './getSourceMappingUrl'; | ||
import { Promise } from 'sander'; | ||
import getMapFromUrl from './getMapFromUrl.js'; | ||
import getSourceMappingUrl from './getSourceMappingUrl.js'; | ||
@@ -21,2 +21,2 @@ export default function getMap ( node, sourceMapByPath, sync ) { | ||
} | ||
} | ||
} |
import { dirname, resolve } from 'path'; | ||
import { readFile, readFileSync, Promise } from 'sander'; | ||
import atob from './atob'; | ||
import SOURCEMAPPING_URL from './sourceMappingURL'; | ||
import atob from './atob.js'; | ||
import SOURCEMAPPING_URL from './sourceMappingURL.js'; | ||
@@ -6,0 +6,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import SOURCEMAPPING_URL from './sourceMappingURL'; | ||
import SOURCEMAPPING_URL from './sourceMappingURL.js'; | ||
@@ -3,0 +3,0 @@ export default function getSourceMappingUrl ( str ) { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
139829
3
22
0
1675
- Removedsourcemap-codec@^1.2.0
- Removedsourcemap-codec@1.4.8(transitive)