@rimbu/stream
Advanced tools
Comparing version 0.7.3 to 0.7.4
@@ -11,3 +11,3 @@ "use strict"; | ||
var AsyncOfIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(AsyncOfIterator, _super); | ||
(0, tslib_1.__extends)(AsyncOfIterator, _super); | ||
function AsyncOfIterator(values) { | ||
@@ -29,3 +29,3 @@ var _this = _super.call(this) || this; | ||
var AsyncOfStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(AsyncOfStream, _super); | ||
(0, tslib_1.__extends)(AsyncOfStream, _super); | ||
function AsyncOfStream(values) { | ||
@@ -55,8 +55,8 @@ var _this = _super.call(this) || this; | ||
} | ||
var _b = tslib_1.__read(sources), first = _b[0], rest = _b.slice(1); | ||
var _b = (0, tslib_1.__read)(sources), first = _b[0], rest = _b.slice(1); | ||
if (rest.length <= 0) { | ||
return fromAsyncStreamSource(first); | ||
} | ||
var _c = tslib_1.__read(rest), rest1 = _c[0], restOther = _c.slice(1); | ||
return (_a = fromAsyncStreamSource(first)).concat.apply(_a, tslib_1.__spreadArray([rest1], tslib_1.__read(restOther))); | ||
var _c = (0, tslib_1.__read)(rest), rest1 = _c[0], restOther = _c.slice(1); | ||
return (_a = fromAsyncStreamSource(first)).concat.apply(_a, (0, tslib_1.__spreadArray)([rest1], (0, tslib_1.__read)(restOther), false)); | ||
}; | ||
@@ -79,3 +79,3 @@ exports.from = from; | ||
var AsyncEmptyStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(AsyncEmptyStream, _super); | ||
(0, tslib_1.__extends)(AsyncEmptyStream, _super); | ||
function AsyncEmptyStream() { | ||
@@ -91,4 +91,4 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
AsyncEmptyStream.prototype.forEach = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/]; | ||
@@ -132,4 +132,4 @@ }); | ||
AsyncEmptyStream.prototype.count = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, 0]; | ||
@@ -140,4 +140,4 @@ }); | ||
AsyncEmptyStream.prototype.countElement = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, 0]; | ||
@@ -148,4 +148,4 @@ }); | ||
AsyncEmptyStream.prototype.countNotElement = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, 0]; | ||
@@ -168,4 +168,4 @@ }); | ||
AsyncEmptyStream.prototype.indexWhere = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, undefined]; | ||
@@ -176,4 +176,4 @@ }); | ||
AsyncEmptyStream.prototype.indexOf = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, undefined]; | ||
@@ -184,4 +184,4 @@ }); | ||
AsyncEmptyStream.prototype.some = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, false]; | ||
@@ -192,4 +192,4 @@ }); | ||
AsyncEmptyStream.prototype.every = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, true]; | ||
@@ -200,4 +200,4 @@ }); | ||
AsyncEmptyStream.prototype.contains = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, false]; | ||
@@ -229,6 +229,6 @@ }); | ||
return this; | ||
var _a = tslib_1.__read(others), source1 = _a[0], source2 = _a[1], sources = _a.slice(2); | ||
var _a = (0, tslib_1.__read)(others), source1 = _a[0], source2 = _a[1], sources = _a.slice(2); | ||
if (undefined === source2) | ||
return source1; | ||
return internal_1.AsyncStream.from.apply(internal_1.AsyncStream, tslib_1.__spreadArray([source1, source2], tslib_1.__read(sources))); | ||
return internal_1.AsyncStream.from.apply(internal_1.AsyncStream, (0, tslib_1.__spreadArray)([source1, source2], (0, tslib_1.__read)(sources), false)); | ||
}; | ||
@@ -252,4 +252,4 @@ AsyncEmptyStream.prototype.min = function (otherwise) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.start, start = _c === void 0 ? '' : _c, _d = _b.end, end = _d === void 0 ? '' : _d; | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_e) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_e) { | ||
return [2 /*return*/, start.concat(end)]; | ||
@@ -270,4 +270,4 @@ }); | ||
AsyncEmptyStream.prototype.reduce = function (reducer) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, reducer.stateToResult(common_1.Reducer.Init(reducer.init))]; | ||
@@ -285,4 +285,4 @@ }); | ||
} | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, reducers.map(function (p) { return p.stateToResult(common_1.Reducer.Init(p.init)); })]; | ||
@@ -296,4 +296,4 @@ }); | ||
AsyncEmptyStream.prototype.toArray = function () { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
return [2 /*return*/, []]; | ||
@@ -339,5 +339,5 @@ }); | ||
FromAsyncIterator.prototype.fastNext = function (otherwise) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
var result; | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -348,3 +348,3 @@ case 0: return [4 /*yield*/, this.source.next()]; | ||
if (!result.done) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, utils_1.closeIters(this)]; | ||
return [4 /*yield*/, (0, utils_1.closeIters)(this)]; | ||
case 2: | ||
@@ -361,3 +361,3 @@ _a.sent(); | ||
var FromIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromIterator, _super); | ||
(0, tslib_1.__extends)(FromIterator, _super); | ||
function FromIterator(iterator, close) { | ||
@@ -370,5 +370,5 @@ var _this = _super.call(this) || this; | ||
FromIterator.prototype.fastNext = function (otherwise) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
var result; | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -378,3 +378,3 @@ case 0: | ||
if (!result.done) return [3 /*break*/, 2]; | ||
return [4 /*yield*/, utils_1.closeIters(this)]; | ||
return [4 /*yield*/, (0, utils_1.closeIters)(this)]; | ||
case 1: | ||
@@ -391,9 +391,9 @@ _a.sent(); | ||
var FromPromise = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromPromise, _super); | ||
(0, tslib_1.__extends)(FromPromise, _super); | ||
function FromPromise(promise, close) { | ||
var _this = _super.call(this) || this; | ||
_this.promise = promise; | ||
_this.return = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
_this.return = function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () { | ||
var _a, _b; | ||
return tslib_1.__generator(this, function (_c) { | ||
return (0, tslib_1.__generator)(this, function (_c) { | ||
switch (_c.label) { | ||
@@ -419,5 +419,5 @@ case 0: | ||
FromPromise.prototype.fastNext = function (otherwise) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
var source; | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -475,3 +475,3 @@ case 0: | ||
var FromSource = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromSource, _super); | ||
(0, tslib_1.__extends)(FromSource, _super); | ||
function FromSource(source, close) { | ||
@@ -489,3 +489,3 @@ var _this = _super.call(this) || this; | ||
var FromResourceIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromResourceIterator, _super); | ||
(0, tslib_1.__extends)(FromResourceIterator, _super); | ||
function FromResourceIterator(open, createSource, close) { | ||
@@ -496,5 +496,5 @@ var _this = _super.call(this) || this; | ||
_this.close = close; | ||
_this.return = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
_this.return = function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () { | ||
var _a, _b; | ||
return tslib_1.__generator(this, function (_c) { | ||
return (0, tslib_1.__generator)(this, function (_c) { | ||
switch (_c.label) { | ||
@@ -517,6 +517,6 @@ case 0: | ||
FromResourceIterator.prototype.fastNext = function (otherwise) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
var resource, source; | ||
var _this = this; | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -534,5 +534,5 @@ case 0: | ||
_a.label = 3; | ||
case 3: return [2 /*return*/, this.iterator.fastNext(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () { | ||
case 3: return [2 /*return*/, this.iterator.fastNext(function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () { | ||
var _a; | ||
return tslib_1.__generator(this, function (_b) { | ||
return (0, tslib_1.__generator)(this, function (_b) { | ||
switch (_b.label) { | ||
@@ -553,3 +553,3 @@ case 0: return [4 /*yield*/, ((_a = this.return) === null || _a === void 0 ? void 0 : _a.call(this))]; | ||
var FromResource = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromResource, _super); | ||
(0, tslib_1.__extends)(FromResource, _super); | ||
function FromResource(open, createSource, close) { | ||
@@ -583,3 +583,3 @@ var _this = _super.call(this) || this; | ||
var AsyncUnfoldIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(AsyncUnfoldIterator, _super); | ||
(0, tslib_1.__extends)(AsyncUnfoldIterator, _super); | ||
function AsyncUnfoldIterator(init, getNext) { | ||
@@ -593,5 +593,5 @@ var _this = _super.call(this) || this; | ||
AsyncUnfoldIterator.prototype.fastNext = function (otherwise) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
var current, next; | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -598,0 +598,0 @@ case 0: |
@@ -5,4 +5,4 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var Constructors = tslib_1.__importStar(require("./constructors")); | ||
var Constructors = (0, tslib_1.__importStar)(require("./constructors")); | ||
exports.AsyncStream = Constructors; | ||
//# sourceMappingURL=interface.js.map |
@@ -10,4 +10,4 @@ "use strict"; | ||
} | ||
return tslib_1.__awaiter(this, void 0, void 0, function () { | ||
return tslib_1.__generator(this, function (_a) { | ||
return (0, tslib_1.__awaiter)(this, void 0, void 0, function () { | ||
return (0, tslib_1.__generator)(this, function (_a) { | ||
switch (_a.label) { | ||
@@ -14,0 +14,0 @@ case 0: return [4 /*yield*/, Promise.all(iters.map(function (i) { |
@@ -13,3 +13,3 @@ "use strict"; | ||
fastNext: function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}, | ||
@@ -16,0 +16,0 @@ next: function () { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./internal"), exports); | ||
(0, tslib_1.__exportStar)(require("./internal"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -5,14 +5,14 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
exports.StreamCustom = tslib_1.__importStar(require("./stream/stream-custom")); | ||
tslib_1.__exportStar(require("./fast-iterator"), exports); | ||
tslib_1.__exportStar(require("./fast-iterable"), exports); | ||
tslib_1.__exportStar(require("./stream/interface"), exports); | ||
tslib_1.__exportStar(require("./stream/streamable"), exports); | ||
tslib_1.__exportStar(require("./stream/stream-source"), exports); | ||
tslib_1.__exportStar(require("./async-stream/async-fast-iterator"), exports); | ||
tslib_1.__exportStar(require("./async-stream/async-fast-iterable"), exports); | ||
tslib_1.__exportStar(require("./async-stream/async-streamable"), exports); | ||
exports.AsyncStreamCustom = tslib_1.__importStar(require("./async-stream/async-stream-custom")); | ||
tslib_1.__exportStar(require("./async-stream/interface"), exports); | ||
tslib_1.__exportStar(require("./async-stream/async-stream-source"), exports); | ||
exports.StreamCustom = (0, tslib_1.__importStar)(require("./stream/stream-custom")); | ||
(0, tslib_1.__exportStar)(require("./fast-iterator"), exports); | ||
(0, tslib_1.__exportStar)(require("./fast-iterable"), exports); | ||
(0, tslib_1.__exportStar)(require("./stream/interface"), exports); | ||
(0, tslib_1.__exportStar)(require("./stream/streamable"), exports); | ||
(0, tslib_1.__exportStar)(require("./stream/stream-source"), exports); | ||
(0, tslib_1.__exportStar)(require("./async-stream/async-fast-iterator"), exports); | ||
(0, tslib_1.__exportStar)(require("./async-stream/async-fast-iterable"), exports); | ||
(0, tslib_1.__exportStar)(require("./async-stream/async-streamable"), exports); | ||
exports.AsyncStreamCustom = (0, tslib_1.__importStar)(require("./async-stream/async-stream-custom")); | ||
(0, tslib_1.__exportStar)(require("./async-stream/interface"), exports); | ||
(0, tslib_1.__exportStar)(require("./async-stream/async-stream-source"), exports); | ||
//# sourceMappingURL=internal.js.map |
@@ -10,3 +10,3 @@ "use strict"; | ||
var EmptyStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(EmptyStream, _super); | ||
(0, tslib_1.__extends)(EmptyStream, _super); | ||
function EmptyStream() { | ||
@@ -52,6 +52,6 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
EmptyStream.prototype.first = function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
EmptyStream.prototype.last = function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -68,6 +68,6 @@ EmptyStream.prototype.count = function () { | ||
EmptyStream.prototype.find = function (pred, occurrance, otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
EmptyStream.prototype.elementAt = function (index, otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -117,18 +117,18 @@ EmptyStream.prototype.indicesWhere = function () { | ||
return this; | ||
var _a = tslib_1.__read(others), source1 = _a[0], source2 = _a[1], sources = _a.slice(2); | ||
var _a = (0, tslib_1.__read)(others), source1 = _a[0], source2 = _a[1], sources = _a.slice(2); | ||
if (undefined === source2) | ||
return source1; | ||
return internal_1.Stream.from.apply(internal_1.Stream, tslib_1.__spreadArray([source1, source2], tslib_1.__read(sources))); | ||
return internal_1.Stream.from.apply(internal_1.Stream, (0, tslib_1.__spreadArray)([source1, source2], (0, tslib_1.__read)(sources), false)); | ||
}; | ||
EmptyStream.prototype.min = function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
EmptyStream.prototype.minBy = function (compare, otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
EmptyStream.prototype.max = function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
EmptyStream.prototype.maxBy = function (compare, otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -225,3 +225,3 @@ EmptyStream.prototype.intersperse = function () { | ||
} | ||
return exports.from(values); | ||
return (0, exports.from)(values); | ||
} | ||
@@ -244,8 +244,8 @@ exports.of = of; | ||
} | ||
var _b = tslib_1.__read(sources), first = _b[0], rest = _b.slice(1); | ||
var _b = (0, tslib_1.__read)(sources), first = _b[0], rest = _b.slice(1); | ||
if (rest.length <= 0) { | ||
return fromStreamSource(first); | ||
} | ||
var _c = tslib_1.__read(rest), rest1 = _c[0], restOther = _c.slice(1); | ||
return (_a = fromStreamSource(first)).concat.apply(_a, tslib_1.__spreadArray([rest1], tslib_1.__read(restOther))); | ||
var _c = (0, tslib_1.__read)(rest), rest1 = _c[0], restOther = _c.slice(1); | ||
return (_a = fromStreamSource(first)).concat.apply(_a, (0, tslib_1.__spreadArray)([rest1], (0, tslib_1.__read)(restOther), false)); | ||
}; | ||
@@ -290,3 +290,3 @@ exports.from = from; | ||
function fromObject(obj) { | ||
return exports.fromArray(Object.entries(obj)); | ||
return (0, exports.fromArray)(Object.entries(obj)); | ||
} | ||
@@ -302,3 +302,3 @@ exports.fromObject = fromObject; | ||
function fromObjectKeys(obj) { | ||
return exports.fromArray(Object.keys(obj)); | ||
return (0, exports.fromArray)(Object.keys(obj)); | ||
} | ||
@@ -314,3 +314,3 @@ exports.fromObjectKeys = fromObjectKeys; | ||
function fromObjectValues(obj) { | ||
return exports.fromArray(Object.values(obj)); | ||
return (0, exports.fromArray)(Object.values(obj)); | ||
} | ||
@@ -332,3 +332,3 @@ exports.fromObjectValues = fromObjectValues; | ||
if (reversed === void 0) { reversed = false; } | ||
return exports.fromArray(source, range, reversed); | ||
return (0, exports.fromArray)(source, range, reversed); | ||
}; | ||
@@ -364,3 +364,3 @@ exports.fromString = fromString; | ||
while (done !== (values = iter.fastNext(done))) { | ||
f.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(values)), tslib_1.__read(args))); | ||
f.apply(void 0, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(values), false), (0, tslib_1.__read)(args), false)); | ||
} | ||
@@ -530,3 +530,3 @@ } | ||
var ArrayIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ArrayIterator, _super); | ||
(0, tslib_1.__extends)(ArrayIterator, _super); | ||
function ArrayIterator(array, startIndex, endIndex) { | ||
@@ -542,3 +542,3 @@ var _this = _super.call(this) || this; | ||
if (this.i > this.endIndex) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.array[this.i++]; | ||
@@ -549,3 +549,3 @@ }; | ||
var ArrayReverseIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ArrayReverseIterator, _super); | ||
(0, tslib_1.__extends)(ArrayReverseIterator, _super); | ||
function ArrayReverseIterator(array, startIndex, endIndex) { | ||
@@ -560,3 +560,3 @@ var _this = _super.call(this) || this; | ||
if (this.i < this.startIndex) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.array[this.i--]; | ||
@@ -567,3 +567,3 @@ }; | ||
var ArrayStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(ArrayStream, _super); | ||
(0, tslib_1.__extends)(ArrayStream, _super); | ||
function ArrayStream(array, startIndex, endIndex, reversed) { | ||
@@ -588,3 +588,3 @@ if (startIndex === void 0) { startIndex = 0; } | ||
ArrayStream.prototype.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
var startIndex = this.startIndex; | ||
@@ -609,3 +609,3 @@ var endIndex = this.endIndex; | ||
if (this.length <= 0) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
if (!this.reversed) | ||
@@ -617,3 +617,3 @@ return this.array[this.startIndex]; | ||
if (this.length <= 0) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
if (!this.reversed) | ||
@@ -649,7 +649,7 @@ return this.array[this.endIndex]; | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
ArrayStream.prototype.elementAt = function (index, otherwise) { | ||
if (index < 0 || index >= this.length) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
if (!this.reversed) | ||
@@ -769,3 +769,3 @@ return this.array[index + this.startIndex]; | ||
var AlwaysStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(AlwaysStream, _super); | ||
(0, tslib_1.__extends)(AlwaysStream, _super); | ||
function AlwaysStream(value) { | ||
@@ -786,3 +786,3 @@ var _this = _super.call(this) || this; | ||
AlwaysStream.prototype.forEach = function (f, state) { | ||
var s = state !== null && state !== void 0 ? state : common_1.TraverseState(); | ||
var s = state !== null && state !== void 0 ? state : (0, common_1.TraverseState)(); | ||
var value = this.value; | ||
@@ -820,3 +820,3 @@ while (!s.halted) { | ||
var AlwaysIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(AlwaysIterator, _super); | ||
(0, tslib_1.__extends)(AlwaysIterator, _super); | ||
function AlwaysIterator(value) { | ||
@@ -833,3 +833,3 @@ var _this = _super.call(this) || this; | ||
var MapApplyIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(MapApplyIterator, _super); | ||
(0, tslib_1.__extends)(MapApplyIterator, _super); | ||
function MapApplyIterator(source, f, args) { | ||
@@ -847,4 +847,4 @@ var _this = _super.call(this) || this; | ||
if (done === next) | ||
return common_1.OptLazy(otherwise); | ||
return this.f.apply(this, tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(next)), tslib_1.__read(args))); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.f.apply(this, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(next), false), (0, tslib_1.__read)(args), false)); | ||
}; | ||
@@ -854,3 +854,3 @@ return MapApplyIterator; | ||
var MapApplyStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(MapApplyStream, _super); | ||
(0, tslib_1.__extends)(MapApplyStream, _super); | ||
function MapApplyStream(source, f, args) { | ||
@@ -869,3 +869,3 @@ var _this = _super.call(this) || this; | ||
var FilterApplyIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(FilterApplyIterator, _super); | ||
(0, tslib_1.__extends)(FilterApplyIterator, _super); | ||
function FilterApplyIterator(source, pred, args, invert) { | ||
@@ -887,3 +887,3 @@ var _this = _super.call(this) || this; | ||
while (done !== (next = iter.fastNext(done))) { | ||
if (!pred.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(next)), tslib_1.__read(args)))) | ||
if (!pred.apply(void 0, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(next), false), (0, tslib_1.__read)(args), false))) | ||
return next; | ||
@@ -894,7 +894,7 @@ } | ||
while (done !== (next = iter.fastNext(done))) { | ||
if (pred.apply(void 0, tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(next)), tslib_1.__read(args)))) | ||
if (pred.apply(void 0, (0, tslib_1.__spreadArray)((0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(next), false), (0, tslib_1.__read)(args), false))) | ||
return next; | ||
} | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -904,3 +904,3 @@ return FilterApplyIterator; | ||
var FilterApplyStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(FilterApplyStream, _super); | ||
(0, tslib_1.__extends)(FilterApplyStream, _super); | ||
function FilterApplyStream(source, pred, args, invert) { | ||
@@ -921,3 +921,3 @@ if (invert === void 0) { invert = false; } | ||
var RangeUpIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(RangeUpIterator, _super); | ||
(0, tslib_1.__extends)(RangeUpIterator, _super); | ||
function RangeUpIterator(start, end, delta) { | ||
@@ -935,3 +935,3 @@ if (start === void 0) { start = 0; } | ||
if (this.state > this.end) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -946,3 +946,3 @@ } | ||
var RangeDownIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(RangeDownIterator, _super); | ||
(0, tslib_1.__extends)(RangeDownIterator, _super); | ||
function RangeDownIterator(start, end, delta) { | ||
@@ -960,3 +960,3 @@ if (start === void 0) { start = 0; } | ||
if (this.state < this.end) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -971,3 +971,3 @@ } | ||
var RangeStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(RangeStream, _super); | ||
(0, tslib_1.__extends)(RangeStream, _super); | ||
function RangeStream(start, end, delta) { | ||
@@ -990,3 +990,3 @@ if (delta === void 0) { delta = 1; } | ||
var RandomIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(RandomIterator, _super); | ||
(0, tslib_1.__extends)(RandomIterator, _super); | ||
function RandomIterator() { | ||
@@ -1001,3 +1001,3 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
var RandomIntIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(RandomIntIterator, _super); | ||
(0, tslib_1.__extends)(RandomIntIterator, _super); | ||
function RandomIntIterator(min, max) { | ||
@@ -1016,3 +1016,3 @@ var _this = _super.call(this) || this; | ||
var UnfoldIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(UnfoldIterator, _super); | ||
(0, tslib_1.__extends)(UnfoldIterator, _super); | ||
function UnfoldIterator(init, getNext) { | ||
@@ -1028,3 +1028,3 @@ var _this = _super.call(this) || this; | ||
if (base_1.Token === current) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
if (this.index === 0) { | ||
@@ -1037,3 +1037,3 @@ this.index++; | ||
if (base_1.Token === next) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return next; | ||
@@ -1040,0 +1040,0 @@ }; |
@@ -5,4 +5,4 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
var Constructors = tslib_1.__importStar(require("./constructors")); | ||
var Constructors = (0, tslib_1.__importStar)(require("./constructors")); | ||
exports.Stream = Constructors; | ||
//# sourceMappingURL=interface.js.map |
@@ -57,3 +57,3 @@ "use strict"; | ||
StreamBase.prototype.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
if (state.halted) | ||
@@ -78,3 +78,3 @@ return; | ||
while (done !== (value = iterator.fastNext(done))) { | ||
f.apply(void 0, tslib_1.__spreadArray([value], tslib_1.__read(args))); | ||
f.apply(void 0, (0, tslib_1.__spreadArray)([value], (0, tslib_1.__read)(args), false)); | ||
} | ||
@@ -134,3 +134,3 @@ }; | ||
if (done === lastValue) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return lastValue; | ||
@@ -173,3 +173,3 @@ }; | ||
if (occurrance <= 0) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
@@ -184,7 +184,7 @@ var iterator = this[Symbol.iterator](); | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
StreamBase.prototype.elementAt = function (index, otherwise) { | ||
if (index < 0) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
@@ -199,3 +199,3 @@ var iterator = this[Symbol.iterator](); | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -307,3 +307,3 @@ StreamBase.prototype.indicesWhere = function (pred) { | ||
if (done === result) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var value; | ||
@@ -324,3 +324,3 @@ while (done !== (value = iterator.fastNext(done))) { | ||
if (done === result) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var value; | ||
@@ -457,3 +457,3 @@ while (done !== (value = iterator.fastNext(done))) { | ||
return internal_1.Stream.empty(); | ||
return new FromStream(function () { return new ZipWithIterator(tslib_1.__spreadArray([_this], tslib_1.__read(iters)), zipFun); }); | ||
return new FromStream(function () { return new ZipWithIterator((0, tslib_1.__spreadArray)([_this], (0, tslib_1.__read)(iters), false), zipFun); }); | ||
}; | ||
@@ -465,3 +465,3 @@ StreamBase.prototype.zip = function () { | ||
} | ||
return this.zipWith.apply(this, tslib_1.__spreadArray([Array], tslib_1.__read(iters))); | ||
return this.zipWith.apply(this, (0, tslib_1.__spreadArray)([Array], (0, tslib_1.__read)(iters), false)); | ||
}; | ||
@@ -475,3 +475,3 @@ StreamBase.prototype.zipAllWith = function (fillValue, zipFun) { | ||
return new FromStream(function () { | ||
return new ZipAllWithItererator(fillValue, tslib_1.__spreadArray([_this], tslib_1.__read(streams)), zipFun); | ||
return new ZipAllWithItererator(fillValue, (0, tslib_1.__spreadArray)([_this], (0, tslib_1.__read)(streams), false), zipFun); | ||
}); | ||
@@ -484,4 +484,4 @@ }; | ||
} | ||
return this.zipAllWith.apply(this, tslib_1.__spreadArray([fillValue, | ||
Array], tslib_1.__read(streams))); | ||
return this.zipAllWith.apply(this, (0, tslib_1.__spreadArray)([fillValue, | ||
Array], (0, tslib_1.__read)(streams), false)); | ||
}; | ||
@@ -508,3 +508,3 @@ StreamBase.prototype.unzip = function (length) { | ||
var FromStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromStream, _super); | ||
(0, tslib_1.__extends)(FromStream, _super); | ||
function FromStream(createIterator) { | ||
@@ -521,3 +521,3 @@ var _this = _super.call(this) || this; | ||
var PrependIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(PrependIterator, _super); | ||
(0, tslib_1.__extends)(PrependIterator, _super); | ||
function PrependIterator(source, item) { | ||
@@ -534,3 +534,3 @@ var _this = _super.call(this) || this; | ||
this.prependDone = true; | ||
return common_1.OptLazy(this.item); | ||
return (0, common_1.OptLazy)(this.item); | ||
}; | ||
@@ -540,3 +540,3 @@ return PrependIterator; | ||
var PrependStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(PrependStream, _super); | ||
(0, tslib_1.__extends)(PrependStream, _super); | ||
function PrependStream(source, item) { | ||
@@ -552,3 +552,3 @@ var _this = _super.call(this) || this; | ||
PrependStream.prototype.first = function () { | ||
return common_1.OptLazy(this.item); | ||
return (0, common_1.OptLazy)(this.item); | ||
}; | ||
@@ -562,6 +562,6 @@ PrependStream.prototype.last = function () { | ||
PrependStream.prototype.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
if (state.halted) | ||
return; | ||
f(common_1.OptLazy(this.item), state.nextIndex(), state.halt); | ||
f((0, common_1.OptLazy)(this.item), state.nextIndex(), state.halt); | ||
if (state.halted) | ||
@@ -574,3 +574,3 @@ return; | ||
var AppendIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(AppendIterator, _super); | ||
(0, tslib_1.__extends)(AppendIterator, _super); | ||
function AppendIterator(source, item) { | ||
@@ -585,3 +585,3 @@ var _this = _super.call(this) || this; | ||
if (this.appendDone) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
@@ -592,3 +592,3 @@ var value = this.source.fastNext(done); | ||
this.appendDone = true; | ||
return common_1.OptLazy(this.item); | ||
return (0, common_1.OptLazy)(this.item); | ||
}; | ||
@@ -598,3 +598,3 @@ return AppendIterator; | ||
var AppendStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(AppendStream, _super); | ||
(0, tslib_1.__extends)(AppendStream, _super); | ||
function AppendStream(source, item) { | ||
@@ -613,3 +613,3 @@ var _this = _super.call(this) || this; | ||
AppendStream.prototype.last = function () { | ||
return common_1.OptLazy(this.item); | ||
return (0, common_1.OptLazy)(this.item); | ||
}; | ||
@@ -620,3 +620,3 @@ AppendStream.prototype.count = function () { | ||
AppendStream.prototype.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
if (state.halted) | ||
@@ -627,3 +627,3 @@ return; | ||
return; | ||
f(common_1.OptLazy(this.item), state.nextIndex(), state.halt); | ||
f((0, common_1.OptLazy)(this.item), state.nextIndex(), state.halt); | ||
}; | ||
@@ -633,3 +633,3 @@ return AppendStream; | ||
var IndexedIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(IndexedIterator, _super); | ||
(0, tslib_1.__extends)(IndexedIterator, _super); | ||
function IndexedIterator(source, startIndex) { | ||
@@ -647,3 +647,3 @@ if (startIndex === void 0) { startIndex = 0; } | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return [this.index++, value]; | ||
@@ -654,3 +654,3 @@ }; | ||
var IndexedStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(IndexedStream, _super); | ||
(0, tslib_1.__extends)(IndexedStream, _super); | ||
function IndexedStream(source, startIndex) { | ||
@@ -671,3 +671,3 @@ var _this = _super.call(this) || this; | ||
var MapIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(MapIterator, _super); | ||
(0, tslib_1.__extends)(MapIterator, _super); | ||
function MapIterator(source, mapFun) { | ||
@@ -677,3 +677,3 @@ var _this = _super.call(this) || this; | ||
_this.mapFun = mapFun; | ||
_this.state = common_1.TraverseState(); | ||
_this.state = (0, common_1.TraverseState)(); | ||
return _this; | ||
@@ -684,7 +684,7 @@ } | ||
if (state.halted) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
var next = this.source.fastNext(done); | ||
if (done === next) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun(next, state.nextIndex()); | ||
@@ -695,3 +695,3 @@ }; | ||
var MapStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(MapStream, _super); | ||
(0, tslib_1.__extends)(MapStream, _super); | ||
function MapStream(source, mapFun) { | ||
@@ -710,3 +710,3 @@ var _this = _super.call(this) || this; | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun(value, 0); | ||
@@ -718,3 +718,3 @@ }; | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun(value, 0); | ||
@@ -729,3 +729,3 @@ }; | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun(value, index); | ||
@@ -742,3 +742,3 @@ }; | ||
var MapPureIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(MapPureIterator, _super); | ||
(0, tslib_1.__extends)(MapPureIterator, _super); | ||
function MapPureIterator(source, mapFun, args) { | ||
@@ -755,4 +755,4 @@ var _this = _super.call(this) || this; | ||
if (done === next) | ||
return common_1.OptLazy(otherwise); | ||
return this.mapFun.apply(this, tslib_1.__spreadArray([next], tslib_1.__read(this.args))); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun.apply(this, (0, tslib_1.__spreadArray)([next], (0, tslib_1.__read)(this.args), false)); | ||
}; | ||
@@ -762,3 +762,3 @@ return MapPureIterator; | ||
var MapPureStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(MapPureStream, _super); | ||
(0, tslib_1.__extends)(MapPureStream, _super); | ||
function MapPureStream(source, mapFun, args) { | ||
@@ -778,4 +778,4 @@ var _this = _super.call(this) || this; | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return this.mapFun.apply(this, tslib_1.__spreadArray([value], tslib_1.__read(this.args))); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun.apply(this, (0, tslib_1.__spreadArray)([value], (0, tslib_1.__read)(this.args), false)); | ||
}; | ||
@@ -786,4 +786,4 @@ MapPureStream.prototype.last = function (otherwise) { | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return this.mapFun.apply(this, tslib_1.__spreadArray([value], tslib_1.__read(this.args))); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun.apply(this, (0, tslib_1.__spreadArray)([value], (0, tslib_1.__read)(this.args), false)); | ||
}; | ||
@@ -797,4 +797,4 @@ MapPureStream.prototype.count = function () { | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return this.mapFun.apply(this, tslib_1.__spreadArray([value], tslib_1.__read(this.args))); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.mapFun.apply(this, (0, tslib_1.__spreadArray)([value], (0, tslib_1.__read)(this.args), false)); | ||
}; | ||
@@ -804,3 +804,3 @@ return MapPureStream; | ||
var FlatMapIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(FlatMapIterator, _super); | ||
(0, tslib_1.__extends)(FlatMapIterator, _super); | ||
function FlatMapIterator(source, flatMapFun) { | ||
@@ -810,3 +810,3 @@ var _this = _super.call(this) || this; | ||
_this.flatMapFun = flatMapFun; | ||
_this.state = common_1.TraverseState(); | ||
_this.state = (0, common_1.TraverseState)(); | ||
_this.done = false; | ||
@@ -820,3 +820,3 @@ _this.currentIterator = null; | ||
if (state.halted || this.done) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
@@ -829,3 +829,3 @@ var nextValue = done; | ||
this.done = true; | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -840,3 +840,3 @@ var nextSource = this.flatMapFun(nextIter, state.nextIndex(), state.halt); | ||
var FlatMapStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(FlatMapStream, _super); | ||
(0, tslib_1.__extends)(FlatMapStream, _super); | ||
function FlatMapStream(source, flatmapFun) { | ||
@@ -854,3 +854,3 @@ var _this = _super.call(this) || this; | ||
var ConcatIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ConcatIterator, _super); | ||
(0, tslib_1.__extends)(ConcatIterator, _super); | ||
function ConcatIterator(source, otherSources) { | ||
@@ -870,7 +870,7 @@ var _this = _super.call(this) || this; | ||
if (this.sourceIndex >= length) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var nextSource = this.otherSources[this.sourceIndex++]; | ||
while (internal_1.StreamSource.isEmptyInstance(nextSource)) { | ||
if (this.sourceIndex >= length) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
nextSource = this.otherSources[this.sourceIndex++]; | ||
@@ -885,3 +885,3 @@ } | ||
var ConcatStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(ConcatStream, _super); | ||
(0, tslib_1.__extends)(ConcatStream, _super); | ||
function ConcatStream(source, otherSources) { | ||
@@ -897,3 +897,3 @@ var _this = _super.call(this) || this; | ||
ConcatStream.prototype.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
if (state.halted) | ||
@@ -962,3 +962,3 @@ return; | ||
var FilterIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(FilterIterator, _super); | ||
(0, tslib_1.__extends)(FilterIterator, _super); | ||
function FilterIterator(source, pred, invert) { | ||
@@ -969,3 +969,3 @@ var _this = _super.call(this) || this; | ||
_this.invert = invert; | ||
_this.state = common_1.TraverseState(); | ||
_this.state = (0, common_1.TraverseState)(); | ||
return _this; | ||
@@ -976,3 +976,3 @@ } | ||
if (state.halted) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
@@ -995,3 +995,3 @@ var value; | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1001,3 +1001,3 @@ return FilterIterator; | ||
var FilterStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(FilterStream, _super); | ||
(0, tslib_1.__extends)(FilterStream, _super); | ||
function FilterStream(source, pred, invert) { | ||
@@ -1021,3 +1021,3 @@ if (invert === void 0) { invert = false; } | ||
var FilterPureIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(FilterPureIterator, _super); | ||
(0, tslib_1.__extends)(FilterPureIterator, _super); | ||
function FilterPureIterator(source, pred, args, invert) { | ||
@@ -1039,3 +1039,3 @@ var _this = _super.call(this) || this; | ||
while (done !== (value = source.fastNext(done))) { | ||
if (!pred.apply(void 0, tslib_1.__spreadArray([value], tslib_1.__read(args)))) | ||
if (!pred.apply(void 0, (0, tslib_1.__spreadArray)([value], (0, tslib_1.__read)(args), false))) | ||
return value; | ||
@@ -1046,7 +1046,7 @@ } | ||
while (done !== (value = source.fastNext(done))) { | ||
if (pred.apply(void 0, tslib_1.__spreadArray([value], tslib_1.__read(args)))) | ||
if (pred.apply(void 0, (0, tslib_1.__spreadArray)([value], (0, tslib_1.__read)(args), false))) | ||
return value; | ||
} | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1056,3 +1056,3 @@ return FilterPureIterator; | ||
var FilterPureStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(FilterPureStream, _super); | ||
(0, tslib_1.__extends)(FilterPureStream, _super); | ||
function FilterPureStream(source, pred, args, invert) { | ||
@@ -1073,3 +1073,3 @@ if (invert === void 0) { invert = false; } | ||
var CollectIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(CollectIterator, _super); | ||
(0, tslib_1.__extends)(CollectIterator, _super); | ||
function CollectIterator(source, collectFun) { | ||
@@ -1079,3 +1079,3 @@ var _this = _super.call(this) || this; | ||
_this.collectFun = collectFun; | ||
_this.state = common_1.TraverseState(); | ||
_this.state = (0, common_1.TraverseState)(); | ||
return _this; | ||
@@ -1086,3 +1086,3 @@ } | ||
if (state.halted) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var halt = state.halt; | ||
@@ -1099,3 +1099,3 @@ var done = Symbol('Done'); | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1105,3 +1105,3 @@ return CollectIterator; | ||
var CollectStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(CollectStream, _super); | ||
(0, tslib_1.__extends)(CollectStream, _super); | ||
function CollectStream(source, collectFun) { | ||
@@ -1119,3 +1119,3 @@ var _this = _super.call(this) || this; | ||
var IndicesWhereIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(IndicesWhereIterator, _super); | ||
(0, tslib_1.__extends)(IndicesWhereIterator, _super); | ||
function IndicesWhereIterator(source, pred) { | ||
@@ -1138,3 +1138,3 @@ var _this = _super.call(this) || this; | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1144,3 +1144,3 @@ return IndicesWhereIterator; | ||
var IndicesWhereStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(IndicesWhereStream, _super); | ||
(0, tslib_1.__extends)(IndicesWhereStream, _super); | ||
function IndicesWhereStream(source, pred) { | ||
@@ -1158,3 +1158,3 @@ var _this = _super.call(this) || this; | ||
var IndicesOfIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(IndicesOfIterator, _super); | ||
(0, tslib_1.__extends)(IndicesOfIterator, _super); | ||
function IndicesOfIterator(source, searchValue, eq) { | ||
@@ -1179,3 +1179,3 @@ var _this = _super.call(this) || this; | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1185,3 +1185,3 @@ return IndicesOfIterator; | ||
var IndicesOfStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(IndicesOfStream, _super); | ||
(0, tslib_1.__extends)(IndicesOfStream, _super); | ||
function IndicesOfStream(source, searchValue, eq) { | ||
@@ -1200,3 +1200,3 @@ var _this = _super.call(this) || this; | ||
var TakeWhileIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(TakeWhileIterator, _super); | ||
(0, tslib_1.__extends)(TakeWhileIterator, _super); | ||
function TakeWhileIterator(source, pred) { | ||
@@ -1213,7 +1213,7 @@ var _this = _super.call(this) || this; | ||
if (this.isDone) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var next = this.source.fastNext(done); | ||
if (done === next) { | ||
this.isDone = true; | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -1223,3 +1223,3 @@ if (this.pred(next, this.index++)) | ||
this.isDone = true; | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1229,3 +1229,3 @@ return TakeWhileIterator; | ||
var TakeWhileStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(TakeWhileStream, _super); | ||
(0, tslib_1.__extends)(TakeWhileStream, _super); | ||
function TakeWhileStream(source, pred) { | ||
@@ -1243,3 +1243,3 @@ var _this = _super.call(this) || this; | ||
var DropWhileIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(DropWhileIterator, _super); | ||
(0, tslib_1.__extends)(DropWhileIterator, _super); | ||
function DropWhileIterator(source, pred) { | ||
@@ -1264,3 +1264,3 @@ var _this = _super.call(this) || this; | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1270,3 +1270,3 @@ return DropWhileIterator; | ||
var DropWhileStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(DropWhileStream, _super); | ||
(0, tslib_1.__extends)(DropWhileStream, _super); | ||
function DropWhileStream(source, pred) { | ||
@@ -1284,3 +1284,3 @@ var _this = _super.call(this) || this; | ||
var TakeIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(TakeIterator, _super); | ||
(0, tslib_1.__extends)(TakeIterator, _super); | ||
function TakeIterator(source, amount) { | ||
@@ -1295,3 +1295,3 @@ var _this = _super.call(this) || this; | ||
if (this.i++ >= this.amount) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return this.source.fastNext(otherwise); | ||
@@ -1302,3 +1302,3 @@ }; | ||
var TakeStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(TakeStream, _super); | ||
(0, tslib_1.__extends)(TakeStream, _super); | ||
function TakeStream(source, amount) { | ||
@@ -1321,3 +1321,3 @@ var _this = _super.call(this) || this; | ||
var DropIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(DropIterator, _super); | ||
(0, tslib_1.__extends)(DropIterator, _super); | ||
function DropIterator(source, amount) { | ||
@@ -1340,3 +1340,3 @@ var _this = _super.call(this) || this; | ||
} | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -1346,3 +1346,3 @@ return DropIterator; | ||
var DropStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(DropStream, _super); | ||
(0, tslib_1.__extends)(DropStream, _super); | ||
function DropStream(source, amount) { | ||
@@ -1365,3 +1365,3 @@ var _this = _super.call(this) || this; | ||
var RepeatIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(RepeatIterator, _super); | ||
(0, tslib_1.__extends)(RepeatIterator, _super); | ||
function RepeatIterator(source, amount) { | ||
@@ -1384,7 +1384,7 @@ var _this = _super.call(this) || this; | ||
if (this.isEmpty) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
if (undefined !== this.remain) { | ||
this.remain--; | ||
if (this.remain <= 0) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -1394,3 +1394,3 @@ this.iterator = this.source[Symbol.iterator](); | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return value; | ||
@@ -1401,3 +1401,3 @@ }; | ||
var IntersperseIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(IntersperseIterator, _super); | ||
(0, tslib_1.__extends)(IntersperseIterator, _super); | ||
function IntersperseIterator(source, sepStream) { | ||
@@ -1431,3 +1431,3 @@ var _this = _super.call(this) || this; | ||
if (done === nextValue) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var newNextValue = this.source.fastNext(done); | ||
@@ -1444,3 +1444,3 @@ if (done === newNextValue) | ||
var IntersperseStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(IntersperseStream, _super); | ||
(0, tslib_1.__extends)(IntersperseStream, _super); | ||
function IntersperseStream(source, sepStream) { | ||
@@ -1458,3 +1458,3 @@ var _this = _super.call(this) || this; | ||
var SplitWhereIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(SplitWhereIterator, _super); | ||
(0, tslib_1.__extends)(SplitWhereIterator, _super); | ||
function SplitWhereIterator(source, pred) { | ||
@@ -1480,3 +1480,3 @@ var _this = _super.call(this) || this; | ||
if (startIndex === this.index) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return result; | ||
@@ -1487,3 +1487,3 @@ }; | ||
var SplitWhereStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(SplitWhereStream, _super); | ||
(0, tslib_1.__extends)(SplitWhereStream, _super); | ||
function SplitWhereStream(source, pred) { | ||
@@ -1501,3 +1501,3 @@ var _this = _super.call(this) || this; | ||
var SplitOnIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(SplitOnIterator, _super); | ||
(0, tslib_1.__extends)(SplitOnIterator, _super); | ||
function SplitOnIterator(source, sepElem, eq) { | ||
@@ -1525,3 +1525,3 @@ var _this = _super.call(this) || this; | ||
if (!processed) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return result; | ||
@@ -1532,3 +1532,3 @@ }; | ||
var SplitOnStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(SplitOnStream, _super); | ||
(0, tslib_1.__extends)(SplitOnStream, _super); | ||
function SplitOnStream(source, sepElem, eq) { | ||
@@ -1547,3 +1547,3 @@ var _this = _super.call(this) || this; | ||
var ReduceIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ReduceIterator, _super); | ||
(0, tslib_1.__extends)(ReduceIterator, _super); | ||
function ReduceIterator(source, reducer) { | ||
@@ -1563,7 +1563,7 @@ var _this = _super.call(this) || this; | ||
if (this.halted) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
var value = this.source.fastNext(done); | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var reducer = this.reducer; | ||
@@ -1576,3 +1576,3 @@ this.state = reducer.next(this.state, value, this.index++, this.halt); | ||
var ReduceStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(ReduceStream, _super); | ||
(0, tslib_1.__extends)(ReduceStream, _super); | ||
function ReduceStream(source, reducerDef) { | ||
@@ -1590,3 +1590,3 @@ var _this = _super.call(this) || this; | ||
var ReduceAllIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ReduceAllIterator, _super); | ||
(0, tslib_1.__extends)(ReduceAllIterator, _super); | ||
function ReduceAllIterator(source, reducers) { | ||
@@ -1607,7 +1607,7 @@ var _this = _super.call(this) || this; | ||
if (this.halted || this.isDone) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var done = Symbol('Done'); | ||
var value = this.source.fastNext(done); | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var reducers = this.reducers; | ||
@@ -1627,3 +1627,3 @@ var length = reducers.length; | ||
if (!anyNotDone) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
this.index++; | ||
@@ -1637,3 +1637,3 @@ return this.state.map(function (s, i) { | ||
var ReduceAllStream = /** @class */ (function (_super) { | ||
tslib_1.__extends(ReduceAllStream, _super); | ||
(0, tslib_1.__extends)(ReduceAllStream, _super); | ||
function ReduceAllStream(source, reducers) { | ||
@@ -1660,3 +1660,3 @@ var _this = _super.call(this) || this; | ||
if (result.done) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
return result.value; | ||
@@ -1667,3 +1667,3 @@ }; | ||
var FromIterable = /** @class */ (function (_super) { | ||
tslib_1.__extends(FromIterable, _super); | ||
(0, tslib_1.__extends)(FromIterable, _super); | ||
function FromIterable(iterable) { | ||
@@ -1684,3 +1684,3 @@ var _this = _super.call(this) || this; | ||
var ZipWithIterator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ZipWithIterator, _super); | ||
(0, tslib_1.__extends)(ZipWithIterator, _super); | ||
function ZipWithIterator(iterables, zipFun) { | ||
@@ -1701,6 +1701,6 @@ var _this = _super.call(this) || this; | ||
if (done === value) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
result.push(value); | ||
} | ||
return this.zipFun.apply(this, tslib_1.__spreadArray([], tslib_1.__read(result))); | ||
return this.zipFun.apply(this, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(result), false)); | ||
}; | ||
@@ -1710,3 +1710,3 @@ return ZipWithIterator; | ||
var ZipAllWithItererator = /** @class */ (function (_super) { | ||
tslib_1.__extends(ZipAllWithItererator, _super); | ||
(0, tslib_1.__extends)(ZipAllWithItererator, _super); | ||
function ZipAllWithItererator(fillValue, iters, zipFun) { | ||
@@ -1723,3 +1723,3 @@ var _this = _super.call(this) || this; | ||
if (this.allDone) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
var result = []; | ||
@@ -1734,3 +1734,3 @@ var sourceIndex = -1; | ||
if (done === value) { | ||
result.push(common_1.OptLazy(fillValue)); | ||
result.push((0, common_1.OptLazy)(fillValue)); | ||
} | ||
@@ -1744,5 +1744,5 @@ else { | ||
this.allDone = true; | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
return this.zipFun.apply(this, tslib_1.__spreadArray([], tslib_1.__read(result))); | ||
return this.zipFun.apply(this, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(result), false)); | ||
}; | ||
@@ -1749,0 +1749,0 @@ return ZipAllWithItererator; |
{ | ||
"name": "@rimbu/stream", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "Efficient structure representing a sequence of elements, with powerful operations for TypeScript", | ||
@@ -61,5 +61,5 @@ "keywords": [ | ||
"dependencies": { | ||
"@rimbu/base": "^0.6.5", | ||
"@rimbu/common": "^0.7.3", | ||
"tslib": "^2.3.0" | ||
"@rimbu/base": "^0.6.6", | ||
"@rimbu/common": "^0.7.4", | ||
"tslib": "^2.3.1" | ||
}, | ||
@@ -72,3 +72,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "f6fad673f48ce3d44d6b0f931c0182c8231526ca" | ||
"gitHead": "e509f9938fad6253702f6b78eb9f8e3b3a8f92ac" | ||
} |
@@ -25,6 +25,8 @@ <p align="center"> | ||
All types are exported through [`@rimbu/core`](../core). It is recommended to use this package. | ||
All types are exported through [`@rimbu/core`](../core). It is recommended to use that package. | ||
To install separately: | ||
### Yarn/NPM | ||
> `yarn add @rimbu/stream` | ||
@@ -36,4 +38,30 @@ | ||
### recommended tsconfig settings | ||
### Deno | ||
Create a file called `rimbu.ts` and add the following: | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/stream/mod.ts'; | ||
> ``` | ||
Or using a pinned version (`x.y.z`): | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/stream@x.y.z/mod.ts'; | ||
> ``` | ||
Then import what you need from `rimbu.ts`: | ||
```ts | ||
import { Stream } from './rimbu.ts'; | ||
``` | ||
Because Rimbu uses complex types, it's recommended to use the `--no-check` flag (your editor should already have checked your code) and to specify a `tsconfig.json` file with the settings described below. | ||
Running your script then becomes: | ||
> `deno run --no-check --config tsconfig.json <your-script>.ts` | ||
## Recommended `tsconfig.json` settings | ||
Rimbu uses advanced and recursive typing, potentially making the TypeScript compiler quite slow in some cases, or causing infinite recursion. It is recommended to set the following values in the `tsconfig.json` file of your project: | ||
@@ -40,0 +68,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1048865
103
Updated@rimbu/base@^0.6.6
Updated@rimbu/common@^0.7.4
Updatedtslib@^2.3.1