Socket
Socket
Sign inDemoInstall

@tapjs/stack

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/stack - npm Package Compare versions

Comparing version 0.0.0-6 to 0.0.0-7

9

dist/cjs/index.d.ts

@@ -0,1 +1,6 @@

/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import { CallSiteLike } from './call-site-like.js';

@@ -91,3 +96,3 @@ export { CallSiteLike, CallSiteLikeJSON } from './call-site-like.js';

export declare function captureString(limit: number): string;
export declare function captureString(fn: Function | ((...a: any[]) => any)): string;
export declare function captureString(fn?: Function | ((...a: any[]) => any)): string;
export declare function captureString(): string;

@@ -107,3 +112,3 @@ /**

*/
export declare const captureError: (e: Error) => CallSiteLike[];
export declare const captureError: (e: Error | NodeJS.ErrnoException) => CallSiteLike[];
/**

@@ -110,0 +115,0 @@ * Get a processed string stack corresponding to the stack trace of the Error

@@ -245,6 +245,12 @@ "use strict";

// errors almost always have these fields
const { stack = '', message = '', name = '' } = e;
const { stack = '', message = '', name = '', code, } = e;
const head = name && message ? `${name}: ${message}\n` : '';
const errnoHead = name && message && code ? `${name} [${code}]: ${message}` : '';
const cleanHead = !!head && stack.startsWith(head);
const s = cleanHead ? stack.substring(head.length) : stack;
const cleanErrnoHead = !!errnoHead && stack.startsWith(errnoHead);
const s = cleanHead
? stack.substring(head.length)
: cleanErrnoHead
? stack.substring(errnoHead.length)
: stack;
const cleaned = clean(s

@@ -251,0 +257,0 @@ .trimEnd()

@@ -0,1 +1,6 @@

/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import { CallSiteLike } from './call-site-like.js';

@@ -91,3 +96,3 @@ export { CallSiteLike, CallSiteLikeJSON } from './call-site-like.js';

export declare function captureString(limit: number): string;
export declare function captureString(fn: Function | ((...a: any[]) => any)): string;
export declare function captureString(fn?: Function | ((...a: any[]) => any)): string;
export declare function captureString(): string;

@@ -107,3 +112,3 @@ /**

*/
export declare const captureError: (e: Error) => CallSiteLike[];
export declare const captureError: (e: Error | NodeJS.ErrnoException) => CallSiteLike[];
/**

@@ -110,0 +115,0 @@ * Get a processed string stack corresponding to the stack trace of the Error

@@ -228,6 +228,12 @@ import { builtinModules } from 'node:module';

// errors almost always have these fields
const { stack = '', message = '', name = '' } = e;
const { stack = '', message = '', name = '', code, } = e;
const head = name && message ? `${name}: ${message}\n` : '';
const errnoHead = name && message && code ? `${name} [${code}]: ${message}` : '';
const cleanHead = !!head && stack.startsWith(head);
const s = cleanHead ? stack.substring(head.length) : stack;
const cleanErrnoHead = !!errnoHead && stack.startsWith(errnoHead);
const s = cleanHead
? stack.substring(head.length)
: cleanErrnoHead
? stack.substring(errnoHead.length)
: stack;
const cleaned = clean(s

@@ -234,0 +240,0 @@ .trimEnd()

{
"name": "@tapjs/stack",
"version": "0.0.0-6",
"version": "0.0.0-7",
"description": "Utility for working with stack traces",

@@ -37,2 +37,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me)",

"tap": {
"typecheck": false,
"coverage-map": "map.js"

@@ -39,0 +40,0 @@ },

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

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