Socket
Socket
Sign inDemoInstall

@rimbu/list

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rimbu/list - npm Package Compare versions

Comparing version 0.10.11 to 0.10.12

2

dist/main/custom/builder/leaf/block-builder.js

@@ -96,3 +96,3 @@ "use strict";

LeafBlockBuilder.prototype.remove = function (index) {
var _a = (0, tslib_1.__read)(this.children.splice(index, 1), 1), item = _a[0];
var _a = tslib_1.__read(this.children.splice(index, 1), 1), item = _a[0];
this.source = undefined;

@@ -99,0 +99,0 @@ return item;

@@ -7,7 +7,8 @@ "use strict";

var LeafTreeBuilder = /** @class */ (function (_super) {
(0, tslib_1.__extends)(LeafTreeBuilder, _super);
tslib_1.__extends(LeafTreeBuilder, _super);
function LeafTreeBuilder(context, source, _left, _right, _middle, length) {
if (length === void 0) { length = (_a = source === null || source === void 0 ? void 0 : source.length) !== null && _a !== void 0 ? _a : 0; }
var _this = this;
var _a;
var _this = _super.call(this) || this;
_this = _super.call(this) || this;
_this.context = context;

@@ -14,0 +15,0 @@ _this.source = source;

@@ -98,7 +98,7 @@ "use strict";

return this.source.get(index);
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = 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 = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
return this.children[childIndex].updateAt(inChildIndex, update, otherwise);

@@ -115,3 +115,3 @@ };

NonLeafBlockBuilder.prototype.insert = function (index, value) {
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
this.length++;

@@ -140,3 +140,3 @@ var child = this.children[childIndex];

NonLeafBlockBuilder.prototype.remove = function (index) {
var _a = (0, tslib_1.__read)(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = tslib_1.__read(this.getCoordinates(index), 2), childIndex = _a[0], inChildIndex = _a[1];
this.length--;

@@ -143,0 +143,0 @@ var child = this.children[childIndex];

@@ -7,7 +7,8 @@ "use strict";

var NonLeafTreeBuilder = /** @class */ (function (_super) {
(0, tslib_1.__extends)(NonLeafTreeBuilder, _super);
tslib_1.__extends(NonLeafTreeBuilder, _super);
function NonLeafTreeBuilder(context, level, source, _left, _right, _middle, length) {
if (length === void 0) { length = (_a = source === null || source === void 0 ? void 0 : source.length) !== null && _a !== void 0 ? _a : 0; }
var _this = this;
var _a;
var _this = _super.call(this) || this;
_this = _super.call(this) || this;
_this.context = context;

@@ -14,0 +15,0 @@ _this.level = level;

@@ -77,3 +77,3 @@ "use strict";

}
return _this.from.apply(_this, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false));
return _this.from.apply(_this, tslib_1.__spreadArray([], tslib_1.__read(sources), false));
};

@@ -80,0 +80,0 @@ this.reducer = function (source) {

@@ -9,3 +9,3 @@ "use strict";

var Empty = /** @class */ (function (_super) {
(0, tslib_1.__extends)(Empty, _super);
tslib_1.__extends(Empty, _super);
function Empty(context) {

@@ -60,3 +60,3 @@ var _this = _super.call(this) || this;

}
return (_a = this.context).from.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false));
return (_a = this.context).from.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(sources), false));
};

@@ -63,0 +63,0 @@ Empty.prototype.repeat = function () {

@@ -10,3 +10,3 @@ "use strict";

var LeafBlock = /** @class */ (function (_super) {
(0, tslib_1.__extends)(LeafBlock, _super);
tslib_1.__extends(LeafBlock, _super);
function LeafBlock(context, children) {

@@ -150,3 +150,3 @@ var _this = _super.call(this) || this;

}
var asList = (_a = this.context).from.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false));
var asList = (_a = this.context).from.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(sources), false));
if (asList.nonEmpty()) {

@@ -253,3 +253,3 @@ if (this.context.isLeafBlock(asList)) {

else {
var _a = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1];
var _a = tslib_1.__read(indexRange, 2), start = _a[0], end = _a[1];
if (!reversed)

@@ -274,3 +274,3 @@ return this.children.slice(start, end + 1);

var ReversedLeafBlock = /** @class */ (function (_super) {
(0, tslib_1.__extends)(ReversedLeafBlock, _super);
tslib_1.__extends(ReversedLeafBlock, _super);
function ReversedLeafBlock() {

@@ -368,3 +368,3 @@ return _super !== null && _super.apply(this, arguments) || this;

else {
var _a = (0, tslib_1.__read)(indexRange, 2), indexStart = _a[0], indexEnd = _a[1];
var _a = tslib_1.__read(indexRange, 2), indexStart = _a[0], indexEnd = _a[1];
var start = this.length - 1 - indexEnd;

@@ -371,0 +371,0 @@ var end = this.length - 1 - indexStart;

@@ -10,3 +10,3 @@ "use strict";

var LeafTree = /** @class */ (function (_super) {
(0, tslib_1.__extends)(LeafTree, _super);
tslib_1.__extends(LeafTree, _super);
function LeafTree(context, left, right, middle, length) {

@@ -87,3 +87,3 @@ if (length === void 0) { length = left.length +

}
var _a = (0, tslib_1.__read)(this.middle.takeInternal(middleAmount), 3), newMiddle = _a[0], upRight = _a[1], inUpRight = _a[2];
var _a = tslib_1.__read(this.middle.takeInternal(middleAmount), 3), newMiddle = _a[0], upRight = _a[1], inUpRight = _a[2];
var newRight = upRight.takeChildren(inUpRight);

@@ -111,3 +111,3 @@ return this.copy(undefined, newRight, newMiddle)._normalize();

}
var _a = (0, tslib_1.__read)(this.middle.dropInternal(middleAmount), 3), newMiddle = _a[0], upLeft = _a[1], inUpLeft = _a[2];
var _a = tslib_1.__read(this.middle.dropInternal(middleAmount), 3), newMiddle = _a[0], upLeft = _a[1], inUpLeft = _a[2];
var newLeft = upLeft.dropChildren(inUpLeft);

@@ -122,3 +122,3 @@ return this.copy(newLeft, undefined, newMiddle)._normalize();

}
var asList = (_a = this.context).from.apply(_a, (0, tslib_1.__spreadArray)([], (0, tslib_1.__read)(sources), false));
var asList = (_a = this.context).from.apply(_a, tslib_1.__spreadArray([], tslib_1.__read(sources), false));
if (asList.nonEmpty()) {

@@ -163,3 +163,3 @@ if (this.context.isLeafBlock(asList)) {

}
var _a = (0, tslib_1.__read)(this.middle.dropLast(), 2), newMiddle_3 = _a[0], toJoint = _a[1];
var _a = tslib_1.__read(this.middle.dropLast(), 2), newMiddle_3 = _a[0], toJoint = _a[1];
var joint_2 = toJoint

@@ -166,0 +166,0 @@ .concatChildren(this.right)

@@ -10,3 +10,3 @@ "use strict";

var ListNonEmptyBase = /** @class */ (function (_super) {
(0, tslib_1.__extends)(ListNonEmptyBase, _super);
tslib_1.__extends(ListNonEmptyBase, _super);
function ListNonEmptyBase() {

@@ -49,3 +49,3 @@ return _super !== null && _super.apply(this, arguments) || this;

return this.context.empty();
var _a = (0, tslib_1.__read)(result, 2), start = _a[0], end = _a[1];
var _a = tslib_1.__read(result, 2), start = _a[0], end = _a[1];
var values = this.drop(start).take(end - start + 1);

@@ -52,0 +52,0 @@ if (!reversed)

@@ -82,5 +82,5 @@ "use strict";

return stream_1.Stream.empty();
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];
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];
if (startChildIndex === endChildIndex) {

@@ -105,3 +105,3 @@ var child = this.children[startChildIndex];

NonLeafBlock.prototype.get = function (index) {
var _a = (0, tslib_1.__read)(this.getCoordinates(index, false, false), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = 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);

@@ -199,3 +199,3 @@ };

NonLeafBlock.prototype.takeInternal = function (amount) {
var _a = (0, tslib_1.__read)(this.getCoordinates(amount, true, false), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = tslib_1.__read(this.getCoordinates(amount, true, false), 2), childIndex = _a[0], inChildIndex = _a[1];
var lastChild = this.getChild(childIndex);

@@ -207,3 +207,3 @@ var newSelf = this.takeChildren(childIndex);

NonLeafBlock.prototype.dropInternal = function (amount) {
var _a = (0, tslib_1.__read)(this.getCoordinates(amount, false, false), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = tslib_1.__read(this.getCoordinates(amount, false, false), 2), childIndex = _a[0], inChildIndex = _a[1];
var firstChild = this.getChild(childIndex);

@@ -217,3 +217,3 @@ var newSelf = this.dropChildren(childIndex + 1);

NonLeafBlock.prototype.updateAt = function (index, update) {
var _a = (0, tslib_1.__read)(this.getCoordinates(index, false, false), 2), childIndex = _a[0], inChildIndex = _a[1];
var _a = 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); });

@@ -262,4 +262,4 @@ return this.copy(newChildren);

var i = -1;
var length = children.length;
while (++i < length) {
var length_1 = children.length;
while (++i < length_1) {
var child = children[i];

@@ -294,4 +294,4 @@ newChildren.push(child.map(mapFun, false, offset));

}
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 _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 children = this.children;

@@ -298,0 +298,0 @@ if (startChildIndex === endChildIndex) {

@@ -60,7 +60,7 @@ "use strict";

NonLeafTree.prototype.dropFirst = function () {
var _a = (0, tslib_1.__read)(this.left.dropFirst(), 2), newLeft = _a[0], firstChild = _a[1];
var _a = 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 = (0, tslib_1.__read)(this.middle.dropFirst(), 2), newMiddle = _b[0], toLeft = _b[1];
var _b = tslib_1.__read(this.middle.dropFirst(), 2), newMiddle = _b[0], toLeft = _b[1];
var newSelf_1 = this.copy(toLeft, undefined, newMiddle)._normalize();

@@ -73,7 +73,7 @@ return [newSelf_1, firstChild];

NonLeafTree.prototype.dropLast = function () {
var _a = (0, tslib_1.__read)(this.right.dropLast(), 2), newRight = _a[0], lastChild = _a[1];
var _a = 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 = (0, tslib_1.__read)(this.middle.dropLast(), 2), newMiddle = _b[0], toRight = _b[1];
var _b = tslib_1.__read(this.middle.dropLast(), 2), newMiddle = _b[0], toRight = _b[1];
var newSelf_2 = this.copy(undefined, toRight, newMiddle)._normalize();

@@ -91,3 +91,3 @@ return [newSelf_2, lastChild];

if (null === this.middle) {
var _a = (0, tslib_1.__read)(this.right.takeInternal(middleAmount), 3), newRight = _a[0], up = _a[1], upAmount = _a[2];
var _a = tslib_1.__read(this.right.takeInternal(middleAmount), 3), newRight = _a[0], up = _a[1], upAmount = _a[2];
if (null === newRight)

@@ -99,5 +99,5 @@ return [this.left, up, upAmount];

if (rightAmount > 0) {
var _b = (0, tslib_1.__read)(this.right.takeInternal(rightAmount), 3), newRight = _b[0], up = _b[1], upAmount = _b[2];
var _b = tslib_1.__read(this.right.takeInternal(rightAmount), 3), newRight = _b[0], up = _b[1], upAmount = _b[2];
if (null === newRight) {
var _c = (0, tslib_1.__read)(this.middle.dropLast(), 2), newMiddle_1 = _c[0], toRight = _c[1];
var _c = tslib_1.__read(this.middle.dropLast(), 2), newMiddle_1 = _c[0], toRight = _c[1];
var newSelf_3 = this.copy(undefined, toRight, newMiddle_1)._normalize();

@@ -109,3 +109,3 @@ return [newSelf_3, up, upAmount];

}
var _d = (0, tslib_1.__read)(this.middle.takeInternal(middleAmount), 2), newMiddle = _d[0], upRight = _d[1];
var _d = tslib_1.__read(this.middle.takeInternal(middleAmount), 2), newMiddle = _d[0], upRight = _d[1];
var newSelf = this.copy(undefined, upRight, newMiddle)._normalize();

@@ -118,3 +118,3 @@ return newSelf.takeInternal(amount);

if (middleAmount < 0) {
var _a = (0, tslib_1.__read)(this.left.dropInternal(amount), 3), newLeft = _a[0], upLeft_1 = _a[1], upLeftAmount = _a[2];
var _a = 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);

@@ -128,5 +128,5 @@ return [newSelf_5, upLeft_1, upLeftAmount];

if (middleAmount < 0) {
var _b = (0, tslib_1.__read)(this.left.dropInternal(amount), 3), newLeft = _b[0], upLeft_2 = _b[1], upLeftAmount = _b[2];
var _b = tslib_1.__read(this.left.dropInternal(amount), 3), newLeft = _b[0], upLeft_2 = _b[1], upLeftAmount = _b[2];
if (null === newLeft) {
var _c = (0, tslib_1.__read)(this.middle.dropFirst(), 2), newMiddle_2 = _c[0], toLeft = _c[1];
var _c = tslib_1.__read(this.middle.dropFirst(), 2), newMiddle_2 = _c[0], toLeft = _c[1];
var newSelf_6 = this.copy(toLeft, undefined, newMiddle_2)._normalize();

@@ -142,3 +142,3 @@ return [newSelf_6, upLeft_2, upLeftAmount];

}
var _d = (0, tslib_1.__read)(this.middle.dropInternal(middleAmount), 3), newMiddle = _d[0], upLeft = _d[1], inUpLeft = _d[2];
var _d = 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();

@@ -145,0 +145,0 @@ return newSelf.dropInternal(inUpLeft);

@@ -26,3 +26,3 @@ "use strict";

}
var _a = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1];
var _a = 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 = (0, tslib_1.__read)(indexRange, 2), start = _a[0], end = _a[1];
var _a = 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) {

@@ -5,24 +5,24 @@ "use strict";

// pure interfaces
(0, tslib_1.__exportStar)(require("./interface"), exports);
(0, tslib_1.__exportStar)(require("./implementation/tree/interface"), exports);
(0, tslib_1.__exportStar)(require("./implementation/block"), exports);
(0, tslib_1.__exportStar)(require("./implementation/nonleaf/interface"), 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/leaf/leaf-builder"), exports);
(0, tslib_1.__exportStar)(require("./builder/nonleaf/nonleaf-builder"), exports);
tslib_1.__exportStar(require("./interface"), exports);
tslib_1.__exportStar(require("./implementation/tree/interface"), exports);
tslib_1.__exportStar(require("./implementation/block"), exports);
tslib_1.__exportStar(require("./implementation/nonleaf/interface"), exports);
tslib_1.__exportStar(require("./builder/block-builder"), exports);
tslib_1.__exportStar(require("./builder/builder-base"), exports);
tslib_1.__exportStar(require("./builder/leaf/leaf-builder"), exports);
tslib_1.__exportStar(require("./builder/nonleaf/nonleaf-builder"), exports);
// pure classes and files
(0, tslib_1.__exportStar)(require("./implementation/cache-map"), exports);
(0, tslib_1.__exportStar)(require("./implementation/empty"), exports);
(0, tslib_1.__exportStar)(require("./implementation/nonleaf/nonleaf-block"), 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/nonleaf/block-builder"), exports);
tslib_1.__exportStar(require("./implementation/cache-map"), exports);
tslib_1.__exportStar(require("./implementation/empty"), exports);
tslib_1.__exportStar(require("./implementation/nonleaf/nonleaf-block"), exports);
tslib_1.__exportStar(require("./builder/gen-builder"), exports);
tslib_1.__exportStar(require("./builder/leaf/block-builder"), exports);
tslib_1.__exportStar(require("./builder/nonleaf/block-builder"), exports);
// circular dependencies
(0, tslib_1.__exportStar)(require("./implementation/nonleaf/nonleaf-tree"), exports);
(0, tslib_1.__exportStar)(require("./implementation/leaf/leaf-block"), exports);
(0, tslib_1.__exportStar)(require("./implementation/leaf/leaf-tree"), exports);
(0, tslib_1.__exportStar)(require("./builder/leaf/tree-builder"), exports);
(0, tslib_1.__exportStar)(require("./builder/nonleaf/tree-builder"), exports);
(0, tslib_1.__exportStar)(require("./context"), exports);
tslib_1.__exportStar(require("./implementation/nonleaf/nonleaf-tree"), exports);
tslib_1.__exportStar(require("./implementation/leaf/leaf-block"), exports);
tslib_1.__exportStar(require("./implementation/leaf/leaf-tree"), exports);
tslib_1.__exportStar(require("./builder/leaf/tree-builder"), exports);
tslib_1.__exportStar(require("./builder/nonleaf/tree-builder"), exports);
tslib_1.__exportStar(require("./context"), exports);
//# sourceMappingURL=index.js.map

@@ -11,3 +11,3 @@ "use strict";

var tslib_1 = require("tslib");
(0, tslib_1.__exportStar)(require("./interface"), exports);
tslib_1.__exportStar(require("./interface"), exports);
//# sourceMappingURL=index.js.map

@@ -7,5 +7,5 @@ "use strict";

var _defaultContext = (0, custom_1.createListContext)();
exports.List = (0, tslib_1.__assign)({ createContext: custom_1.createListContext, defaultContext: function () {
exports.List = tslib_1.__assign({ createContext: custom_1.createListContext, defaultContext: function () {
return _defaultContext;
} }, _defaultContext);
//# sourceMappingURL=interface.js.map
{
"name": "@rimbu/list",
"version": "0.10.11",
"version": "0.10.12",
"description": "An efficient immutable ordered sequence of elements akin to a Vector",

@@ -61,3 +61,3 @@ "keywords": [

"test": "jest",
"test:random": "jest --config jest-random.config.json",
"test:random": "jest --config jest-random.config.json --runInBand",
"test:types": "tsd",

@@ -68,7 +68,7 @@ "typecheck": "tsc"

"dependencies": {
"@rimbu/base": "^0.8.1",
"@rimbu/collection-types": "^0.9.9",
"@rimbu/common": "^0.9.1",
"@rimbu/stream": "^0.10.9",
"tslib": "^2.3.1"
"@rimbu/base": "^0.8.2",
"@rimbu/collection-types": "^0.9.10",
"@rimbu/common": "^0.9.2",
"@rimbu/stream": "^0.10.10",
"tslib": "^2.4.0"
},

@@ -89,3 +89,3 @@ "publishConfig": {

},
"gitHead": "f44e1b43f07ac973555270806bbdde5f06400941"
"gitHead": "33dd7ca935f19f513586834a2ce1b1f886352ae7"
}

@@ -9,3 +9,3 @@ <p align="center">

For complete documentation please visit the [List page](https://rimbu.org/docs/collections/list) in the _[Rimbu Docs](https://rimbu.org)_.
For complete documentation please visit the [List page](https://rimbu.org/docs/collections/list) in the _[Rimbu Docs](https://rimbu.org)_, or directly see the _[Rimbu List API Docs](https://rimbu.org/api/rimbu/list)_.

@@ -16,3 +16,3 @@ Or [Try Out Rimbu](https://codesandbox.io/s/github/vitoke/rimbu-sandbox/tree/main?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox.

All types are exported through [`@rimbu/core`](../core). It is recommended to use that package.
For convenience, all main types are also exported through [`@rimbu/core`](../core).

@@ -31,26 +31,37 @@ To install separately:

Create a file called `rimbu.ts` and add the following:
For Deno, the following approach is recommended:
> ```ts
> export * from 'https://deno.land/x/rimbu/list/mod.ts';
> ```
In the root folder of your project, create or edit a file called `import_map.json` with the following contents (where you should replace `x.y.z` with the desired version of Rimbu):
Or using a pinned version (`x.y.z`):
```json
{
"imports": {
"@rimbu/": "https://deno.land/x/rimbu@x.y.z/"
}
}
```
> ```ts
> export * from 'https://deno.land/x/rimbu/list@x.y.z/mod.ts';
> ```
**Note: The trailing slashes are important!**
Then import what you need from `rimbu.ts`:
In this way you can use relative imports from Rimbu in your code, like so:
```ts
import { List } from './rimbu.ts';
import { List } from '@rimbu/core/mod.ts';
import { HashMap } from '@rimbu/hashed/mod.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.
Note that for sub-packages, due to conversion limitations it is needed to import the `index.ts` instead of `mod.ts`, like so:
Running your script then becomes:
```ts
import { HashMap } from '@rimbu/hashed/map/index.ts';
```
> `deno run --no-check --config tsconfig.json <your-script>.ts`
To run your script (let's assume the entry point is in `src/main.ts`):
`deno run --import-map import_map.json src/main.ts`
Because Rimbu uses advanced types, this may slow down the type checking part when running your code. If you're able to rely on your code editor to provide type errors, you can skip the Deno type check using the `--no-check` flag:
`deno run --import-map import_map.json --no-check src/main.ts`
## Usage

@@ -74,3 +85,3 @@

<img src = "https://contrib.rocks/image?repo=vitoke/iternal"/>
<img src = "https://contrib.rocks/image?repo=rimbu-org/rimbu"/>

@@ -77,0 +88,0 @@ Made with [contributors-img](https://contrib.rocks).

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc