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.5.11 to 0.6.0

6

dist/main/map/context.js

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

_this.typeTag = 'SortedMap';
_this.maxEntries = 1 << _this.blockSizeBits;
_this.minEntries = _this.maxEntries >>> 1;
_this._empty = new sortedmap_custom_1.SortedMapEmpty(_this);
_this.builder = function () {
return new sortedmap_custom_1.SortedMapBuilder(_this);
};
_this.maxEntries = 1 << blockSizeBits;
_this.minEntries = _this.maxEntries >>> 1;
_this._empty = new sortedmap_custom_1.SortedMapEmpty(_this);
return _this;

@@ -22,0 +22,0 @@ }

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

_this.typeTag = 'SortedSet';
_this.builder = function () {
return new sortedset_custom_1.SortedSetBuilder(_this);
};
_this.maxEntries = 1 << _this.blockSizeBits;
_this.minEntries = _this.maxEntries >>> 1;
_this._empty = new sortedset_custom_1.SortedSetEmpty(_this);
_this.builder = function () {
return new sortedset_custom_1.SortedSetBuilder(_this);
};
return _this;

@@ -22,0 +22,0 @@ }

@@ -9,8 +9,8 @@ import { CustomBase } from '@rimbu/collection-types';

this.typeTag = 'SortedMap';
this.maxEntries = 1 << this.blockSizeBits;
this.minEntries = this.maxEntries >>> 1;
this._empty = new SortedMapEmpty(this);
this.builder = () => {
return new SortedMapBuilder(this);
};
this.maxEntries = 1 << blockSizeBits;
this.minEntries = this.maxEntries >>> 1;
this._empty = new SortedMapEmpty(this);
}

@@ -17,0 +17,0 @@ isNonEmptyInstance(source) {

@@ -9,8 +9,8 @@ import { CustomBase } from '@rimbu/collection-types';

this.typeTag = 'SortedSet';
this.builder = () => {
return new SortedSetBuilder(this);
};
this.maxEntries = 1 << this.blockSizeBits;
this.minEntries = this.maxEntries >>> 1;
this._empty = new SortedSetEmpty(this);
this.builder = () => {
return new SortedSetBuilder(this);
};
}

@@ -17,0 +17,0 @@ isNonEmptyInstance(source) {

@@ -14,3 +14,3 @@ import { CustomBase } from '@rimbu/collection-types';

abstract getAtIndex<O>(index: number, otherwise?: OptLazy<O>): E | O;
abstract entries: readonly E[];
abstract readonly entries: readonly E[];
abstract takeInternal(amount: number): TS;

@@ -112,3 +112,4 @@ abstract dropInternal(amount: number): TS;

abstract _children?: SortedBuilder<E>[];
abstract children: SortedBuilder<E>[];
abstract get children(): SortedBuilder<E>[];
abstract set children(value: SortedBuilder<E>[]);
abstract size: number;

@@ -115,0 +116,0 @@ abstract prepareMutate(): void;

import { CustomBase } from '@rimbu/collection-types';
import { Comp } from '@rimbu/common';
import { SortedMap } from '../internal';
import type { Comp } from '@rimbu/common';
import type { SortedMap } from '../internal';
import { SortedMapBuilder, SortedMapInner, SortedMapLeaf, SortedMapNode } from '../sortedmap-custom';

@@ -8,7 +8,7 @@ export declare class SortedMapContext<UK> extends CustomBase.RMapBase.ContextBase<UK, SortedMap.Types> implements SortedMap.Context<UK> {

readonly comp: Comp<UK>;
readonly maxEntries: number;
readonly minEntries: number;
readonly _empty: SortedMap<any, any>;
constructor(blockSizeBits: number, comp: Comp<UK>);
readonly typeTag = "SortedMap";
readonly maxEntries: number;
readonly minEntries: number;
_empty: SortedMap<any, any>;
isNonEmptyInstance(source: any): source is any;

@@ -15,0 +15,0 @@ builder: <K extends UK, V>() => SortedMapBuilder<K, V>;

@@ -6,3 +6,3 @@ import { Token } from '@rimbu/base';

import { SortedEmpty, SortedNonEmptyBase } from '../sorted-custom';
import { SortedMapBuilder, SortedMapContext } from '../sortedmap-custom';
import type { SortedMapBuilder, SortedMapContext } from '../sortedmap-custom';
export declare class SortedMapEmpty<K = any, V = any> extends SortedEmpty implements SortedMap<K, V> {

@@ -9,0 +9,0 @@ readonly context: SortedMapContext<K>;

@@ -1,4 +0,4 @@

import { CustomBase } from '@rimbu/collection-types';
import type { CustomBase } from '@rimbu/collection-types';
import { Comp, IndexRange, OmitStrong, OptLazy, Range } from '@rimbu/common';
import { Stream, Streamable } from '@rimbu/stream';
import type { Stream, Streamable } from '@rimbu/stream';
/**

@@ -5,0 +5,0 @@ * A type-invariant immutable Map of key type K, and value type V.

@@ -1,2 +0,2 @@

import { RelatedTo } from '@rimbu/common';
import type { RelatedTo } from '@rimbu/common';
import { StreamSource } from '@rimbu/stream';

@@ -3,0 +3,0 @@ import { SortedSet } from '../internal';

import { CustomBase } from '@rimbu/collection-types';
import { Comp } from '@rimbu/common';
import { SortedSet } from '../internal';
import type { Comp } from '@rimbu/common';
import type { SortedSet } from '../internal';
import { SortedSetBuilder, SortedSetInner, SortedSetLeaf, SortedSetNode } from '../sortedset-custom';

@@ -8,8 +8,8 @@ export declare class SortedSetContext<UT> extends CustomBase.RSetBase.ContextBase<UT, SortedSet.Types> implements SortedSet.Context<UT> {

readonly comp: Comp<UT>;
readonly maxEntries: number;
readonly minEntries: number;
readonly _empty: SortedSet<any>;
constructor(blockSizeBits: number, comp: Comp<UT>);
readonly typeTag = "SortedSet";
readonly maxEntries: number;
readonly minEntries: number;
isNonEmptyInstance(source: any): source is any;
readonly _empty: SortedSet<any>;
isValidValue(value: any): value is UT;

@@ -16,0 +16,0 @@ builder: <T extends UT>() => SortedSetBuilder<T>;

@@ -5,3 +5,3 @@ import { ArrayNonEmpty, IndexRange, OptLazy, Range, RelatedTo, ToJSON, TraverseState } from '@rimbu/common';

import { SortedEmpty, SortedNonEmptyBase } from '../sorted-custom';
import { SortedSetContext } from '../sortedset-custom';
import type { SortedSetContext } from '../sortedset-custom';
export declare class SortedSetEmpty<T = any> extends SortedEmpty implements SortedSet<T> {

@@ -8,0 +8,0 @@ readonly context: SortedSetContext<T>;

@@ -1,4 +0,4 @@

import { CustomBase, RSet } from '@rimbu/collection-types';
import type { CustomBase, RSet } from '@rimbu/collection-types';
import { Comp, IndexRange, OmitStrong, OptLazy, Range } from '@rimbu/common';
import { Stream, Streamable } from '@rimbu/stream';
import type { Stream, Streamable } from '@rimbu/stream';
/**

@@ -5,0 +5,0 @@ * A type-invariant immutable Set of value type T.

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

@@ -45,2 +45,3 @@ "keywords": [

"build": "yarn clean && yarn bundle",
"build:deno": "rimraf deno_dist ../../deno_dist/sorted && denoify && cp ../../config/mod_ts_template deno_dist/mod.ts && mv deno_dist ../../deno_dist/sorted",
"bundle": "yarn bundle:main && yarn bundle:module && yarn bundle:types",

@@ -62,6 +63,6 @@ "bundle:main": "tsc --p tsconfig.main.json",

"dependencies": {
"@rimbu/base": "^0.5.9",
"@rimbu/collection-types": "^0.5.11",
"@rimbu/common": "^0.5.9",
"@rimbu/stream": "^0.5.11"
"@rimbu/base": "^0.6.0",
"@rimbu/collection-types": "^0.6.0",
"@rimbu/common": "^0.6.0",
"@rimbu/stream": "^0.6.0"
},

@@ -71,3 +72,6 @@ "publishConfig": {

},
"gitHead": "0158eaad0dec4503e92cb308af952869d68faad5"
"denoify": {
"replacer": "../../config/denoify-rimbu-replacer.js"
},
"gitHead": "dbcaad0cb6b1e31ffa64ca2739b9ddb0fc178ebc"
}
<p align="center">
<img src="../../assets/rimbu_logo.svg" />
<img src="https://github.com/rimbu-org/rimbu/raw/main/assets/rimbu_logo.svg" />
</p>

@@ -18,2 +18,4 @@

Or [Try Me Out](https://codesandbox.io/s/rimbu-sandbox-d4tbk?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox.
## Installation

@@ -37,5 +39,3 @@

{
// ...
"compilerOptions": {
// ...
"skipLibCheck": true,

@@ -42,0 +42,0 @@ "noStrictGenericChecks": true

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

// internal
abstract entries: readonly E[];
abstract readonly entries: readonly E[];

@@ -667,3 +667,4 @@ abstract takeInternal(amount: number): TS;

abstract _children?: SortedBuilder<E>[];
abstract children: SortedBuilder<E>[];
abstract get children(): SortedBuilder<E>[];
abstract set children(value: SortedBuilder<E>[]);
abstract size: number;

@@ -670,0 +671,0 @@ abstract prepareMutate(): void;

import { CustomBase } from '@rimbu/collection-types';
import { Comp } from '@rimbu/common';
import { SortedMap } from '../internal';
import type { Comp } from '@rimbu/common';
import type { SortedMap } from '../internal';
import {

@@ -16,12 +16,18 @@ SortedMapBuilder,

{
readonly maxEntries: number;
readonly minEntries: number;
readonly _empty: SortedMap<any, any>;
constructor(readonly blockSizeBits: number, readonly comp: Comp<UK>) {
super();
this.maxEntries = 1 << blockSizeBits;
this.minEntries = this.maxEntries >>> 1;
this._empty = new SortedMapEmpty<any, any>(this);
}
readonly typeTag = 'SortedMap';
readonly maxEntries = 1 << this.blockSizeBits;
readonly minEntries = this.maxEntries >>> 1;
_empty: SortedMap<any, any> = new SortedMapEmpty<any, any>(this);
isNonEmptyInstance(source: any): source is any {

@@ -28,0 +34,0 @@ return source instanceof SortedMapNode;

@@ -43,3 +43,3 @@ import { Arr, Entry, RimbuError, Token } from '@rimbu/base';

} from '../sorted-custom';
import { SortedMapBuilder, SortedMapContext } from '../sortedmap-custom';
import type { SortedMapBuilder, SortedMapContext } from '../sortedmap-custom';

@@ -46,0 +46,0 @@ export class SortedMapEmpty<K = any, V = any>

@@ -1,4 +0,4 @@

import { CustomBase } from '@rimbu/collection-types';
import type { CustomBase } from '@rimbu/collection-types';
import { Comp, IndexRange, OmitStrong, OptLazy, Range } from '@rimbu/common';
import { Stream, Streamable } from '@rimbu/stream';
import type { Stream, Streamable } from '@rimbu/stream';
import { SortedMapContext } from '../sortedmap-custom';

@@ -5,0 +5,0 @@

@@ -1,2 +0,2 @@

import { RelatedTo } from '@rimbu/common';
import type { RelatedTo } from '@rimbu/common';
import { Stream, StreamSource } from '@rimbu/stream';

@@ -3,0 +3,0 @@ import { SortedIndex, SortedSet } from '../internal';

import { CustomBase } from '@rimbu/collection-types';
import { Comp } from '@rimbu/common';
import { SortedSet } from '../internal';
import type { Comp } from '@rimbu/common';
import type { SortedSet } from '../internal';
import {

@@ -16,9 +16,17 @@ SortedSetBuilder,

{
readonly maxEntries: number;
readonly minEntries: number;
readonly _empty: SortedSet<any>;
constructor(readonly blockSizeBits: number, readonly comp: Comp<UT>) {
super();
this.maxEntries = 1 << this.blockSizeBits;
this.minEntries = this.maxEntries >>> 1;
this._empty = new SortedSetEmpty<any>(this);
}
readonly typeTag = 'SortedSet';
readonly maxEntries = 1 << this.blockSizeBits;
readonly minEntries = this.maxEntries >>> 1;

@@ -29,4 +37,2 @@ isNonEmptyInstance(source: any): source is any {

readonly _empty: SortedSet<any> = new SortedSetEmpty<any>(this);
isValidValue(value: any): value is UT {

@@ -33,0 +39,0 @@ return this.comp.isComparable(value);

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

} from '../sorted-custom';
import { SortedSetContext } from '../sortedset-custom';
import type { SortedSetContext } from '../sortedset-custom';

@@ -44,0 +44,0 @@ export class SortedSetEmpty<T = any>

@@ -1,4 +0,4 @@

import { CustomBase, RSet } from '@rimbu/collection-types';
import type { CustomBase, RSet } from '@rimbu/collection-types';
import { Comp, IndexRange, OmitStrong, OptLazy, Range } from '@rimbu/common';
import { Stream, Streamable } from '@rimbu/stream';
import type { Stream, Streamable } from '@rimbu/stream';
import { SortedSetContext } from '../sortedset-custom';

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

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