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

Fixed crypto import and isNodeStream function #79

Merged
merged 4 commits into from
Aug 25, 2022

Conversation

ivanovSPvirtru
Copy link
Contributor

No description provided.

@@ -14,7 +14,8 @@ interface FileClientConfig {
}

function isNodeStream(source: InputSource): source is NodeJS.ReadableStream {
return Object.prototype.hasOwnProperty.call(source, 'pipe');
Copy link
Contributor Author

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).

@ivanovSPvirtru ivanovSPvirtru marked this pull request as ready for review August 25, 2022 13:16
@ivanovSPvirtru ivanovSPvirtru requested a review from a team as a code owner August 25, 2022 13:16
mustyantsev
mustyantsev previously approved these changes Aug 25, 2022
Comment on lines 17 to 18
// @ts-ignore
return typeof source?.pipe === 'function';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// @ts-ignore
return typeof source?.pipe === 'function';
return typeof (source as NodeJS.ReadableStream)?.pipe === 'function';

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ivanovSPvirtru ivanovSPvirtru merged commit f24b115 into main Aug 25, 2022
@ivanovSPvirtru ivanovSPvirtru deleted the feature/PLAT-2010 branch August 25, 2022 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants