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

doc: update stream.pipeline() signature #31789

Closed

Conversation

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Feb 14, 2020

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

The ...transforms parameter seems optional.

Refs:

if (streams.length < 2) {
throw new ERR_MISSING_ARGS('streams');
}

Refs: https://github.com/nodejs/node/blob/e559842188f541b884abff2ffad4d2d3e1b841a6/doc/api/stream.md#streams-compatibility-with-async-generators-and-async-iterators
(see the last example)

@ronag

This comment has been minimized.

Copy link
Member

ronag commented Feb 14, 2020

Isn't ...transform already optional by definition? i.e. ... is a sequence which may be empty.

@jasnell

This comment has been minimized.

Copy link
Member

jasnell commented Feb 14, 2020

Yes, but the [ .. ] bracket syntax is more idiomatic across our docs.

@ronag
ronag approved these changes Feb 14, 2020
@vsemozhetbyt

This comment has been minimized.

Copy link
Contributor Author

vsemozhetbyt commented Feb 14, 2020

Sorry, I did not even consider ... may mean an empty list (i.e. for me it was rather transform+ than transform*). So maybe there are some more readers like me)

@vsemozhetbyt

This comment has been minimized.

Copy link
Contributor Author

vsemozhetbyt commented Feb 14, 2020

@ZYSzys
ZYSzys approved these changes Feb 14, 2020
@lpinca
lpinca approved these changes Feb 14, 2020
lpinca added a commit that referenced this pull request Feb 22, 2020
The  `...transforms` parameter is optional.

Refs: https://github.com/nodejs/node/blob/0875837417/lib/internal/streams/pipeline.js#L130-L132
Refs: https://github.com/nodejs/node/blob/e559842188/doc/api/stream.md#streams-compatibility-with-async-generators-and-async-iterators

PR-URL: #31789
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@lpinca

This comment has been minimized.

Copy link
Member

lpinca commented Feb 22, 2020

Landed in 2f23918.

@lpinca lpinca closed this Feb 22, 2020
@vsemozhetbyt vsemozhetbyt deleted the vsemozhetbyt:doc-stream-pipeline-signature branch Feb 22, 2020
MylesBorins added a commit that referenced this pull request Mar 4, 2020
The  `...transforms` parameter is optional.

Refs: https://github.com/nodejs/node/blob/0875837417/lib/internal/streams/pipeline.js#L130-L132
Refs: https://github.com/nodejs/node/blob/e559842188/doc/api/stream.md#streams-compatibility-with-async-generators-and-async-iterators

PR-URL: #31789
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.