Socket
Socket
Sign inDemoInstall

@rimbu/sorted

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rimbu/sorted - npm Package Compare versions

Comparing version 0.7.2 to 0.8.0

84

dist/main/map/immutable.js

@@ -101,41 +101,2 @@ "use strict";

};
SortedMapEmpty.prototype.extendValues = function () {
return this;
};
SortedMapEmpty.prototype.mergeAll = function (fillValue) {
var _a;
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
return (_a = this.context).mergeAll.apply(_a, (0, tslib_1.__spreadArray)([fillValue,
this], (0, tslib_1.__read)(sources), false));
};
SortedMapEmpty.prototype.mergeAllWith = function (fillValue, mergeFun) {
var _a;
var sources = [];
for (var _i = 2; _i < arguments.length; _i++) {
sources[_i - 2] = arguments[_i];
}
return (_a = this.context).mergeAllWith.apply(_a, (0, tslib_1.__spreadArray)([fillValue,
mergeFun,
this], (0, tslib_1.__read)(sources), false));
};
SortedMapEmpty.prototype.merge = function () {
var _a;
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
return (_a = this.context).merge.apply(_a, (0, tslib_1.__spreadArray)([this], (0, tslib_1.__read)(sources), false));
};
SortedMapEmpty.prototype.mergeWith = function (mergeFun) {
var _a;
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
return (_a = this.context).mergeWith.apply(_a, (0, tslib_1.__spreadArray)([mergeFun,
this], (0, tslib_1.__read)(sources), false));
};
return SortedMapEmpty;

@@ -321,3 +282,3 @@ }(sorted_custom_1.SortedEmpty));

end: ')',
valueToString: function (entry) { return entry[0] + " -> " + entry[1]; },
valueToString: function (entry) { return "".concat(entry[0], " -> ").concat(entry[1]); },
});

@@ -331,41 +292,2 @@ };

};
SortedMapNode.prototype.extendValues = function () {
return this;
};
SortedMapNode.prototype.mergeAll = function (fillValue) {
var _a;
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
return (_a = this.context).mergeAll.apply(_a, (0, tslib_1.__spreadArray)([fillValue,
this], (0, tslib_1.__read)(sources), false));
};
SortedMapNode.prototype.mergeAllWith = function (fillValue, mergeFun) {
var _a;
var sources = [];
for (var _i = 2; _i < arguments.length; _i++) {
sources[_i - 2] = arguments[_i];
}
return (_a = this.context).mergeAllWith.apply(_a, (0, tslib_1.__spreadArray)([fillValue,
mergeFun,
this], (0, tslib_1.__read)(sources), false));
};
SortedMapNode.prototype.merge = function () {
var _a;
var sources = [];
for (var _i = 0; _i < arguments.length; _i++) {
sources[_i] = arguments[_i];
}
return (_a = this.context).merge.apply(_a, (0, tslib_1.__spreadArray)([this], (0, tslib_1.__read)(sources), false));
};
SortedMapNode.prototype.mergeWith = function (mergeFun) {
var _a;
var sources = [];
for (var _i = 1; _i < arguments.length; _i++) {
sources[_i - 1] = arguments[_i];
}
return (_a = this.context).mergeWith.apply(_a, (0, tslib_1.__spreadArray)([mergeFun,
this], (0, tslib_1.__read)(sources), false));
};
return SortedMapNode;

@@ -560,5 +482,3 @@ }(sorted_custom_1.SortedNonEmptyBase));

var token = Symbol();
return stream_1.Stream.fromArray(this.children, undefined, reversed)
.zipAll(token, stream_1.Stream.fromArray(this.entries, undefined, reversed))
.flatMap(function (_a) {
return stream_1.Stream.zipAll(token, stream_1.Stream.fromArray(this.children, undefined, reversed), stream_1.Stream.fromArray(this.entries, undefined, reversed)).flatMap(function (_a) {
var _b = (0, tslib_1.__read)(_a, 2), child = _b[0], e = _b[1];

@@ -565,0 +485,0 @@ if (token === child)

4

dist/main/set/immutable.js

@@ -408,5 +408,3 @@ "use strict";

var token = Symbol();
return stream_1.Stream.fromArray(this.children, undefined, reversed)
.zipAll(token, stream_1.Stream.fromArray(this.entries, undefined, reversed))
.flatMap(function (_a) {
return stream_1.Stream.zipAll(token, stream_1.Stream.fromArray(this.children, undefined, reversed), stream_1.Stream.fromArray(this.entries, undefined, reversed)).flatMap(function (_a) {
var _b = (0, tslib_1.__read)(_a, 2), child = _b[0], e = _b[1];

@@ -413,0 +411,0 @@ if (token === child)

@@ -95,17 +95,2 @@ import { Arr, Entry, RimbuError, Token } from '@rimbu/base';

}
extendValues() {
return this;
}
mergeAll(fillValue, ...sources) {
return this.context.mergeAll(fillValue, this, ...sources);
}
mergeAllWith(fillValue, mergeFun, ...sources) {
return this.context.mergeAllWith(fillValue, mergeFun, this, ...sources);
}
merge(...sources) {
return this.context.merge(this, ...sources);
}
mergeWith(mergeFun, ...sources) {
return this.context.mergeWith(mergeFun, this, ...sources);
}
}

@@ -294,17 +279,2 @@ export class SortedMapNode extends SortedNonEmptyBase {

}
extendValues() {
return this;
}
mergeAll(fillValue, ...sources) {
return this.context.mergeAll(fillValue, this, ...sources);
}
mergeAllWith(fillValue, mergeFun, ...sources) {
return this.context.mergeAllWith(fillValue, mergeFun, this, ...sources);
}
merge(...sources) {
return this.context.merge(this, ...sources);
}
mergeWith(mergeFun, ...sources) {
return this.context.mergeWith(mergeFun, this, ...sources);
}
}

@@ -479,5 +449,3 @@ export class SortedMapLeaf extends SortedMapNode {

const token = Symbol();
return Stream.fromArray(this.children, undefined, reversed)
.zipAll(token, Stream.fromArray(this.entries, undefined, reversed))
.flatMap(([child, e]) => {
return Stream.zipAll(token, Stream.fromArray(this.children, undefined, reversed), Stream.fromArray(this.entries, undefined, reversed)).flatMap(([child, e]) => {
if (token === child)

@@ -484,0 +452,0 @@ RimbuError.throwInvalidStateError();

@@ -372,5 +372,3 @@ import { Arr, RimbuError } from '@rimbu/base';

const token = Symbol();
return Stream.fromArray(this.children, undefined, reversed)
.zipAll(token, Stream.fromArray(this.entries, undefined, reversed))
.flatMap(([child, e]) => {
return Stream.zipAll(token, Stream.fromArray(this.children, undefined, reversed), Stream.fromArray(this.entries, undefined, reversed)).flatMap(([child, e]) => {
if (token === child)

@@ -377,0 +375,0 @@ RimbuError.throwInvalidStateError();

@@ -37,17 +37,2 @@ import { Token } from '@rimbu/base';

toJSON(): ToJSON<any[]>;
extendValues(): any;
mergeAll<O, I extends readonly [unknown, ...unknown[]]>(fillValue: O, ...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
mergeAllWith<R, O, I extends readonly [unknown, ...unknown[]]>(fillValue: O, mergeFun: (key: K, value: V | O, ...values: {
[KT in keyof I]: I[KT] | O;
}) => R, ...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
merge<I extends readonly [unknown, ...unknown[]]>(...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
mergeWith<R, K, I extends readonly [unknown, ...unknown[]]>(mergeFun: (key: K, ...values: I) => R, ...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
}

@@ -106,17 +91,2 @@ export declare abstract class SortedMapNode<K, V> extends SortedNonEmptyBase<readonly [K, V], SortedMapNode<K, V>> implements SortedMap.NonEmpty<K, V> {

toJSON(): ToJSON<(readonly [K, V])[]>;
extendValues(): any;
mergeAll<O, I extends readonly [unknown, ...unknown[]]>(fillValue: O, ...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
mergeAllWith<R, O, I extends readonly [unknown, ...unknown[]]>(fillValue: O, mergeFun: (key: K, value: V | O, ...values: {
[KT in keyof I]: I[KT] | O;
}) => R, ...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
merge<I extends readonly [unknown, ...unknown[]]>(...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
mergeWith<R, K, I extends readonly [unknown, ...unknown[]]>(mergeFun: (key: K, ...values: I) => R, ...sources: {
[KT in keyof I]: StreamSource<readonly [K, I[KT]]>;
}): any;
}

@@ -123,0 +93,0 @@ export declare class SortedMapLeaf<K, V> extends SortedMapNode<K, V> {

{
"name": "@rimbu/sorted",
"version": "0.7.2",
"version": "0.8.0",
"description": "Immutable SortedMap and SortedSet implementations for TypeScript",

@@ -62,6 +62,6 @@ "keywords": [

"dependencies": {
"@rimbu/base": "^0.6.7",
"@rimbu/collection-types": "^0.7.5",
"@rimbu/common": "^0.7.5",
"@rimbu/stream": "^0.7.5",
"@rimbu/base": "^0.7.0",
"@rimbu/collection-types": "^0.8.0",
"@rimbu/common": "^0.8.0",
"@rimbu/stream": "^0.8.0",
"tslib": "^2.3.1"

@@ -75,3 +75,3 @@ },

},
"gitHead": "20739fd0c0d5c565eeecd3e266dd51f893e8d67c"
"gitHead": "c321aa32b1c5fd8ca8b7fb1c26bd4f7bbf3ef70d"
}

@@ -60,15 +60,2 @@ <p align="center">

## 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:
```json
{
"compilerOptions": {
"skipLibCheck": true,
"noStrictGenericChecks": true
}
}
```
## Usage

@@ -75,0 +62,0 @@

@@ -168,51 +168,2 @@ import { Arr, Entry, RimbuError, Token } from '@rimbu/base';

}
extendValues(): any {
return this;
}
mergeAll<O, I extends readonly [unknown, ...unknown[]]>(
fillValue: O,
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.mergeAll(
fillValue,
this,
...(sources as any as [any, ...any[]])
);
}
mergeAllWith<R, O, I extends readonly [unknown, ...unknown[]]>(
fillValue: O,
mergeFun: (
key: K,
value: V | O,
...values: { [KT in keyof I]: I[KT] | O }
) => R,
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.mergeAllWith(
fillValue,
mergeFun as any,
this,
...(sources as any as [any, ...any[]])
);
}
merge<I extends readonly [unknown, ...unknown[]]>(
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.merge(this, ...(sources as any as any[]));
}
mergeWith<R, K, I extends readonly [unknown, ...unknown[]]>(
mergeFun: (key: K, ...values: I) => R,
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.mergeWith(
mergeFun as any,
this as any,
...(sources as any as any[])
);
}
}

@@ -462,3 +413,3 @@

toBuilder(): SortedMapBuilder<K, V> {
return this.context.createBuilder(this);
return this.context.createBuilder<K, V>(this);
}

@@ -481,51 +432,2 @@

}
extendValues(): any {
return this;
}
mergeAll<O, I extends readonly [unknown, ...unknown[]]>(
fillValue: O,
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.mergeAll(
fillValue,
this,
...(sources as any as [any, ...any[]])
);
}
mergeAllWith<R, O, I extends readonly [unknown, ...unknown[]]>(
fillValue: O,
mergeFun: (
key: K,
value: V | O,
...values: { [KT in keyof I]: I[KT] | O }
) => R,
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.mergeAllWith(
fillValue,
mergeFun as any,
this,
...(sources as any as [any, ...any[]])
);
}
merge<I extends readonly [unknown, ...unknown[]]>(
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.merge(this, ...(sources as any as any[]));
}
mergeWith<R, K, I extends readonly [unknown, ...unknown[]]>(
mergeFun: (key: K, ...values: I) => R,
...sources: { [KT in keyof I]: StreamSource<readonly [K, I[KT]]> }
): any {
return this.context.mergeWith(
mergeFun as any,
this as any,
...(sources as any as any[])
);
}
}

@@ -778,9 +680,11 @@

const token = Symbol();
return Stream.fromArray(this.children, undefined, reversed)
.zipAll(token, Stream.fromArray(this.entries, undefined, reversed))
.flatMap(([child, e]): Stream.NonEmpty<readonly [K, V]> => {
if (token === child) RimbuError.throwInvalidStateError();
if (token === e) return child.stream(reversed);
return child.stream(reversed).append(e);
}) as Stream.NonEmpty<readonly [K, V]>;
return Stream.zipAll(
token,
Stream.fromArray(this.children, undefined, reversed),
Stream.fromArray(this.entries, undefined, reversed)
).flatMap(([child, e]): Stream.NonEmpty<readonly [K, V]> => {
if (token === child) RimbuError.throwInvalidStateError();
if (token === e) return child.stream(reversed);
return child.stream(reversed).append(e);
}) as Stream.NonEmpty<readonly [K, V]>;
}

@@ -787,0 +691,0 @@

@@ -521,9 +521,11 @@ import { Arr, RimbuError } from '@rimbu/base';

return Stream.fromArray(this.children, undefined, reversed)
.zipAll(token, Stream.fromArray(this.entries, undefined, reversed))
.flatMap(([child, e]): Stream.NonEmpty<T> => {
if (token === child) RimbuError.throwInvalidStateError();
if (token === e) return child.stream(reversed);
return child.stream(reversed).append(e);
}) as Stream.NonEmpty<T>;
return Stream.zipAll(
token,
Stream.fromArray(this.children, undefined, reversed),
Stream.fromArray(this.entries, undefined, reversed)
).flatMap(([child, e]): Stream.NonEmpty<T> => {
if (token === child) RimbuError.throwInvalidStateError();
if (token === e) return child.stream(reversed);
return child.stream(reversed).append(e);
}) as Stream.NonEmpty<T>;
}

@@ -530,0 +532,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

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