Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

source-map-support

Package Overview
Dependencies
Maintainers
3
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

source-map-support - npm Package Compare versions

Comparing version 0.5.11 to 0.5.12

14

browser-source-map-support.js

@@ -107,8 +107,8 @@ /*

/^(?:is|get)/.test(c)?function(){return a[c].call(a)}:a[c]});b.toString=l;return b}function q(b){if(b.isNative())return b;var c=b.getFileName()||b.getScriptNameOrSourceURL();if(c){var f=b.getLineNumber(),g=b.getColumnNumber()-1;1===f&&62<g&&!e()&&!b.isEval()&&(g-=62);var h=d({source:c,line:f,column:g});b=r(b);var k=b.getFunctionName;b.getFunctionName=function(){return h.name||k()};b.getFileName=function(){return h.source};b.getLineNumber=function(){return h.line};b.getColumnNumber=function(){return h.column+
1};b.getScriptNameOrSourceURL=function(){return h.source};return b}var l=b.isEval()&&b.getEvalOrigin();l&&(l=a(l),b=r(b),b.getEvalOrigin=function(){return l});return b}function w(a,b){H&&(p={},C={});return a+b.map(function(a){return"\n at "+q(a)}).join("")}function v(a){var b=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(a.stack);if(b){a=b[1];var c=+b[2];b=+b[3];var d=p[a];if(!d&&u&&u.existsSync(a))try{d=u.readFileSync(a,"utf8")}catch(N){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 k=n("source-map").SourceMapConsumer,x=n("path");try{var u=n("fs");u.existsSync&&u.readFileSync||
(u=null)}catch(M){}var F=n("buffer-from"),D=!1,t=!1,H=!1,f="auto",p={},C={},G=/^data:application\/json[^,]+base64,/,y=[],B=[],A=g(y);y.push(function(a){a=a.trim();/^file:/.test(a)&&(a=a.replace(/file:\/\/\/(\w:)?/,function(a,b){return b?"":"/"}));if(a in p)return p[a];var b="";try{if(u)u.existsSync(a)&&(b=u.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(K){}return p[a]=b});var E=g(B);B.push(function(a){a:{if(e())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(O){}d=A(a);b=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg;for(var f;c=b.exec(d);)f=c;d=f?f[1]:null}if(!d)return null;G.test(d)?(f=d.slice(d.indexOf(",")+1),f=F(f,"base64").toString(),d=a):(d=h(a,d),f=A(d));return f?{url:d,map:f}:null});var I=y.slice(0),L=B.slice(0);m.wrapCallSite=
q;m.getErrorSource=v;m.mapSourcePosition=d;m.retrieveSourceMap=E;m.install=function(a){a=a||{};if(a.environment&&(f=a.environment,-1===["node","browser","auto"].indexOf(f)))throw Error("environment "+f+" was unknown. Available options are {auto, browser, node}");a.retrieveFile&&(a.overrideRetrieveFile&&(y.length=0),y.unshift(a.retrieveFile));a.retrieveSourceMap&&(a.overrideRetrieveSourceMap&&(B.length=0),B.unshift(a.retrieveSourceMap));if(a.hookRequire&&!e()){try{var d=n("module")}catch(K){}var g=
d.prototype._compile;g.__sourceMapSupport||(d.prototype._compile=function(a,b){p[b]=a;C[b]=void 0;return g.call(this,a,b)},d.prototype._compile.__sourceMapSupport=!0)}H||(H="emptyCacheBetweenOperations"in a?a.emptyCacheBetweenOperations:!1);D||(D=!0,Error.prepareStackTrace=w);!t&&("handleUncaughtExceptions"in a?a.handleUncaughtExceptions:1)&&"object"===typeof b&&null!==b&&"function"===typeof b.on&&(t=!0,c())};m.resetRetrieveHandlers=function(){y.length=0;B.length=0;y=I.slice(0);B=L.slice(0);E=g(B);
A=g(y)}}).call(this,n("g5I+bs"))},{"buffer-from":4,fs:3,"g5I+bs":9,module:3,path:8,"source-map":20}]},{},[1]);return G});
1};b.getScriptNameOrSourceURL=function(){return h.source};return b}var l=b.isEval()&&b.getEvalOrigin();l&&(l=a(l),b=r(b),b.getEvalOrigin=function(){return l});return b}function w(a,b){H&&(p={},C={});return(a.name||"Error")+": "+(a.message||"")+b.map(function(a){return"\n at "+q(a)}).join("")}function v(a){var b=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(a.stack);if(b){a=b[1];var c=+b[2];b=+b[3];var d=p[a];if(!d&&u&&u.existsSync(a))try{d=u.readFileSync(a,"utf8")}catch(N){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 k=n("source-map").SourceMapConsumer,x=n("path");try{var u=n("fs");
u.existsSync&&u.readFileSync||(u=null)}catch(M){}var F=n("buffer-from"),D=!1,t=!1,H=!1,f="auto",p={},C={},G=/^data:application\/json[^,]+base64,/,y=[],B=[],A=g(y);y.push(function(a){a=a.trim();/^file:/.test(a)&&(a=a.replace(/file:\/\/\/(\w:)?/,function(a,b){return b?"":"/"}));if(a in p)return p[a];var b="";try{if(u)u.existsSync(a)&&(b=u.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(K){}return p[a]=
b});var E=g(B);B.push(function(a){a:{if(e())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(O){}d=A(a);b=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/mg;for(var f;c=b.exec(d);)f=c;d=f?f[1]:null}if(!d)return null;G.test(d)?(f=d.slice(d.indexOf(",")+1),f=F(f,"base64").toString(),d=a):(d=h(a,d),f=A(d));return f?
{url:d,map:f}:null});var I=y.slice(0),L=B.slice(0);m.wrapCallSite=q;m.getErrorSource=v;m.mapSourcePosition=d;m.retrieveSourceMap=E;m.install=function(a){a=a||{};if(a.environment&&(f=a.environment,-1===["node","browser","auto"].indexOf(f)))throw Error("environment "+f+" was unknown. Available options are {auto, browser, node}");a.retrieveFile&&(a.overrideRetrieveFile&&(y.length=0),y.unshift(a.retrieveFile));a.retrieveSourceMap&&(a.overrideRetrieveSourceMap&&(B.length=0),B.unshift(a.retrieveSourceMap));
if(a.hookRequire&&!e()){try{var d=n("module")}catch(K){}var g=d.prototype._compile;g.__sourceMapSupport||(d.prototype._compile=function(a,b){p[b]=a;C[b]=void 0;return g.call(this,a,b)},d.prototype._compile.__sourceMapSupport=!0)}H||(H="emptyCacheBetweenOperations"in a?a.emptyCacheBetweenOperations:!1);D||(D=!0,Error.prepareStackTrace=w);!t&&("handleUncaughtExceptions"in a?a.handleUncaughtExceptions:1)&&"object"===typeof b&&null!==b&&"function"===typeof b.on&&(t=!0,c())};m.resetRetrieveHandlers=function(){y.length=
0;B.length=0;y=I.slice(0);B=L.slice(0);E=g(B);A=g(y)}}).call(this,n("g5I+bs"))},{"buffer-from":4,fs:3,"g5I+bs":9,module:3,path:8,"source-map":20}]},{},[1]);return G});
{
"name": "source-map-support",
"description": "Fixes stack traces for files with source maps",
"version": "0.5.11",
"version": "0.5.12",
"main": "./source-map-support.js",

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

@@ -387,3 +387,3 @@ var SourceMapConsumer = require('source-map').SourceMapConsumer;

// This function is part of the V8 stack trace API, for more info see:
// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
// https://v8.dev/docs/stack-trace-api
function prepareStackTrace(error, stack) {

@@ -395,3 +395,7 @@ if (emptyCacheBetweenOperations) {

return error + stack.map(function(frame) {
var name = error.name || 'Error';
var message = error.message || '';
var errorString = name + ": " + message;
return errorString + stack.map(function(frame) {
return '\n at ' + wrapCallSite(frame);

@@ -398,0 +402,0 @@ }).join('');

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc