Skip to content

Releases: winterbe/streamjs

1.6.4

08 Oct 07:44
Compare
Choose a tag to compare

Adjust ESLint rules.

1.6.3

20 Sep 12:05
Compare
Choose a tag to compare

Migrate from JSHint to ESLint.

1.6.2

03 Jul 11:16
Compare
Choose a tag to compare

Add support for streaming native Java 8 lists.

Example:

load('./stream.js');

var list = new java.util.ArrayList();
list.add(1);
list.add(2);
list.add(3);

Stream(list)
    .filter(function (num) {
        return num % 2 === 1;
    })
    .forEach(function (num) {
        print(num);    // 1, 3
    });

1.6.1

03 Jul 09:53
Compare
Choose a tag to compare

Fix ReferenceError when using Stream.js with the Java 8 Nashorn Engine.

1.6.0

26 Jun 07:04
Compare
Choose a tag to compare

This new version 1.6.0 adds additional support for ES6 features like Sets, Maps, Generators and Iterators. The unified Stream constructor function now additionally accepts ES6 sets, maps and iterators as input. See APIDOC for further explanations.

Please keep in mind that ES6 support is optional, so Stream.js is still compatible with ES5.

Example
function* fibonacci() {
    let [prev, cur] = [0, 1];
    while (true) {
        [prev, cur] = [cur, prev + cur];
        yield cur;
    }
}

Stream(fibonacci())
    .filter(n => n % 2)
    .takeWhile(n => n < 50)
    .toArray();      // 1, 3, 5, 13, 21

1.5.0

15 Jun 05:19
Compare
Choose a tag to compare

This release includes some internal optimizations and enables better Typescript support.

1.4.0

12 Jun 08:19
Compare
Choose a tag to compare

This release is focused around new intermediate operations, which are well known in other languages like Haskell and Scala but not yet available in the Java 8 Streams API. The following new methods are now available in Stream.js: shuffle(), reverse(), slice(), takeWhile() and dropWhile(). See APIDOC for further information.
Another important change is handling of null and undefined inputs. From now on those inputs are treated as empty collections, so you don't have to check your input for existence before creating streams: Stream(undefined).toArray(); // => []. Here's the full list of changes for this release.

1.3.0

26 Jan 07:15
Compare
Choose a tag to compare

This release contains a bunch of new features: Each operation accepting a predicate now also accepts a sample object or a regexp to be matched against each element of the stream. Each operation accepting a mappingFn or a comparator alternatively accepts a string path to be resolved against the given object. Please refer to the APIDOC for more information and various code samples. Here is full list of all closed issues for this release.

1.2.0

19 Jan 07:02
Compare
Choose a tag to compare

This release adds a couple of new features: Filter also accepts a RegExp in order to filter strings by a given pattern. Map and FlatMap accept a string path, so you can easily resolve deep nested object paths. A new terminal operation iterator allows to traverse the elements of the stream externally. Please refer to the APIDOC for further information.

1.1.2

16 Jan 16:13
Compare
Choose a tag to compare

Fix some issues when using the lib with Node.js. I've also moved the scripts from src to the root folder. Stream.js now is also available as NPM package: npm install streamjs