Commit Graph

18 Commits

Author SHA1 Message Date
Antoine du Hamel
d7f193434a
lib: add Promise methods to avoid-prototype-pollution lint rule
PR-URL: https://github.com/nodejs/node/pull/43849
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2022-07-26 23:38:24 +01:00
Node.js GitHub Bot
9c3c66b499
tools: update eslint to 8.18.0
PR-URL: https://github.com/nodejs/node/pull/43479
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-06-19 19:39:41 +01:00
Benjamin Gruenbaum
fd3997bcc9
stream: port more test262 tests
Add some test262 tests for `every`, add some `length` checks.

Turns out properties need to be writable after all according to the
test262 tests.

PR-URL: https://github.com/nodejs/node/pull/41974
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-23 21:06:00 +00:00
Mohammed Keyvanzadeh
717de17fad stream: refactor to use more validators
Use more validators where appropriate for consistency.

PR-URL: https://github.com/nodejs/node/pull/41871
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2022-02-11 11:47:09 +00:00
linkgoron
42ad4137aa
stream: add iterator helper find
Continue iterator-helpers work by adding `find` to readable streams.

PR-URL: https://github.com/nodejs/node/pull/41849
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-02-07 07:24:17 +00:00
Benjamin Gruenbaum
662fb5f832
stream: initial port of test262 tests
PR-URL: https://github.com/nodejs/node/pull/41775
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-02-05 16:47:46 +00:00
iMoses
06625ff0a6
stream: use synchronous error validation & validate abort signal option
made sure top level methods aren't async/generators
so that validation errors could be caught synchronously
also added validation for the abort signal option

PR-URL: https://github.com/nodejs/node/pull/41777
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
2022-02-03 10:55:05 +00:00
Benjamin Gruenbaum
d2ac192351
stream: add reduce
PR-URL: https://github.com/nodejs/node/pull/41669
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-30 14:07:32 +00:00
iMoses
5d9caa1c2f
stream: use synchronous error validation on iteration helpers
is no longer a generator function,
instead it returns a called generator so that validation can be
synchronous and not wait for the first iteration

Fixes: https://github.com/nodejs/node/issues/41648

PR-URL: https://github.com/nodejs/node/pull/41652
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2022-01-27 16:53:00 +00:00
Benjamin Gruenbaum
830007dafd stream: add asIndexedPairs
Add the asIndexedPairs method for readable streams.

PR-URL: https://github.com/nodejs/node/pull/41681
Refs: https://github.com/tc39/proposal-iterator-helpers#asindexedpairs
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-27 13:04:49 +02:00
Benjamin Gruenbaum
a8afe26fca stream: add drop and take
This adds the `drop` and `take` methods to readable streams allowing
users easily drop and take items from the stream.

This continues the iterator-helper proposal alignment task.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41630
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-23 18:43:16 +02:00
Benjamin Gruenbaum
ca489497be
stream: never flatten on toArray
PR-URL: https://github.com/nodejs/node/pull/41615
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-01-23 08:19:53 +00:00
Benjamin Gruenbaum
cc8931a916 stream: support flatMap
Support the `flatMap` method from the iterator helper TC39 proposal on
readable streams.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41612
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-23 10:13:17 +02:00
Benjamin Gruenbaum
5badf46f2a stream: support some and every
This continues on the iterator-helpers work by adding `.some` and
`.every` to readable streams.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41573
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-21 12:10:17 +02:00
Benjamin Gruenbaum
5a407d606a stream: add toArray
Add the toArray method from the TC39 iterator helper proposal to
Readable streams. This also enables a common-use case of converting a
stream to an array.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41553
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-20 11:24:29 +02:00
Benjamin Gruenbaum
3f0bcfb203 stream: add forEach method
Add a `forEach` method to readable streams to enable concurrent
iteration and align with the iterator-helpers proposal.

Co-Authored-By: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/41445
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2022-01-17 14:25:04 +02:00
Benjamin Gruenbaum
55c5120b07 stream: add filter method to readable
This continues the work in https://github.com/nodejs/node/pull/40815 to
make streams compatible with upcoming ECMAScript language features. It
adds an experimental `filter` api to streams and tests/docs for it.

See https://github.com/tc39/proposal-iterator-helpers/

Co-Authored-By: Robert Nagy <ronagy@icloud.com>

PR-URL: https://github.com/nodejs/node/pull/41354
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-01-02 09:52:50 +02:00
Benjamin Gruenbaum
b97b81d4ec stream: add map method to Readable
Implement the map method on readable stream. This starts the alignment
with the tc39-iterator-helpers proposal and adds a `.map` method to
every Node.js readable stream.

Co-Authored-By: Robert Nagy <ronag@icloud.com>

PR-URL: https://github.com/nodejs/node/pull/40815
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-12-29 20:32:36 +01:00