🔧 npm update

This commit is contained in:
2025-04-15 20:50:11 +02:00
parent ce5b9ac0c8
commit 94a90edabd
828 changed files with 256807 additions and 197099 deletions

View File

@@ -0,0 +1 @@
export { SourceMapConsumer } from '..';

View File

@@ -151,7 +151,9 @@ SourceMapConsumer.prototype.eachMapping =
for (var i = 0, n = mappings.length; i < n; i++) {
var mapping = mappings[i];
var source = mapping.source === null ? null : sources.at(mapping.source);
source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
if(source !== null) {
source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
}
boundCallback({
source: source,
generatedLine: mapping.generatedLine,
@@ -1066,7 +1068,7 @@ IndexedSourceMapConsumer.prototype.sourceContentFor =
var section = this._sections[i];
var content = section.consumer.sourceContentFor(aSource, true);
if (content) {
if (content || content === '') {
return content;
}
}
@@ -1142,7 +1144,9 @@ IndexedSourceMapConsumer.prototype._parseMappings =
var mapping = sectionMappings[j];
var source = section.consumer._sources.at(mapping.source);
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
if(source !== null) {
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
}
this._sources.add(source);
source = this._sources.indexOf(source);

View File

@@ -0,0 +1 @@
export { SourceMapGenerator } from '..';

View File

@@ -25,6 +25,7 @@ function SourceMapGenerator(aArgs) {
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = new MappingList();
@@ -39,12 +40,12 @@ SourceMapGenerator.prototype._version = 3;
* @param aSourceMapConsumer The SourceMap.
*/
SourceMapGenerator.fromSourceMap =
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator({
var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
});
}));
aSourceMapConsumer.eachMapping(function (mapping) {
var newMapping = {
generated: {
@@ -107,7 +108,9 @@ SourceMapGenerator.prototype.addMapping =
var name = util.getArg(aArgs, 'name', null);
if (!this._skipValidation) {
this._validateMapping(generated, original, source, name);
if (this._validateMapping(generated, original, source, name) === false) {
return;
}
}
if (source != null) {
@@ -273,11 +276,18 @@ SourceMapGenerator.prototype._validateMapping =
// specific error message to try to guide them the right way.
// For example: https://github.com/Polymer/polymer-bundler/pull/519
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
throw new Error(
'original.line and original.column are not numbers -- you probably meant to omit ' +
'the original mapping entirely and only map the generated position. If so, pass ' +
'null for the original mapping instead of an object with empty or null values.'
);
var message = 'original.line and original.column are not numbers -- you probably meant to omit ' +
'the original mapping entirely and only map the generated position. If so, pass ' +
'null for the original mapping instead of an object with empty or null values.'
if (this._ignoreInvalidMapping) {
if (typeof console !== 'undefined' && console.warn) {
console.warn(message);
}
return false;
} else {
throw new Error(message);
}
}
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
@@ -295,12 +305,21 @@ SourceMapGenerator.prototype._validateMapping =
return;
}
else {
throw new Error('Invalid mapping: ' + JSON.stringify({
var message = 'Invalid mapping: ' + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
}));
});
if (this._ignoreInvalidMapping) {
if (typeof console !== 'undefined' && console.warn) {
console.warn(message);
}
return false;
} else {
throw new Error(message)
}
}
};

1
node_modules/source-map-js/lib/source-node.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { SourceNode } from '..';