stack-utils
Advanced tools
Comparing version 1.0.4 to 1.0.5
23
index.js
@@ -51,3 +51,4 @@ 'use strict'; | ||
clean (stack, indent = 0) { | ||
clean (stack, indent) { | ||
indent = indent || 0 | ||
indent = ' '.repeat(indent); | ||
@@ -105,3 +106,4 @@ | ||
captureString (limit, fn = this.captureString) { | ||
captureString (limit, fn) { | ||
fn = fn || this.captureString | ||
if (typeof limit === 'function') { | ||
@@ -112,3 +114,3 @@ fn = limit; | ||
const {stackTraceLimit} = Error; | ||
const stackTraceLimit = Error.stackTraceLimit; | ||
if (limit) { | ||
@@ -121,3 +123,3 @@ Error.stackTraceLimit = limit; | ||
Error.captureStackTrace(obj, fn); | ||
const {stack} = obj; | ||
const stack = obj.stack; | ||
Error.stackTraceLimit = stackTraceLimit; | ||
@@ -128,3 +130,4 @@ | ||
capture (limit, fn = this.capture) { | ||
capture (limit, fn) { | ||
fn = fn || this.capture | ||
if (typeof limit === 'function') { | ||
@@ -135,3 +138,4 @@ fn = limit; | ||
const {prepareStackTrace, stackTraceLimit} = Error; | ||
const prepareStackTrace = Error.prepareStackTrace | ||
const stackTraceLimit = Error.stackTraceLimit | ||
Error.prepareStackTrace = (obj, site) => { | ||
@@ -151,3 +155,3 @@ if (this._wrapCallSite) { | ||
Error.captureStackTrace(obj, fn); | ||
const { stack } = obj; | ||
const stack = obj.stack; | ||
Object.assign(Error, {prepareStackTrace, stackTraceLimit}); | ||
@@ -158,4 +162,5 @@ | ||
at (fn = this.at) { | ||
const [site] = this.capture(1, fn); | ||
at (fn) { | ||
fn = fn || this.at | ||
const site = this.capture(1, fn)[0]; | ||
@@ -162,0 +167,0 @@ if (!site) { |
{ | ||
"name": "stack-utils", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "tag": "v1-legacy" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14631
278