-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixed crypto import and isNodeStream function #79
Conversation
@@ -14,7 +14,8 @@ interface FileClientConfig { | |||
} | |||
|
|||
function isNodeStream(source: InputSource): source is NodeJS.ReadableStream { | |||
return Object.prototype.hasOwnProperty.call(source, 'pipe'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazingly hasOwnProperty returns false for stream altough !!source.pipe
returns pipe. HasOwnPropery is for innumerable props (the one that will appear in loop, native methods are not innumerable).
lib/facade/FileClient.ts
Outdated
// @ts-ignore | ||
return typeof source?.pipe === 'function'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @ts-ignore | |
return typeof source?.pipe === 'function'; | |
return typeof (source as NodeJS.ReadableStream)?.pipe === 'function'; |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
No description provided.