Skip to content

Commit faf563e

Browse files
vsemozhetbytjasnell
authored andcommitted
doc: unify format of iterables
Also, make signatures easier for copy-paste testing. PR-URL: #20036 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 5008c5a commit faf563e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

doc/api/stream.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,16 +1206,14 @@ myReader.on('readable', () => {
12061206
});
12071207
```
12081208

1209-
##### readable[@@asyncIterator]
1209+
##### readable\[Symbol.asyncIterator\]()
12101210
<!-- YAML
12111211
added: REPLACEME
12121212
-->
12131213

12141214
> Stability: 1 - Experimental
12151215
1216-
* {AsyncIterator}
1217-
1218-
Returns an [AsyncIterator][async-iterator] to fully consume the stream.
1216+
* Returns: {AsyncIterator} to fully consume the stream.
12191217

12201218
```js
12211219
const fs = require('fs');
@@ -2415,4 +2413,3 @@ contain multi-byte characters.
24152413
[readable-destroy]: #stream_readable_destroy_error
24162414
[writable-_destroy]: #stream_writable_destroy_err_callback
24172415
[writable-destroy]: #stream_writable_destroy_error
2418-
[async-iterator]: https://github.com/tc39/proposal-async-iteration

doc/api/url.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ percent-encoded where necessary.
736736

737737
Returns an ES6 Iterator over the values of each name-value pair.
738738

739-
#### urlSearchParams\[@@iterator\]()
739+
#### urlSearchParams\[Symbol.iterator\]()
740740

741741
* Returns: {Iterator}
742742

@@ -1174,7 +1174,7 @@ console.log(myURL.origin);
11741174
[`url.toJSON()`]: #url_url_tojson
11751175
[`url.toString()`]: #url_url_tostring
11761176
[`urlSearchParams.entries()`]: #url_urlsearchparams_entries
1177-
[`urlSearchParams@@iterator()`]: #url_urlsearchparams_iterator
1177+
[`urlSearchParams@@iterator()`]: #url_urlsearchparams_symbol_iterator
11781178
[ICU]: intl.html#intl_options_for_building_node_js
11791179
[Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4
11801180
[WHATWG URL Standard]: https://url.spec.whatwg.org/

0 commit comments

Comments
 (0)