| CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 66
Releases: winterbe/streamjs
1.6.4
1.6.3
Migrate from JSHint to ESLint.
Assets 2
1.6.2
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
});Assets 2
1.6.1
Fix ReferenceError when using Stream.js with the Java 8 Nashorn Engine.
Assets 2
1.6.0
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, 21Assets 2
1.5.0
This release includes some internal optimizations and enables better Typescript support.
Assets 2
1.4.0
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.
Assets 2
1.3.0
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.
Assets 2
1.2.0
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.
Assets 2
1.1.2
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