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

@sentry/utils

Package Overview
Dependencies
Maintainers
12
Versions
517
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/utils - npm Package Compare versions

Comparing version 5.11.0 to 5.11.1

10

dist/misc.d.ts

@@ -1,2 +0,2 @@

import { Event, Integration } from '@sentry/types';
import { Event, Integration, StackFrame } from '@sentry/types';
/** Internal */

@@ -119,3 +119,11 @@ interface SentryGlobal {

export declare function getFunctionName(fn: unknown): string;
/**
* This function adds context (pre/post/line) lines to the provided frame
*
* @param lines string[] containing all lines
* @param frame StackFrame that will be mutated
* @param linesOfContext number of context lines we want to add pre/post
*/
export declare function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext?: number): void;
export {};
//# sourceMappingURL=misc.d.ts.map
Object.defineProperty(exports, "__esModule", { value: true });
var is_1 = require("./is");
var string_1 = require("./string");
/**

@@ -339,2 +340,23 @@ * Requires a module which is protected _against bundler minification.

exports.getFunctionName = getFunctionName;
/**
* This function adds context (pre/post/line) lines to the provided frame
*
* @param lines string[] containing all lines
* @param frame StackFrame that will be mutated
* @param linesOfContext number of context lines we want to add pre/post
*/
function addContextToFrame(lines, frame, linesOfContext) {
if (linesOfContext === void 0) { linesOfContext = 5; }
var lineno = frame.lineno || 0;
var maxLines = lines.length;
var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);
frame.pre_context = lines
.slice(Math.max(0, sourceLine - linesOfContext), sourceLine)
.map(function (line) { return string_1.snipLine(line, 0); });
frame.context_line = string_1.snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);
frame.post_context = lines
.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)
.map(function (line) { return string_1.snipLine(line, 0); });
}
exports.addContextToFrame = addContextToFrame;
//# sourceMappingURL=misc.js.map

@@ -1,2 +0,2 @@

import { Event, Integration } from '@sentry/types';
import { Event, Integration, StackFrame } from '@sentry/types';
/** Internal */

@@ -119,3 +119,11 @@ interface SentryGlobal {

export declare function getFunctionName(fn: unknown): string;
/**
* This function adds context (pre/post/line) lines to the provided frame
*
* @param lines string[] containing all lines
* @param frame StackFrame that will be mutated
* @param linesOfContext number of context lines we want to add pre/post
*/
export declare function addContextToFrame(lines: string[], frame: StackFrame, linesOfContext?: number): void;
export {};
//# sourceMappingURL=misc.d.ts.map
import { isString } from './is';
import { snipLine } from './string';
/**

@@ -323,2 +324,22 @@ * Requires a module which is protected _against bundler minification.

}
/**
* This function adds context (pre/post/line) lines to the provided frame
*
* @param lines string[] containing all lines
* @param frame StackFrame that will be mutated
* @param linesOfContext number of context lines we want to add pre/post
*/
export function addContextToFrame(lines, frame, linesOfContext) {
if (linesOfContext === void 0) { linesOfContext = 5; }
var lineno = frame.lineno || 0;
var maxLines = lines.length;
var sourceLine = Math.max(Math.min(maxLines, lineno - 1), 0);
frame.pre_context = lines
.slice(Math.max(0, sourceLine - linesOfContext), sourceLine)
.map(function (line) { return snipLine(line, 0); });
frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);
frame.post_context = lines
.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)
.map(function (line) { return snipLine(line, 0); });
}
//# sourceMappingURL=misc.js.map

2

package.json
{
"name": "@sentry/utils",
"version": "5.11.0",
"version": "5.11.1",
"description": "Utilities for all Sentry JavaScript SDKs",

@@ -5,0 +5,0 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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