# advanced-collections

> Advanced collections include BiMap, SortedMap and SortedSet.

Latest version **0.1.2** (published 2019-07-17) · MIT license · 5 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install advanced-collections
pnpm add advanced-collections
yarn add advanced-collections
bun add advanced-collections
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2019-07-17 |
| First published | 2019-03-17 |
| Weekly downloads | 5 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ayon Lee |
| Maintainers | hyurl |
| Keywords | collections, BiMap, SortedMap, SortedSet |

## Links

- npm: https://www.npmjs.com/package/advanced-collections
- Repository: https://github.com/hyurl/advanced-collections
- Homepage: https://github.com/hyurl/advanced-collections#readme
- Issues: https://github.com/hyurl/advanced-collections/issues
- npm.io page: https://npm.io/package/advanced-collections

## Dependencies (1)

- [literal-toolkit](https://npm.io/package/literal-toolkit.md) ^1.2.10

## Recent versions

- 0.1.2 (latest) — 2019-07-17
- 0.1.1 — 2019-03-17
- 0.1.0 — 2019-03-17

## README

# Advanced-Collections

**Advanced collections include BiMap, SortedMap and SortedSet.**

## API declarations

```typescript
export declare namespace utils {
    const keys: symbol;
    const values: symbol;
    function inherit<T, S>(ctor: T, base: S): S & T;
    function labelize(value: any): string;
    function findInsertIndex<T>(item: T, container: T[], comparator: (a: T, b: T) => number): number;
    function fixToStringTag<T>(ctor: T): T;
    function throwNotEntryError(item: any): never;
    function throwNotIterableError(input: any): never;
}

export declare abstract class BaseMap<K, V> extends Map<K, V> {
    protected [utils.keys]: K[];
    protected [utils.values]: V[];
    constructor(iterable: Iterable<K, V>, props?: any);
    protected removeByIndex(index: number): boolean;
    abstract set(key: K, value: V): this;
}

export declare class BiMap<K = any, V = any> extends BaseMap<K, V> {
    constructor(iterable?: Iterable<[K, V]>);
    getKey(value: V): K;
    hasValue(value: V): boolean;
    deleteValue(value: V): boolean;
    inverse(): BiMap<V, K>;
    forEach(callback: (value: V, key: K, map: BiMap<K, V>) => void, thisArg?: any): void;
}

export declare class SortedMap<K = any, V = any> extends BaseMap<K, V> {
    protected comparator: (a: K, b: K) => number;
    constructor(comparator?: (a: K, b: K) => number);
    constructor(iterable: Iterable<[K, V]>, comparator?: (a: K, b: k) => number);
    reverse(): SortedMap<K, V>;
    forEach(callback: (value: V, key: K, map: SortedMap<K, V>) => void, thisArg?: any): void;
}

export declare class SortedSet<T = any> extends Set<T> {
    protected [utils.values]: T[];
    protected comparator: (a: T, b: T) => number;
    constructor(comparator?: (a: T, b: T) => number);
    constructor(iterable: Iterable<T>, comparator?: (a: T, b: T) => number);
    reverse(): SortedSet<T>;
    forEach(callback: (value: T, value2: T, set: SortedSet<T>) => void, thisArg?: any): void;
}
```

---
_Source: https://npm.io/package/advanced-collections · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
