<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>Sets a key-value pair in the MutableHashMap, mutating the map in place. If the key already exists, its value is updated.
When to use
Use to insert a new MutableHashMap entry or replace an existing entry in
place.
Example (Setting key-value pairs)
import { MutableHashMap } from "effect"
const map = MutableHashMap.empty<string, number>()
// Add new entries
MutableHashMap.set(map, "key1", 42)
MutableHashMap.set(map, "key2", 100)
console.log(MutableHashMap.get(map, "key1")) // Some(42)
console.log(MutableHashMap.size(map)) // 2
// Update existing entry
MutableHashMap.set(map, "key1", 999)
console.log(MutableHashMap.get(map, "key1")) // Some(999)
// Pipe-able version
const setKey = MutableHashMap.set("key3", 300)
setKey(map)
console.log(MutableHashMap.size(map)) // 3export const 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>
}
Sets a key-value pair in the MutableHashMap, mutating the map in place.
If the key already exists, its value is updated.
When to use
Use to insert a new MutableHashMap entry or replace an existing entry in
place.
Example (Setting key-value pairs)
import { MutableHashMap } from "effect"
const map = MutableHashMap.empty<string, number>()
// Add new entries
MutableHashMap.set(map, "key1", 42)
MutableHashMap.set(map, "key2", 100)
console.log(MutableHashMap.get(map, "key1")) // Some(42)
console.log(MutableHashMap.size(map)) // 2
// Update existing entry
MutableHashMap.set(map, "key1", 999)
console.log(MutableHashMap.get(map, "key1")) // Some(999)
// Pipe-able version
const setKey = MutableHashMap.set("key3", 300)
setKey(map)
console.log(MutableHashMap.size(map)) // 3
set: {
<function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V>(key: Kkey: function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, value: Vvalue: function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V): (self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V>) => interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V>
<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>(self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>, key: Kkey: function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, value: Vvalue: function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V): interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>
} = import dualdual<
<function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V>(key: Kkey: function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, value: Vvalue: function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V) => (self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V>) => interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>K, function (type parameter) V in <K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>V>,
<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>(self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>, key: Kkey: function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, value: Vvalue: function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V) => interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>
>(3, <function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>(self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self: interface MutableHashMap<out K, out V>A mutable hash map that stores key-value pairs and supports both referential
and Effect structural equality.
When to use
Use as a mutable key-value map when in-place updates are acceptable and keys
may rely on Effect structural equality.
Details
Operations mutate the map in place. Keys that implement Equal / Hash can
be looked up structurally; other keys use normal JavaScript reference or
primitive equality.
Example (Using a mutable hash map)
import { MutableHashMap } from "effect"
// Create a mutable hash map with string keys and number values
const map: MutableHashMap.MutableHashMap<string, number> = MutableHashMap
.empty()
// Add some data
MutableHashMap.set(map, "count", 42)
MutableHashMap.set(map, "total", 100)
// Use as iterable
for (const [key, value] of map) {
console.log(`${key}: ${value}`)
}
// Output:
// count: 42
// total: 100
// Convert to array
const entries = Array.from(map)
console.log(entries) // [["count", 42], ["total", 100]]
MutableHashMap<function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V>, key: Kkey: function (type parameter) K in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>K, value: Vvalue: function (type parameter) V in <K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>V) => {
if (self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<K, V>.backing: Map<K, V>backing.Map<K, V>.has(key: K): booleanhas(key: Kkey) || const isSimpleKey: (u: unknown) => booleanisSimpleKey(key: Kkey)) {
self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<K, V>.backing: Map<K, V>backing.Map<K, V>.set(key: K, value: V): Map<K, V>Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
set(key: Kkey, value: Vvalue)
return self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self
}
let let refKey: anyrefKey = const referentialKeysCache: WeakMap<
any,
any
>
referentialKeysCache.WeakMap<any, any>.get(key: any): anyget(self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self)
if (let refKey: anyrefKey !== var undefinedundefined && self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<K, V>.backing: Map<K, V>backing.Map<K, V>.has(key: K): booleanhas(let refKey: anyrefKey)) {
self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<K, V>.backing: Map<K, V>backing.Map<K, V>.set(key: K, value: V): Map<K, V>Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
set(let refKey: anyrefKey, value: Vvalue)
return self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self
}
const const hash: anyhash = import HashHash.hash(key: Kkey)
const const bucket: anybucket = self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<out K, out V>.buckets: Map<number, NonEmptyArray<K>>buckets.Map<number, NonEmptyArray<K>>.get(key: number): anyReturns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
get(const hash: anyhash)
if (const bucket: anybucket === var undefinedundefined) {
self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<out K, out V>.buckets: Map<number, NonEmptyArray<K>>buckets.Map<number, NonEmptyArray<K>>.set(key: number, value: NonEmptyArray<K>): Map<number, NonEmptyArray<K>>Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
set(const hash: anyhash, [key: Kkey])
self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<K, V>.backing: Map<K, V>backing.Map<K, V>.set(key: K, value: V): Map<K, V>Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
set(key: Kkey, value: Vvalue)
return self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self
}
let refKey: anyrefKey = const getRefKey: <K>(
bucket: NonEmptyArray<K>,
key: K
) => K | undefined
getRefKey(const bucket: anyconst bucket: {
0: K;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
pop: () => K | undefined;
push: (...items: Array<K>) => number;
concat: { (...items: Array<ConcatArray<K>>): Array<K>; (...items: Array<K | ConcatArray<K>>): Array<K> };
join: (separator?: string) => string;
reverse: () => Array<K>;
shift: () => K | undefined;
slice: (start?: number, end?: number) => Array<K>;
sort: (compareFn?: ((a: K, b: K) => number) | undefined) => [K, ...K[]];
splice: { (start: number, deleteCount?: number): Array<K>; (start: number, deleteCount: number, ...items: Array<K>): Array<K> };
unshift: (...items: Array<K>) => number;
indexOf: (searchElement: K, fromIndex?: number) => number;
lastIndexOf: (searchElement: K, fromIndex?: number) => number;
every: { (predicate: (value: K, index: number, array: Array<K>) => value is S, thisArg?: any): this is S[]; (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: K, index: number, array: Array<K>) => void, thisArg?: any) => void;
map: (callbackfn: (value: K, index: number, array: Array<K>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: K, index: number, array: Array<K>) => value is S, thisArg?: any): Array<S>; (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any): Array<K> };
reduce: { (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K): K; (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K, initialValue: K): K; (callbackfn: (previousVa…;
reduceRight: { (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K): K; (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K, initialValue: K): K; (callbackfn: (previousVa…;
find: { (predicate: (value: K, index: number, obj: Array<K>) => value is S, thisArg?: any): S | undefined; (predicate: (value: K, index: number, obj: Array<K>) => unknown, thisArg?: any): K | undefined };
findIndex: (predicate: (value: K, index: number, obj: Array<K>) => unknown, thisArg?: any) => number;
fill: (value: K, start?: number, end?: number) => [K, ...K[]];
copyWithin: (target: number, start: number, end?: number) => [K, ...K[]];
entries: () => ArrayIterator<[number, K]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<K>;
includes: (searchElement: K, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: K, index: number, array: Array<K>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => K | undefined;
findLast: { (predicate: (value: K, index: number, array: Array<K>) => value is S, thisArg?: any): S | undefined; (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any): K | undefined };
findLastIndex: (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any) => number;
toReversed: () => Array<K>;
toSorted: (compareFn?: ((a: K, b: K) => number) | undefined) => Array<K>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<K>): Array<K>; (start: number, deleteCount?: number): Array<K> };
with: (index: number, value: K) => Array<K>;
}
bucket, key: Kkey)
if (let refKey: anyrefKey === var undefinedundefined) {
const bucket: anyconst bucket: {
0: K;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
pop: () => K | undefined;
push: (...items: Array<K>) => number;
concat: { (...items: Array<ConcatArray<K>>): Array<K>; (...items: Array<K | ConcatArray<K>>): Array<K> };
join: (separator?: string) => string;
reverse: () => Array<K>;
shift: () => K | undefined;
slice: (start?: number, end?: number) => Array<K>;
sort: (compareFn?: ((a: K, b: K) => number) | undefined) => [K, ...K[]];
splice: { (start: number, deleteCount?: number): Array<K>; (start: number, deleteCount: number, ...items: Array<K>): Array<K> };
unshift: (...items: Array<K>) => number;
indexOf: (searchElement: K, fromIndex?: number) => number;
lastIndexOf: (searchElement: K, fromIndex?: number) => number;
every: { (predicate: (value: K, index: number, array: Array<K>) => value is S, thisArg?: any): this is S[]; (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any): boolean };
some: (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: K, index: number, array: Array<K>) => void, thisArg?: any) => void;
map: (callbackfn: (value: K, index: number, array: Array<K>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: K, index: number, array: Array<K>) => value is S, thisArg?: any): Array<S>; (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any): Array<K> };
reduce: { (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K): K; (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K, initialValue: K): K; (callbackfn: (previousVa…;
reduceRight: { (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K): K; (callbackfn: (previousValue: K, currentValue: K, currentIndex: number, array: Array<K>) => K, initialValue: K): K; (callbackfn: (previousVa…;
find: { (predicate: (value: K, index: number, obj: Array<K>) => value is S, thisArg?: any): S | undefined; (predicate: (value: K, index: number, obj: Array<K>) => unknown, thisArg?: any): K | undefined };
findIndex: (predicate: (value: K, index: number, obj: Array<K>) => unknown, thisArg?: any) => number;
fill: (value: K, start?: number, end?: number) => [K, ...K[]];
copyWithin: (target: number, start: number, end?: number) => [K, ...K[]];
entries: () => ArrayIterator<[number, K]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<K>;
includes: (searchElement: K, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: K, index: number, array: Array<K>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => K | undefined;
findLast: { (predicate: (value: K, index: number, array: Array<K>) => value is S, thisArg?: any): S | undefined; (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any): K | undefined };
findLastIndex: (predicate: (value: K, index: number, array: Array<K>) => unknown, thisArg?: any) => number;
toReversed: () => Array<K>;
toSorted: (compareFn?: ((a: K, b: K) => number) | undefined) => Array<K>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<K>): Array<K>; (start: number, deleteCount?: number): Array<K> };
with: (index: number, value: K) => Array<K>;
}
bucket.push(key: Kkey)
let refKey: anyrefKey = key: Kkey
}
self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self.MutableHashMap<K, V>.backing: Map<K, V>backing.Map<K, V>.set(key: K, value: V): Map<K, V>Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
set(let refKey: anyrefKey, value: Vvalue)
return self: MutableHashMap<K, V>(parameter) self: {
backing: Map<K, V>;
buckets: Map<number, NonEmptyArray<K>>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
self
})