Socket
Socket
Sign inDemoInstall

source-map-js

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.1.0

35

lib/source-map-generator.js

@@ -28,2 +28,3 @@ /* -*- Mode: js; js-indent-level: 2; -*- */

this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);
this._sources = new ArraySet();

@@ -111,3 +112,5 @@ this._names = new ArraySet();

if (!this._skipValidation) {
this._validateMapping(generated, original, source, name);
if (this._validateMapping(generated, original, source, name) === false) {
return;
}
}

@@ -278,7 +281,14 @@

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);
}
}

@@ -301,3 +311,3 @@

else {
throw new Error('Invalid mapping: ' + JSON.stringify({
var message = 'Invalid mapping: ' + JSON.stringify({
generated: aGenerated,

@@ -307,3 +317,12 @@ source: aSource,

name: aName
}));
});
if (this._ignoreInvalidMapping) {
if (typeof console !== 'undefined' && console.warn) {
console.warn(message);
}
return false;
} else {
throw new Error(message)
}
}

@@ -310,0 +329,0 @@ };

{
"name": "source-map-js",
"description": "Generates and consumes source maps",
"version": "1.0.3",
"version": "1.1.0",
"homepage": "https://github.com/7rulnik/source-map-js",

@@ -6,0 +6,0 @@ "author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",

@@ -469,2 +469,5 @@ # Source Map JS

* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on
invalid mapping, it will be ignored.
```js

@@ -471,0 +474,0 @@ var generator = new sourceMap.SourceMapGenerator({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc