Skip to main content Link Search Menu Expand Document (external link)

MutableHashMap overview

Added in v2.0.0


Table of contents


constructors

empty

Signature

export declare const empty: <K, V>() => MutableHashMap<K, V>

Added in v2.0.0

fromIterable

Creates a new MutableHashMap from an iterable collection of key/value pairs.

Signature

export declare const fromIterable: <K, V>(entries: Iterable<readonly [K, V]>) => MutableHashMap<K, V>

Added in v2.0.0

make

Signature

export declare const make: <Entries extends (readonly [any, any])[]>(
  ...entries: Entries
) => MutableHashMap<
  Entries[number] extends readonly [infer K, any] ? K : never,
  Entries[number] extends readonly [any, infer V] ? V : never
>

Added in v2.0.0

elements

get

Signature

export declare const get: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => Option.Option<V>
  <K, V>(self: MutableHashMap<K, V>, key: K): Option.Option<V>
}

Added in v2.0.0

has

Signature

export declare const has: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => boolean
  <K, V>(self: MutableHashMap<K, V>, key: K): boolean
}

Added in v2.0.0

size

Signature

export declare const size: <K, V>(self: MutableHashMap<K, V>) => number

Added in v2.0.0

models

MutableHashMap (interface)

Signature

export interface MutableHashMap<out K, out V> extends Iterable<[K, V]>, Pipeable, Inspectable {
  readonly [TypeId]: TypeId
  /** @internal */
  readonly referential: Map<K, V>
  /** @internal */
  readonly buckets: Map<number, NonEmptyArray<readonly [K & Equal.Equal, V]>>
  /** @internal */
  bucketsSize: number
}

Added in v2.0.0

symbol

TypeId (type alias)

Signature

export type TypeId = typeof TypeId

Added in v2.0.0

utils

clear

Signature

export declare const clear: <K, V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>

Added in v2.0.0

modify

Updates the value of the specified key within the MutableHashMap if it exists.

Signature

export declare const modify: {
  <K, V>(key: K, f: (v: V) => V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, f: (v: V) => V): MutableHashMap<K, V>
}

Added in v2.0.0

modifyAt

Set or remove the specified key in the MutableHashMap using the specified update function.

Signature

export declare const modifyAt: {
  <K, V>(key: K, f: (value: Option.Option<V>) => Option.Option<V>): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, f: (value: Option.Option<V>) => Option.Option<V>): MutableHashMap<K, V>
}

Added in v2.0.0

remove

Signature

export declare const remove: {
  <K>(key: K): <V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K): MutableHashMap<K, V>
}

Added in v2.0.0

set

Signature

export declare const set: {
  <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>
  <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>
}

Added in v2.0.0