Socket
Socket
Sign inDemoInstall

advanced-collections

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    advanced-collections

Advanced collections include BiMap, SortedMap and SortedSet.


Version published
Weekly downloads
7
increased by40%
Maintainers
1
Install size
56.3 kB
Created
Weekly downloads
 

Readme

Source

Advanced-Collections

Advanced collections include BiMap, SortedMap and SortedSet.

API declarations

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;
}

Keywords

FAQs

Last updated on 17 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc