Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EquivMap<K, V>

Type parameters

  • K

  • V

Hierarchy

  • Map<K, V>
    • EquivMap

Implements

Index

Constructors

constructor

  • Creates a new instance with optional initial key-value pairs and provided options. If no opts are given, uses ArraySet for storing canonical keys and {@link @thi.ng/equiv#equiv} for checking key equivalence.

    Parameters

    • Optional pairs: Iterable<Pair<K, V>> | null

      key-value pairs

    • Optional opts: Partial<EquivMapOpts<K>>

      config options

    Returns EquivMap

Properties

Static Map

Map: MapConstructor

Accessors

[Symbol.species]

[Symbol.toStringTag]

  • get [Symbol.toStringTag](): string

size

  • get size(): number

Methods

[Symbol.iterator]

  • [Symbol.iterator](): IterableIterator<Pair<K, V>>

clear

  • clear(): void

copy

delete

  • delete(key: K): boolean

dissoc

  • dissoc(keys: Iterable<K>): this

empty

entries

  • entries(): IterableIterator<Pair<K, V>>

equiv

  • equiv(o: any): boolean

forEach

  • forEach(fn: Fn3<V, K, Map<K, V>, void>, thisArg?: any): void
  • The key & value args given the callback fn MUST be treated as readonly/immutable. This could be enforced via TS, but would break ES6 Map interface contract.

    Parameters

    • fn: Fn3<V, K, Map<K, V>, void>
    • Optional thisArg: any

    Returns void

get

  • get(key: K, notFound?: V): V | undefined

has

  • has(key: K): boolean

into

  • into(pairs: Iterable<Pair<K, V>>): this

keys

  • keys(): IterableIterator<K>

opts

set

  • set(key: K, value: V): this

values

  • values(): IterableIterator<V>

Generated using TypeDoc