Closed SimenB closed 6 years ago
Do you have a more specific use-case? I'm failing to see the usefulness of this.
@sindresorhus sorry about the slow response!
My use case is that the stacktrace itself is already part of a larger string, which has some blank lines for readability. If I pass that string though clean-stack
to remove node internals, it also strips the lines I want it to keep.
Example is an assertion failure
Expected value to be (operator: ==):
true
Received:
false
at __tests__/node_assertion_error.test.js:23:10
at <anonymous>
at internal/process/next_tick.js:188:7
I want clean-stack
to remove e.g. internal/process/next_tick.js:188:7
, but I don't want it to remove the blank line between the start of the stack trace, and the false
part of the string
I pushed an updated test to better illustrate my use case. Doesn't show up here since the PR is closed.
https://github.com/SimenB/clean-stack/commit/4079afda5a2dec5ad0794049fa0d821f1e26cf18
When the stacktrace is part of a larger string (for instance captured
console.log
s with traces) it's sometimes useful to keep around empty lines.