corde
Version:
A simple library for Discord bot tests
31 lines (30 loc) • 713 B
TypeScript
/**
* Gets the trace of the current function / object
* Spacing each line of the trace with `DEFAULT_STACK_TRACE_LIMIT`
*
* @example
*
* 20 function creator(fn) {
* 21 fn();
* 22 return getStackTrace();
* 23 }
* 24
* 25 creator(() => {});
*
* // Being that the function is in file: D:\github\corde\test.js
* // And current working dir: D:\github\corde\test.js
*
* // Outputs:
* creator (test.js:22:10)
* Object.<anonymous> (test.js:25:13)
*
* @param stackLimit Amount of lines to be collected.
* @returns Formated stack trace.
*
* @internal
*/
export declare function getStackTrace(
stackLimit?: number,
removeFirstStack?: boolean,
functionName?: string,
): string;