Socket
Socket
Sign inDemoInstall

source-map-support

Package Overview
Dependencies
2
Maintainers
3
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.8 to 0.5.9

12

browser-source-map-support.js

@@ -27,3 +27,3 @@ /*

Object.prototype.toString.call(e)})(e)}function K(e){return 16>e?"0"+e.toString(16):e.toString(16)}function L(e){for(var g=[],a=0;a<e.length;a++){var c=e.charCodeAt(a);if(127>=c)g.push(e.charCodeAt(a));else{var b=a;55296<=c&&57343>=c&&a++;c=encodeURIComponent(e.slice(b,a+1)).substr(1).split("%");for(b=0;b<c.length;b++)g.push(parseInt(c[b],16))}}return g}function J(e){for(var g=[],a=0;a<e.length;a++)g.push(e.charCodeAt(a)&255);return g}function C(e,a,c,b){for(var g=0;g<b&&!(g+c>=a.length||g>=e.length);g++)a[g+
c]=e[g];return g}function F(e){try{return decodeURIComponent(e)}catch(g){return String.fromCharCode(65533)}}function H(e,g){q("number"===typeof e,"cannot write a non-number as a number");q(0<=e,"specified a negative value for writing an unsigned value");q(e<=g,"value is larger than maximum value for type");q(Math.floor(e)===e,"value has a fractional component")}function A(e,g,a){q("number"===typeof e,"cannot write a non-number as a number");q(e<=g,"value larger than maximum allowed value");q(e>=a,
c]=e[g];return g}function F(e){try{return decodeURIComponent(e)}catch(g){return String.fromCharCode(65533)}}function H(e,a){q("number"===typeof e,"cannot write a non-number as a number");q(0<=e,"specified a negative value for writing an unsigned value");q(e<=a,"value is larger than maximum value for type");q(Math.floor(e)===e,"value has a fractional component")}function A(e,a,c){q("number"===typeof e,"cannot write a non-number as a number");q(e<=a,"value larger than maximum allowed value");q(e>=c,
"value smaller than minimum allowed value");q(Math.floor(e)===e,"value has a fractional component")}function D(e,a,c){q("number"===typeof e,"cannot write a non-number as a number");q(e<=a,"value larger than maximum allowed value");q(e>=c,"value smaller than minimum allowed value")}function q(e,a){if(!e)throw Error(a||"Failed assertion");}var E=p("base64-js"),G=p("ieee754");m.Buffer=b;m.SlowBuffer=b;m.INSPECT_MAX_BYTES=50;b.poolSize=8192;b._useTypedArrays=function(){try{var e=new ArrayBuffer(0),a=

@@ -112,6 +112,6 @@ new Uint8Array(e);a.foo=function(){return 42};return 42===a.foo()&&"function"===typeof a.subarray}catch(y){return!1}}();b.isEncoding=function(e){switch(String(e).toLowerCase()){case "hex":case "utf8":case "utf-8":case "ascii":case "binary":case "base64":case "raw":case "ucs2":case "ucs-2":case "utf16le":case "utf-16le":return!0;default:return!1}};b.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)};b.byteLength=function(e,a){e+="";switch(a||"utf8"){case "hex":var g=e.length/2;break;

"utf8")}catch(Q){d=""}if(d&&(d=d.split(/(?:\r\n|\r|\n)/)[c-1]))return a+":"+c+"\n"+d+"\n"+Array(b).join(" ")+"^"}return null}function c(){var a=b.emit;b.emit=function(c){if("uncaughtException"===c){var d=arguments[1]&&arguments[1].stack,e=0<this.listeners(c).length;if(d&&!e){d=arguments[1];e=v(d);b.stderr._handle&&b.stderr._handle.setBlocking&&b.stderr._handle.setBlocking(!0);e&&(console.error(),console.error(e));console.error(d.stack);b.exit(1);return}}return a.apply(this,arguments)}}var n=p("source-map").SourceMapConsumer,
x=p("path");try{var B=p("fs");B.existsSync&&B.readFileSync||(B=null)}catch(e){}var I=p("buffer-from"),M=!1,K=!1,L=!1,J="auto",C={},F={},H=/^data:application\/json[^,]+base64,/,A=[],D=[],q=k(A);A.push(function(a){a=a.trim();/^file:/.test(a)&&(a=a.replace(/file:\/\/\/(\w:)?/,function(a,b){return b?"":"/"}));if(a in C)return C[a];var b=null;if(!B){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);b=null;4===c.readyState&&200===c.status&&(b=c.responseText)}else if(B.existsSync(a))try{b=B.readFileSync(a,
"utf8")}catch(P){b=""}return C[a]=b});var E=k(D);D.push(function(a){a:{if(f())try{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);var c=b.getResponseHeader("SourceMap")||b.getResponseHeader("X-SourceMap");if(c){var d=c;break a}}catch(R){}d=q(a);b=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg;for(var e;c=b.exec(d);)e=c;d=e?e[1]:null}if(!d)return null;H.test(d)?(e=d.slice(d.indexOf(",")+1),e=I(e,"base64").toString(),
d=a):(d=h(a,d),e=q(d));return e?{url:d,map:e}:null});var G=A.slice(0),w=D.slice(0);m.wrapCallSite=r;m.getErrorSource=v;m.mapSourcePosition=d;m.retrieveSourceMap=E;m.install=function(a){a=a||{};if(a.environment&&(J=a.environment,-1===["node","browser","auto"].indexOf(J)))throw Error("environment "+J+" was unknown. Available options are {auto, browser, node}");a.retrieveFile&&(a.overrideRetrieveFile&&(A.length=0),A.unshift(a.retrieveFile));a.retrieveSourceMap&&(a.overrideRetrieveSourceMap&&(D.length=
0),D.unshift(a.retrieveSourceMap));if(a.hookRequire&&!f()){try{var d=p("module")}catch(P){}var e=d.prototype._compile;e.__sourceMapSupport||(d.prototype._compile=function(a,b){C[b]=a;F[b]=void 0;return e.call(this,a,b)},d.prototype._compile.__sourceMapSupport=!0)}L||(L="emptyCacheBetweenOperations"in a?a.emptyCacheBetweenOperations:!1);M||(M=!0,Error.prepareStackTrace=t);!K&&("handleUncaughtExceptions"in a?a.handleUncaughtExceptions:1)&&"object"===typeof b&&null!==b&&"function"===typeof b.on&&(K=
!0,c())};m.resetRetrieveHandlers=function(){A.length=0;D.length=0;A=G.slice(0);D=w.slice(0)}}).call(this,p("node_modules/process/browser.js"))},{"node_modules/process/browser.js":8,"buffer-from":4,fs:3,module:3,path:7,"source-map":19}]},{},[1]);return N});
x=p("path");try{var B=p("fs");B.existsSync&&B.readFileSync||(B=null)}catch(e){}var I=p("buffer-from"),M=!1,K=!1,L=!1,J="auto",C={},F={},H=/^data:application\/json[^,]+base64,/,A=[],D=[],q=k(A);A.push(function(a){a=a.trim();/^file:/.test(a)&&(a=a.replace(/file:\/\/\/(\w:)?/,function(a,b){return b?"":"/"}));if(a in C)return C[a];var b="";try{if(B)B.existsSync(a)&&(b=B.readFileSync(a,"utf8"));else{var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);4===c.readyState&&200===c.status&&(b=c.responseText)}}catch(P){}return C[a]=
b});var E=k(D);D.push(function(a){a:{if(f())try{var b=new XMLHttpRequest;b.open("GET",a,!1);b.send(null);var c=b.getResponseHeader("SourceMap")||b.getResponseHeader("X-SourceMap");if(c){var d=c;break a}}catch(R){}d=q(a);b=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg;for(var e;c=b.exec(d);)e=c;d=e?e[1]:null}if(!d)return null;H.test(d)?(e=d.slice(d.indexOf(",")+1),e=I(e,"base64").toString(),d=a):(d=h(a,d),e=q(d));return e?
{url:d,map:e}:null});var G=A.slice(0),w=D.slice(0);m.wrapCallSite=r;m.getErrorSource=v;m.mapSourcePosition=d;m.retrieveSourceMap=E;m.install=function(a){a=a||{};if(a.environment&&(J=a.environment,-1===["node","browser","auto"].indexOf(J)))throw Error("environment "+J+" was unknown. Available options are {auto, browser, node}");a.retrieveFile&&(a.overrideRetrieveFile&&(A.length=0),A.unshift(a.retrieveFile));a.retrieveSourceMap&&(a.overrideRetrieveSourceMap&&(D.length=0),D.unshift(a.retrieveSourceMap));
if(a.hookRequire&&!f()){try{var d=p("module")}catch(P){}var e=d.prototype._compile;e.__sourceMapSupport||(d.prototype._compile=function(a,b){C[b]=a;F[b]=void 0;return e.call(this,a,b)},d.prototype._compile.__sourceMapSupport=!0)}L||(L="emptyCacheBetweenOperations"in a?a.emptyCacheBetweenOperations:!1);M||(M=!0,Error.prepareStackTrace=t);!K&&("handleUncaughtExceptions"in a?a.handleUncaughtExceptions:1)&&"object"===typeof b&&null!==b&&"function"===typeof b.on&&(K=!0,c())};m.resetRetrieveHandlers=function(){A.length=
0;D.length=0;A=G.slice(0);D=w.slice(0)}}).call(this,p("node_modules/process/browser.js"))},{"node_modules/process/browser.js":8,"buffer-from":4,fs:3,module:3,path:7,"source-map":19}]},{},[1]);return N});
{
"name": "source-map-support",
"description": "Fixes stack traces for files with source maps",
"version": "0.5.8",
"version": "0.5.9",
"main": "./source-map-support.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -81,19 +81,18 @@ var SourceMapConsumer = require('source-map').SourceMapConsumer;

var contents = null;
if (!fs) {
// Use SJAX if we are in the browser
var xhr = new XMLHttpRequest();
xhr.open('GET', path, false);
xhr.send(null);
var contents = null
if (xhr.readyState === 4 && xhr.status === 200) {
contents = xhr.responseText
}
} else if (fs.existsSync(path)) {
// Otherwise, use the filesystem
try {
var contents = '';
try {
if (!fs) {
// Use SJAX if we are in the browser
var xhr = new XMLHttpRequest();
xhr.open('GET', path, /** async */ false);
xhr.send(null);
if (xhr.readyState === 4 && xhr.status === 200) {
contents = xhr.responseText;
}
} else if (fs.existsSync(path)) {
// Otherwise, use the filesystem
contents = fs.readFileSync(path, 'utf8');
} catch (er) {
contents = '';
}
} catch (er) {
/* ignore any errors */
}

@@ -100,0 +99,0 @@

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