Last change
on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | declare namespace cleanStack {
|
---|
| 2 | interface Options {
|
---|
| 3 | /**
|
---|
| 4 | Prettify the file paths in the stack:
|
---|
| 5 |
|
---|
| 6 | `/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15` → `~/dev/clean-stack/unicorn.js:2:15`
|
---|
| 7 |
|
---|
| 8 | @default false
|
---|
| 9 | */
|
---|
| 10 | readonly pretty?: boolean;
|
---|
| 11 | }
|
---|
| 12 | }
|
---|
| 13 |
|
---|
| 14 | /**
|
---|
| 15 | Clean up error stack traces. Removes the mostly unhelpful internal Node.js entries.
|
---|
| 16 |
|
---|
| 17 | @param stack - The `stack` property of an `Error`.
|
---|
| 18 |
|
---|
| 19 | @example
|
---|
| 20 | ```
|
---|
| 21 | import cleanStack = require('clean-stack');
|
---|
| 22 |
|
---|
| 23 | const error = new Error('Missing unicorn');
|
---|
| 24 |
|
---|
| 25 | console.log(error.stack);
|
---|
| 26 |
|
---|
| 27 | // Error: Missing unicorn
|
---|
| 28 | // at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
|
---|
| 29 | // at Module._compile (module.js:409:26)
|
---|
| 30 | // at Object.Module._extensions..js (module.js:416:10)
|
---|
| 31 | // at Module.load (module.js:343:32)
|
---|
| 32 | // at Function.Module._load (module.js:300:12)
|
---|
| 33 | // at Function.Module.runMain (module.js:441:10)
|
---|
| 34 | // at startup (node.js:139:18)
|
---|
| 35 |
|
---|
| 36 | console.log(cleanStack(error.stack));
|
---|
| 37 |
|
---|
| 38 | // Error: Missing unicorn
|
---|
| 39 | // at Object.<anonymous> (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)
|
---|
| 40 | ```
|
---|
| 41 | */
|
---|
| 42 | declare function cleanStack(
|
---|
| 43 | stack: string,
|
---|
| 44 | options?: cleanStack.Options
|
---|
| 45 | ): string;
|
---|
| 46 |
|
---|
| 47 | export = cleanStack;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.