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 `@thi.ng/equiv` for checking key equivalence.

    Parameters

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

    Returns EquivMap

Properties

Static Map

Map: MapConstructor

Accessors

__@species

__@toStringTag

  • get __@toStringTag(): string
  • Returns string

size

  • get size(): number

Methods

__@iterator

  • __@iterator(): IterableIterator<Pair<K, V>>
  • Returns IterableIterator<Pair<K, V>>

clear

  • clear(): void

copy

delete

  • delete(key: K): boolean
  • Parameters

    • key: K

    Returns boolean

dissoc

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

empty

entries

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

equiv

  • equiv(o: any): boolean

forEach

  • forEach(fn: Fn3<V, Readonly<K>, Map<K, V>, void>, thisArg?: any): void
  • Parameters

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

    Returns void

get

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

    • key: K
    • Optional notFound: V

    Returns V | undefined

has

  • has(key: K): boolean
  • Parameters

    • key: K

    Returns boolean

into

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

    • pairs: Iterable<Pair<K, V>>

    Returns this

keys

  • keys(): IterableIterator<K>

opts

set

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

    • key: K
    • value: V

    Returns this

values

  • values(): IterableIterator<V>

Static fromObject

  • Converts given vanilla object into an EquivMap instance with default (or optionally provided) options and returns it. By default uses strict === equality check for equiv option.

    Type parameters

    • T

    Parameters

    • obj: IObjectOf<T>
    • Optional opts: Partial<EquivMapOpts<string>>

    Returns EquivMap<string, T>

Generated using TypeDoc