UNPKG

466 BTypeScriptView Raw
1/**
2Creates a `.stack` property on the given `object`, which when accessed returns a string representing the location in the code at which `captureStackTrace()` was called.
3
4@example
5```
6import captureStackTrace from 'capture-stack-trace';
7
8const object = {};
9captureStackTrace(object);
10object.stack; // Similar to `new Error().stack`
11```
12*/
13export default function captureStackTrace(targetObject: object): void; // eslint-disable-line @typescript-eslint/ban-types