@rimbu/list
Advanced tools
Comparing version 0.7.3 to 0.7.4
@@ -17,3 +17,3 @@ "use strict"; | ||
-index > _this.length) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -29,3 +29,3 @@ if (index < 0) | ||
-index > _this.length) | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
if (index < 0) | ||
@@ -99,3 +99,3 @@ return _this.updateAt(_this.length + index, update); | ||
-index > _this.length) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -109,3 +109,3 @@ if (index < 0) | ||
this.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
if (state.halted) | ||
@@ -112,0 +112,0 @@ return; |
@@ -77,3 +77,3 @@ "use strict"; | ||
var oldValue = this.children[index]; | ||
var newValue = common_1.Update(oldValue, update); | ||
var newValue = (0, common_1.Update)(oldValue, update); | ||
this.children[index] = newValue; | ||
@@ -97,3 +97,3 @@ if (!Object.is(oldValue, newValue)) | ||
LeafBlockBuilder.prototype.remove = function (index) { | ||
var _a = tslib_1.__read(this.children.splice(index, 1), 1), item = _a[0]; | ||
var _a = (0, tslib_1.__read)(this.children.splice(index, 1), 1), item = _a[0]; | ||
this.source = undefined; | ||
@@ -130,3 +130,3 @@ return item; | ||
LeafBlockBuilder.prototype.forEach = function (f, state) { | ||
if (state === void 0) { state = common_1.TraverseState(); } | ||
if (state === void 0) { state = (0, common_1.TraverseState)(); } | ||
base_1.Arr.forEach(this.children, f, state); | ||
@@ -133,0 +133,0 @@ }; |
@@ -21,3 +21,3 @@ "use strict"; | ||
if (undefined !== this.source) { | ||
this._children = this.source.children.map(function (c) { return list_custom_1.createFromBlock(c); }); | ||
this._children = this.source.children.map(function (c) { return (0, list_custom_1.createFromBlock)(c); }); | ||
this.source = undefined; | ||
@@ -29,3 +29,3 @@ } | ||
if (undefined !== this.source) { | ||
this._children = this.source.children.map(function (c) { return list_custom_1.createFromBlock(c); }); | ||
this._children = this.source.children.map(function (c) { return (0, list_custom_1.createFromBlock)(c); }); | ||
this.source = undefined; | ||
@@ -101,7 +101,7 @@ } | ||
return this.source.get(index); | ||
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
return this.children[childIndex].get(inChildIndex, base_1.RimbuError.throwInvalidStateError); | ||
}; | ||
NonLeafBlockBuilder.prototype.updateAt = function (index, update, otherwise) { | ||
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
return this.children[childIndex].updateAt(inChildIndex, update, otherwise); | ||
@@ -118,3 +118,3 @@ }; | ||
NonLeafBlockBuilder.prototype.insert = function (index, value) { | ||
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
this.length++; | ||
@@ -143,3 +143,3 @@ var child = this.children[childIndex]; | ||
NonLeafBlockBuilder.prototype.remove = function (index) { | ||
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
this.length--; | ||
@@ -217,3 +217,3 @@ var child = this.children[childIndex]; | ||
NonLeafBlockBuilder.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) | ||
@@ -220,0 +220,0 @@ return; |
@@ -7,3 +7,3 @@ "use strict"; | ||
var NonLeafTreeBuilder = /** @class */ (function (_super) { | ||
tslib_1.__extends(NonLeafTreeBuilder, _super); | ||
(0, tslib_1.__extends)(NonLeafTreeBuilder, _super); | ||
function NonLeafTreeBuilder(context, level, source, _left, _right, _middle, length) { | ||
@@ -24,8 +24,8 @@ if (length === void 0) { length = (_a = source === null || source === void 0 ? void 0 : source.length) !== null && _a !== void 0 ? _a : 0; } | ||
if (undefined !== this.source) { | ||
this._left = list_custom_1.createFromBlock(this.source.left); | ||
this._right = list_custom_1.createFromBlock(this.source.right); | ||
this._left = (0, list_custom_1.createFromBlock)(this.source.left); | ||
this._right = (0, list_custom_1.createFromBlock)(this.source.right); | ||
this._middle = | ||
null === this.source.middle | ||
? undefined | ||
: list_custom_1.createNonLeaf(this.source.middle); | ||
: (0, list_custom_1.createNonLeaf)(this.source.middle); | ||
this.source = undefined; | ||
@@ -32,0 +32,0 @@ } |
@@ -360,3 +360,3 @@ "use strict"; | ||
TreeBuilderBase.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) | ||
@@ -378,3 +378,3 @@ return; | ||
var LeafTreeBuilder = /** @class */ (function (_super) { | ||
tslib_1.__extends(LeafTreeBuilder, _super); | ||
(0, tslib_1.__extends)(LeafTreeBuilder, _super); | ||
function LeafTreeBuilder(context, source, _left, _right, _middle, length) { | ||
@@ -399,3 +399,3 @@ if (length === void 0) { length = (_a = source === null || source === void 0 ? void 0 : source.length) !== null && _a !== void 0 ? _a : 0; } | ||
? undefined | ||
: list_custom_1.createNonLeaf(this.source.middle); | ||
: (0, list_custom_1.createNonLeaf)(this.source.middle); | ||
this.source = undefined; | ||
@@ -505,3 +505,3 @@ } | ||
var NonLeafTreeBuilder = /** @class */ (function (_super) { | ||
tslib_1.__extends(NonLeafTreeBuilder, _super); | ||
(0, tslib_1.__extends)(NonLeafTreeBuilder, _super); | ||
function NonLeafTreeBuilder(context, level, source, _left, _right, _middle, length) { | ||
@@ -522,8 +522,8 @@ if (length === void 0) { length = (_a = source === null || source === void 0 ? void 0 : source.length) !== null && _a !== void 0 ? _a : 0; } | ||
if (undefined !== this.source) { | ||
this._left = list_custom_1.createFromBlock(this.source.left); | ||
this._right = list_custom_1.createFromBlock(this.source.right); | ||
this._left = (0, list_custom_1.createFromBlock)(this.source.left); | ||
this._right = (0, list_custom_1.createFromBlock)(this.source.right); | ||
this._middle = | ||
null === this.source.middle | ||
? undefined | ||
: list_custom_1.createNonLeaf(this.source.middle); | ||
: (0, list_custom_1.createNonLeaf)(this.source.middle); | ||
this.source = undefined; | ||
@@ -530,0 +530,0 @@ } |
@@ -76,3 +76,3 @@ "use strict"; | ||
} | ||
return _this.from.apply(_this, tslib_1.__spreadArray([], tslib_1.__read(sources))); | ||
return _this.from.apply(_this, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false)); | ||
}; | ||
@@ -79,0 +79,0 @@ this.reducer = function (source) { |
@@ -9,3 +9,3 @@ "use strict"; | ||
var Empty = /** @class */ (function (_super) { | ||
tslib_1.__extends(Empty, _super); | ||
(0, tslib_1.__extends)(Empty, _super); | ||
function Empty(context) { | ||
@@ -20,9 +20,9 @@ var _this = _super.call(this) || this; | ||
Empty.prototype.first = function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
Empty.prototype.last = function (otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
Empty.prototype.get = function (index, otherwise) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
}; | ||
@@ -61,3 +61,3 @@ Empty.prototype.prepend = function (value) { | ||
} | ||
return (_a = this.context).from.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(sources))); | ||
return (_a = this.context).from.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false)); | ||
}; | ||
@@ -64,0 +64,0 @@ Empty.prototype.repeat = function () { |
@@ -12,3 +12,3 @@ "use strict"; | ||
var ListNonEmptyBase = /** @class */ (function (_super) { | ||
tslib_1.__extends(ListNonEmptyBase, _super); | ||
(0, tslib_1.__extends)(ListNonEmptyBase, _super); | ||
function ListNonEmptyBase() { | ||
@@ -51,3 +51,3 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
return this.context.empty(); | ||
var _a = tslib_1.__read(result, 2), start = _a[0], end = _a[1]; | ||
var _a = (0, tslib_1.__read)(result, 2), start = _a[0], end = _a[1]; | ||
var values = this.drop(start).take(end - start + 1); | ||
@@ -171,3 +171,3 @@ if (!reversed) | ||
var LeafBlock = /** @class */ (function (_super) { | ||
tslib_1.__extends(LeafBlock, _super); | ||
(0, tslib_1.__extends)(LeafBlock, _super); | ||
function LeafBlock(context, children) { | ||
@@ -239,3 +239,3 @@ var _this = _super.call(this) || this; | ||
if (index >= this.length || -index > this.length) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -312,3 +312,3 @@ if (index < 0) { | ||
} | ||
var asList = (_a = this.context).from.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(sources))); | ||
var asList = (_a = this.context).from.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false)); | ||
if (asList.nonEmpty()) { | ||
@@ -346,3 +346,3 @@ if (this.context.isLeafBlock(asList)) | ||
var newChildren = base_1.Arr.update(this.children, index, function (c) { | ||
return common_1.Update(c, update); | ||
return (0, common_1.Update)(c, update); | ||
}); | ||
@@ -352,3 +352,3 @@ return this.copy(newChildren); | ||
LeafBlock.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) | ||
@@ -394,3 +394,3 @@ return; | ||
else { | ||
var _a = tslib_1.__read(indexRange, 2), start = _a[0], end = _a[1]; | ||
var _a = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1]; | ||
if (!reversed) | ||
@@ -412,3 +412,3 @@ return this.children.slice(start, end + 1); | ||
var ReversedLeafBlock = /** @class */ (function (_super) { | ||
tslib_1.__extends(ReversedLeafBlock, _super); | ||
(0, tslib_1.__extends)(ReversedLeafBlock, _super); | ||
function ReversedLeafBlock() { | ||
@@ -442,3 +442,3 @@ return _super !== null && _super.apply(this, arguments) || this; | ||
if (index >= this.length || -index > this.length) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -500,3 +500,3 @@ if (index < 0) { | ||
else { | ||
var _a = tslib_1.__read(indexRange, 2), indexStart = _a[0], indexEnd = _a[1]; | ||
var _a = (0, tslib_1.__read)(indexRange, 2), indexStart = _a[0], indexEnd = _a[1]; | ||
var start = this.length - 1 - indexEnd; | ||
@@ -525,3 +525,3 @@ var end = this.length - 1 - indexStart; | ||
var LeafTree = /** @class */ (function (_super) { | ||
tslib_1.__extends(LeafTree, _super); | ||
(0, tslib_1.__extends)(LeafTree, _super); | ||
function LeafTree(context, left, right, middle, length) { | ||
@@ -555,11 +555,11 @@ if (length === void 0) { length = left.length + | ||
if (reversed === void 0) { reversed = false; } | ||
return list_custom_1.treeStream(this, undefined, reversed); | ||
return (0, list_custom_1.treeStream)(this, undefined, reversed); | ||
}; | ||
LeafTree.prototype.streamRange = function (range, reversed) { | ||
if (reversed === void 0) { reversed = false; } | ||
return list_custom_1.treeStream(this, range, reversed); | ||
return (0, list_custom_1.treeStream)(this, range, reversed); | ||
}; | ||
LeafTree.prototype.get = function (index, otherwise) { | ||
if (index >= this.length || -index > this.length) { | ||
return common_1.OptLazy(otherwise); | ||
return (0, common_1.OptLazy)(otherwise); | ||
} | ||
@@ -569,9 +569,9 @@ if (index < 0) { | ||
} | ||
return list_custom_1.treeGet(this, index); | ||
return (0, list_custom_1.treeGet)(this, index); | ||
}; | ||
LeafTree.prototype.prepend = function (value) { | ||
return list_custom_1.treePrepend(this, value); | ||
return (0, list_custom_1.treePrepend)(this, value); | ||
}; | ||
LeafTree.prototype.append = function (value) { | ||
return list_custom_1.treeAppend(this, value); | ||
return (0, list_custom_1.treeAppend)(this, value); | ||
}; | ||
@@ -604,3 +604,3 @@ LeafTree.prototype.prependMiddle = function (child) { | ||
} | ||
var _a = tslib_1.__read(this.middle.takeInternal(middleAmount), 3), newMiddle = _a[0], upRight = _a[1], inUpRight = _a[2]; | ||
var _a = (0, tslib_1.__read)(this.middle.takeInternal(middleAmount), 3), newMiddle = _a[0], upRight = _a[1], inUpRight = _a[2]; | ||
var newRight = upRight.takeChildren(inUpRight); | ||
@@ -628,3 +628,3 @@ return this.copy(undefined, newRight, newMiddle)._normalize(); | ||
} | ||
var _a = tslib_1.__read(this.middle.dropInternal(middleAmount), 3), newMiddle = _a[0], upLeft = _a[1], inUpLeft = _a[2]; | ||
var _a = (0, tslib_1.__read)(this.middle.dropInternal(middleAmount), 3), newMiddle = _a[0], upLeft = _a[1], inUpLeft = _a[2]; | ||
var newLeft = upLeft.dropChildren(inUpLeft); | ||
@@ -639,3 +639,3 @@ return this.copy(newLeft, undefined, newMiddle)._normalize(); | ||
} | ||
var asList = (_a = this.context).from.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(sources))); | ||
var asList = (_a = this.context).from.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false)); | ||
if (asList.nonEmpty()) { | ||
@@ -677,3 +677,3 @@ if (this.context.isLeafBlock(asList)) | ||
} | ||
var _a = tslib_1.__read(this.middle.dropLast(), 2), newMiddle_4 = _a[0], toJoint = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.middle.dropLast(), 2), newMiddle_4 = _a[0], toJoint = _a[1]; | ||
var joint_2 = toJoint | ||
@@ -724,9 +724,9 @@ .concatChildren(this.right) | ||
return this.updateAt(this.length + index, update); | ||
return list_custom_1.treeUpdate(this, index, update); | ||
return (0, list_custom_1.treeUpdate)(this, index, update); | ||
}; | ||
LeafTree.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; | ||
list_custom_1.treeForEach(this, f, state); | ||
(0, list_custom_1.treeForEach)(this, f, state); | ||
}; | ||
@@ -759,3 +759,3 @@ LeafTree.prototype.map = function (mapFun, reversed, indexOffset) { | ||
if (reversed === void 0) { reversed = false; } | ||
return list_custom_1.treeToArray(this, range, reversed); | ||
return (0, list_custom_1.treeToArray)(this, range, reversed); | ||
}; | ||
@@ -762,0 +762,0 @@ LeafTree.prototype._normalize = function () { |
@@ -82,5 +82,5 @@ "use strict"; | ||
return stream_1.Stream.empty(); | ||
var _a = tslib_1.__read(indexRange, 2), start = _a[0], end = _a[1]; | ||
var _b = tslib_1.__read(this.getCoordinates(start, false, true), 2), startChildIndex = _b[0], inStartChildIndex = _b[1]; | ||
var _c = tslib_1.__read(this.getCoordinates(end, false, true), 2), endChildIndex = _c[0], inEndChildIndex = _c[1]; | ||
var _a = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1]; | ||
var _b = (0, tslib_1.__read)(this.getCoordinates(start, false, true), 2), startChildIndex = _b[0], inStartChildIndex = _b[1]; | ||
var _c = (0, tslib_1.__read)(this.getCoordinates(end, false, true), 2), endChildIndex = _c[0], inEndChildIndex = _c[1]; | ||
if (startChildIndex === endChildIndex) { | ||
@@ -105,3 +105,3 @@ var child = this.children[startChildIndex]; | ||
NonLeafBlock.prototype.get = function (index) { | ||
var _a = tslib_1.__read(this.getCoordinates(index, false, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(index, false, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
return this.getChild(childIndex).get(inChildIndex, base_1.RimbuError.throwInvalidStateError); | ||
@@ -194,3 +194,3 @@ }; | ||
NonLeafBlock.prototype.takeInternal = function (amount) { | ||
var _a = tslib_1.__read(this.getCoordinates(amount, true, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(amount, true, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var lastChild = this.getChild(childIndex); | ||
@@ -202,3 +202,3 @@ var newSelf = this.takeChildren(childIndex); | ||
NonLeafBlock.prototype.dropInternal = function (amount) { | ||
var _a = tslib_1.__read(this.getCoordinates(amount, false, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(amount, false, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var firstChild = this.getChild(childIndex); | ||
@@ -212,3 +212,3 @@ var newSelf = this.dropChildren(childIndex + 1); | ||
NonLeafBlock.prototype.updateAt = function (index, update) { | ||
var _a = tslib_1.__read(this.getCoordinates(index, false, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(index, false, false), 2), childIndex = _a[0], inChildIndex = _a[1]; | ||
var newChildren = base_1.Arr.update(this.children, childIndex, function (child) { return child.updateAt(inChildIndex, update); }); | ||
@@ -271,4 +271,4 @@ return this.copy(newChildren); | ||
} | ||
var _a = tslib_1.__read(this.getCoordinates(start, false, true), 2), startChildIndex = _a[0], inStartChildIndex = _a[1]; | ||
var _b = tslib_1.__read(this.getCoordinates(end, false, true), 2), endChildIndex = _b[0], inEndChildIndex = _b[1]; | ||
var _a = (0, tslib_1.__read)(this.getCoordinates(start, false, true), 2), startChildIndex = _a[0], inStartChildIndex = _a[1]; | ||
var _b = (0, tslib_1.__read)(this.getCoordinates(end, false, true), 2), endChildIndex = _b[0], inEndChildIndex = _b[1]; | ||
var children = this.children; | ||
@@ -275,0 +275,0 @@ if (startChildIndex === endChildIndex) { |
@@ -36,16 +36,16 @@ "use strict"; | ||
if (reversed === void 0) { reversed = false; } | ||
return list_custom_1.treeStream(this, undefined, reversed); | ||
return (0, list_custom_1.treeStream)(this, undefined, reversed); | ||
}; | ||
NonLeafTree.prototype.streamRange = function (range, reversed) { | ||
if (reversed === void 0) { reversed = false; } | ||
return list_custom_1.treeStream(this, range, reversed); | ||
return (0, list_custom_1.treeStream)(this, range, reversed); | ||
}; | ||
NonLeafTree.prototype.get = function (index) { | ||
return list_custom_1.treeGet(this, index); | ||
return (0, list_custom_1.treeGet)(this, index); | ||
}; | ||
NonLeafTree.prototype.prepend = function (child) { | ||
return list_custom_1.treePrepend(this, child); | ||
return (0, list_custom_1.treePrepend)(this, child); | ||
}; | ||
NonLeafTree.prototype.append = function (child) { | ||
return list_custom_1.treeAppend(this, child); | ||
return (0, list_custom_1.treeAppend)(this, child); | ||
}; | ||
@@ -61,7 +61,7 @@ NonLeafTree.prototype.prependMiddle = function (child) { | ||
NonLeafTree.prototype.dropFirst = function () { | ||
var _a = tslib_1.__read(this.left.dropFirst(), 2), newLeft = _a[0], firstChild = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.left.dropFirst(), 2), newLeft = _a[0], firstChild = _a[1]; | ||
if (null === newLeft) { | ||
if (null === this.middle) | ||
return [this.right, firstChild]; | ||
var _b = tslib_1.__read(this.middle.dropFirst(), 2), newMiddle = _b[0], toLeft = _b[1]; | ||
var _b = (0, tslib_1.__read)(this.middle.dropFirst(), 2), newMiddle = _b[0], toLeft = _b[1]; | ||
var newSelf_1 = this.copy(toLeft, undefined, newMiddle)._normalize(); | ||
@@ -74,7 +74,7 @@ return [newSelf_1, firstChild]; | ||
NonLeafTree.prototype.dropLast = function () { | ||
var _a = tslib_1.__read(this.right.dropLast(), 2), newRight = _a[0], lastChild = _a[1]; | ||
var _a = (0, tslib_1.__read)(this.right.dropLast(), 2), newRight = _a[0], lastChild = _a[1]; | ||
if (null === newRight) { | ||
if (null === this.middle) | ||
return [this.left, lastChild]; | ||
var _b = tslib_1.__read(this.middle.dropLast(), 2), newMiddle = _b[0], toRight = _b[1]; | ||
var _b = (0, tslib_1.__read)(this.middle.dropLast(), 2), newMiddle = _b[0], toRight = _b[1]; | ||
var newSelf_2 = this.copy(undefined, toRight, newMiddle)._normalize(); | ||
@@ -92,3 +92,3 @@ return [newSelf_2, lastChild]; | ||
if (null === this.middle) { | ||
var _a = tslib_1.__read(this.right.takeInternal(middleAmount), 3), newRight = _a[0], up = _a[1], upAmount = _a[2]; | ||
var _a = (0, tslib_1.__read)(this.right.takeInternal(middleAmount), 3), newRight = _a[0], up = _a[1], upAmount = _a[2]; | ||
if (null === newRight) | ||
@@ -100,5 +100,5 @@ return [this.left, up, upAmount]; | ||
if (rightAmount > 0) { | ||
var _b = tslib_1.__read(this.right.takeInternal(rightAmount), 3), newRight = _b[0], up = _b[1], upAmount = _b[2]; | ||
var _b = (0, tslib_1.__read)(this.right.takeInternal(rightAmount), 3), newRight = _b[0], up = _b[1], upAmount = _b[2]; | ||
if (null === newRight) { | ||
var _c = tslib_1.__read(this.middle.dropLast(), 2), newMiddle_1 = _c[0], toRight = _c[1]; | ||
var _c = (0, tslib_1.__read)(this.middle.dropLast(), 2), newMiddle_1 = _c[0], toRight = _c[1]; | ||
var newSelf_3 = this.copy(undefined, toRight, newMiddle_1)._normalize(); | ||
@@ -110,3 +110,3 @@ return [newSelf_3, up, upAmount]; | ||
} | ||
var _d = tslib_1.__read(this.middle.takeInternal(middleAmount), 2), newMiddle = _d[0], upRight = _d[1]; | ||
var _d = (0, tslib_1.__read)(this.middle.takeInternal(middleAmount), 2), newMiddle = _d[0], upRight = _d[1]; | ||
var newSelf = this.copy(undefined, upRight, newMiddle)._normalize(); | ||
@@ -119,3 +119,3 @@ return newSelf.takeInternal(amount); | ||
if (middleAmount < 0) { | ||
var _a = tslib_1.__read(this.left.dropInternal(amount), 3), newLeft = _a[0], upLeft_1 = _a[1], upLeftAmount = _a[2]; | ||
var _a = (0, tslib_1.__read)(this.left.dropInternal(amount), 3), newLeft = _a[0], upLeft_1 = _a[1], upLeftAmount = _a[2]; | ||
var newSelf_5 = null === newLeft ? this.right : newLeft.concat(this.right); | ||
@@ -129,5 +129,5 @@ return [newSelf_5, upLeft_1, upLeftAmount]; | ||
if (middleAmount < 0) { | ||
var _b = tslib_1.__read(this.left.dropInternal(amount), 3), newLeft = _b[0], upLeft_2 = _b[1], upLeftAmount = _b[2]; | ||
var _b = (0, tslib_1.__read)(this.left.dropInternal(amount), 3), newLeft = _b[0], upLeft_2 = _b[1], upLeftAmount = _b[2]; | ||
if (null === newLeft) { | ||
var _c = tslib_1.__read(this.middle.dropFirst(), 2), newMiddle_2 = _c[0], toLeft = _c[1]; | ||
var _c = (0, tslib_1.__read)(this.middle.dropFirst(), 2), newMiddle_2 = _c[0], toLeft = _c[1]; | ||
var newSelf_6 = this.copy(toLeft, undefined, newMiddle_2)._normalize(); | ||
@@ -143,3 +143,3 @@ return [newSelf_6, upLeft_2, upLeftAmount]; | ||
} | ||
var _d = tslib_1.__read(this.middle.dropInternal(middleAmount), 3), newMiddle = _d[0], upLeft = _d[1], inUpLeft = _d[2]; | ||
var _d = (0, tslib_1.__read)(this.middle.dropInternal(middleAmount), 3), newMiddle = _d[0], upLeft = _d[1], inUpLeft = _d[2]; | ||
var newSelf = this.copy(upLeft, undefined, newMiddle)._normalize(); | ||
@@ -195,3 +195,3 @@ return newSelf.dropInternal(inUpLeft); | ||
NonLeafTree.prototype.updateAt = function (index, update) { | ||
return list_custom_1.treeUpdate(this, index, update); | ||
return (0, list_custom_1.treeUpdate)(this, index, update); | ||
}; | ||
@@ -201,3 +201,3 @@ NonLeafTree.prototype.forEach = function (f, state) { | ||
return; | ||
list_custom_1.treeForEach(this, f, state); | ||
(0, list_custom_1.treeForEach)(this, f, state); | ||
}; | ||
@@ -250,3 +250,3 @@ NonLeafTree.prototype.map = function (mapFun, reversed, indexOffset) { | ||
if (reversed === void 0) { reversed = false; } | ||
return list_custom_1.treeToArray(this, range, reversed); | ||
return (0, list_custom_1.treeToArray)(this, range, reversed); | ||
}; | ||
@@ -253,0 +253,0 @@ NonLeafTree.prototype.structure = function () { |
@@ -26,3 +26,3 @@ "use strict"; | ||
} | ||
var _a = tslib_1.__read(indexRange, 2), start = _a[0], end = _a[1]; | ||
var _a = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1]; | ||
var leftStream = tree.left.streamRange({ start: start, end: end }, reversed); | ||
@@ -172,3 +172,3 @@ if (null === tree.middle) { | ||
} | ||
var _a = tslib_1.__read(indexRange, 2), start = _a[0], end = _a[1]; | ||
var _a = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1]; | ||
var leftArray = tree.left.toArray({ start: start, end: end }, reversed); | ||
@@ -175,0 +175,0 @@ if (null === tree.middle) { |
"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 |
@@ -25,3 +25,3 @@ "use strict"; | ||
}; | ||
exports.List = tslib_1.__assign(tslib_1.__assign({}, _defaultContext), _contextHelpers); | ||
exports.List = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, _defaultContext), _contextHelpers); | ||
//# sourceMappingURL=interface.js.map |
@@ -5,4 +5,4 @@ "use strict"; | ||
var tslib_1 = require("tslib"); | ||
exports.ListCustom = tslib_1.__importStar(require("./list-custom")); | ||
tslib_1.__exportStar(require("./interface"), exports); | ||
exports.ListCustom = (0, tslib_1.__importStar)(require("./list-custom")); | ||
(0, tslib_1.__exportStar)(require("./interface"), exports); | ||
//# sourceMappingURL=internal.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./implementation/block"), exports); | ||
tslib_1.__exportStar(require("./implementation/empty"), exports); | ||
tslib_1.__exportStar(require("./implementation/nonleaf/interface"), exports); | ||
tslib_1.__exportStar(require("./implementation/nonleaf/nonleaf-block"), exports); | ||
tslib_1.__exportStar(require("./implementation/tree/interface"), exports); | ||
tslib_1.__exportStar(require("./implementation/tree/operations"), exports); | ||
tslib_1.__exportStar(require("./builder/block-builder"), exports); | ||
tslib_1.__exportStar(require("./builder/builder-base"), exports); | ||
tslib_1.__exportStar(require("./builder/gen-builder"), exports); | ||
tslib_1.__exportStar(require("./builder/leaf/block-builder"), exports); | ||
tslib_1.__exportStar(require("./builder/leaf/leaf-builder"), exports); | ||
tslib_1.__exportStar(require("./builder/nonleaf/nonleaf-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/block"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/empty"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/nonleaf/interface"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/nonleaf/nonleaf-block"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/tree/interface"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/tree/operations"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/block-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/builder-base"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/gen-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/leaf/block-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/leaf/leaf-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/nonleaf/nonleaf-builder"), exports); | ||
// circular dependencies | ||
tslib_1.__exportStar(require("./implementation/leaf/non-empty"), exports); | ||
tslib_1.__exportStar(require("./builder/tree/tree-builder"), exports); | ||
tslib_1.__exportStar(require("./implementation/nonleaf/nonleaf-tree"), exports); | ||
tslib_1.__exportStar(require("./builder/nonleaf/block-builder"), exports); | ||
tslib_1.__exportStar(require("./context"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/leaf/non-empty"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/tree/tree-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./implementation/nonleaf/nonleaf-tree"), exports); | ||
(0, tslib_1.__exportStar)(require("./builder/nonleaf/block-builder"), exports); | ||
(0, tslib_1.__exportStar)(require("./context"), exports); | ||
//# sourceMappingURL=list-custom.js.map |
{ | ||
"name": "@rimbu/list", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "An efficient immutable ordered sequence of elements akin to a Vector", | ||
@@ -62,7 +62,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@rimbu/base": "^0.6.5", | ||
"@rimbu/collection-types": "^0.7.3", | ||
"@rimbu/common": "^0.7.3", | ||
"@rimbu/stream": "^0.7.3", | ||
"tslib": "^2.3.0" | ||
"@rimbu/base": "^0.6.6", | ||
"@rimbu/collection-types": "^0.7.4", | ||
"@rimbu/common": "^0.7.4", | ||
"@rimbu/stream": "^0.7.4", | ||
"tslib": "^2.3.1" | ||
}, | ||
@@ -75,3 +75,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "f6fad673f48ce3d44d6b0f931c0182c8231526ca" | ||
"gitHead": "e509f9938fad6253702f6b78eb9f8e3b3a8f92ac" | ||
} |
@@ -15,6 +15,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/list` | ||
@@ -26,4 +28,30 @@ | ||
### recommended tsconfig settings | ||
### Deno | ||
Create a file called `rimbu.ts` and add the following: | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/list/mod.ts'; | ||
> ``` | ||
Or using a pinned version (`x.y.z`): | ||
> ```ts | ||
> export * from 'https://deno.land/x/rimbu/list@x.y.z/mod.ts'; | ||
> ``` | ||
Then import what you need from `rimbu.ts`: | ||
```ts | ||
import { List } 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: | ||
@@ -30,0 +58,0 @@ |
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
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
724382
93
Updated@rimbu/base@^0.6.6
Updated@rimbu/common@^0.7.4
Updated@rimbu/stream@^0.7.4
Updatedtslib@^2.3.1