Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle streams attached to an error by replacing them with '[object Stream]' #57

Merged
merged 3 commits into from
Feb 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
show [object Readable] if there is a readable object
fixes #56
wodka authored Jan 30, 2022

Unverified

This user has not yet uploaded their public signing key.
commit aae3d19338851f39e16c36245c9e85db9bdb2bd9
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -77,6 +77,11 @@ const destroyCircular = ({
continue;
}

if (typeof value === 'object' && typeof value._read === 'function' && typeof value._readableState === 'object') {
to[key] = '[object Readable]';
continue;
}

if (typeof value === 'function') {
continue;
}