/**
 * Helper class for capturing stack traces.
 *
 * Copyright (C) 2015 Martin Poelstra
 * License: MIT
 */ const hasStacks = ( typeof ( < any > Error ) . captureStackTrace === "function" ) ; export default class Stack { private stack ! : string ; constructor ( ignoreUntil = Stack ) { if ( hasStacks ) { ( < any > Error ) . captureStackTrace ( this , ignoreUntil ) ; } else { this . stack = "dummy\n<no trace>" ; } } public inspect ( ) { const lines = this . stack . split ( "\n" ) ; lines . shift ( ) ; return lines . join ( "\n" ) ; } }