Skip to content

MiniMap

Defined in: src/structures/Utils.ts:426

  • Map<K, V>
Type Parameter
K
V
new MiniMap<K, V>(data: [K, V][]): MiniMap<K, V>;

Defined in: src/structures/Utils.ts:431

ParameterTypeDefault value
data[K, V][][]

MiniMap<K, V>

Map<K, V>.constructor
PropertyModifierTypeDescriptionInherited fromDefined in
[toStringTag]readonlystring-Map.[toStringTag]docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137
constructorpublicMiniMapConstructorThe initial value of Object.prototype.constructor is the standard built-in Object constructor.-src/structures/Utils.ts:427
sizereadonlynumber-Map.sizedocs/node_modules/typescript/lib/lib.es2015.collection.d.ts:45
[species]readonlyMapConstructor--docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319
iterator: MapIterator<[K, V]>;

Defined in: docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:143

Returns an iterable of entries in the map.

MapIterator<[K, V]>

Map.[iterator]

clear(): void;

Defined in: docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:20

void

Map.clear

delete(key: K): boolean;

Defined in: docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:24

ParameterType
keyK

boolean

true if an element in the Map existed and has been removed, or false if the element does not exist.

Map.delete

entries(): MapIterator<[K, V]>;

Defined in: docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:148

Returns an iterable of key, value pairs for every entry in the map.

MapIterator<[K, V]>

Map.entries

filter<K2>(fn: (value: V, key: K, miniMap: this) => key is K2): MiniMap<K2, V>;

Defined in: src/structures/Utils.ts:446

Identical to Array.filter(), but returns a MiniMap instead of an Array.

Type Parameter
K2
ParameterTypeDescription
fn(value: V, key: K, miniMap: this) => key is K2The function to test with (should return boolean)

MiniMap<K2, V>

miniMap.filter(user => user.username === 'Bob');
filter<V2>(fn: (value: V, key: K, miniMap: this) => value is V2): MiniMap<K, V2>;

Defined in: src/structures/Utils.ts:447

Identical to Array.filter(), but returns a MiniMap instead of an Array.

Type Parameter
V2
ParameterTypeDescription
fn(value: V, key: K, miniMap: this) => value is V2The function to test with (should return boolean)

MiniMap<K, V2>

miniMap.filter(user => user.username === 'Bob');
filter(fn: (value: V, key: K, miniMap: this) => boolean): MiniMap<K, V>;

Defined in: src/structures/Utils.ts:448

Identical to Array.filter(), but returns a MiniMap instead of an Array.

ParameterTypeDescription
fn(value: V, key: K, miniMap: this) => booleanThe function to test with (should return boolean)

MiniMap<K, V>

miniMap.filter(user => user.username === 'Bob');
filter<This, K2>(fn: (this: This, value: V, key: K, miniMap: this) => key is K2, thisArg: This): MiniMap<K2, V>;

Defined in: src/structures/Utils.ts:449

Identical to Array.filter(), but returns a MiniMap instead of an Array.

Type Parameter
This
K2
ParameterTypeDescription
fn(this: This, value: V, key: K, miniMap: this) => key is K2The function to test with (should return boolean)
thisArgThisValue to use as this when executing function

MiniMap<K2, V>

miniMap.filter(user => user.username === 'Bob');
filter<This, V2>(fn: (this: This, value: V, key: K, miniMap: this) => value is V2, thisArg: This): MiniMap<K, V2>;

Defined in: src/structures/Utils.ts:453

Identical to Array.filter(), but returns a MiniMap instead of an Array.

Type Parameter
This
V2
ParameterTypeDescription
fn(this: This, value: V, key: K, miniMap: this) => value is V2The function to test with (should return boolean)
thisArgThisValue to use as this when executing function

MiniMap<K, V2>

miniMap.filter(user => user.username === 'Bob');
filter<This>(fn: (this: This, value: V, key: K, miniMap: this) => boolean, thisArg: This): MiniMap<K, V>;

Defined in: src/structures/Utils.ts:457

Identical to Array.filter(), but returns a MiniMap instead of an Array.

Type Parameter
This
ParameterTypeDescription
fn(this: This, value: V, key: K, miniMap: this) => booleanThe function to test with (should return boolean)
thisArgThisValue to use as this when executing function

MiniMap<K, V>

miniMap.filter(user => user.username === 'Bob');

forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;

Defined in: docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:28

Executes a provided function once per each key/value pair in the Map, in insertion order.

ParameterType
callbackfn(value: V, key: K, map: Map<K, V>) => void
thisArg?any

void

Map.forEach

get(key: K): V;

Defined in: docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:33

Returns 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.

ParameterType
keyK

V

Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.

Map.get

has(key: K): boolean;

Defined in: docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:37

ParameterType
keyK

boolean

boolean indicating whether an element with the specified key exists or not.

Map.has

keys(): MapIterator<K>;

Defined in: docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:153

Returns an iterable of keys in the map

MapIterator<K>

Map.keys

map<T>(fn: (value: V, key: K, miniMap: this) => T): T[];

Defined in: src/structures/Utils.ts:481

Maps each item to another value into an array. Identical in behavior to Array.map().

Type Parameter
T
ParameterTypeDescription
fn(value: V, key: K, miniMap: this) => TFunction that produces an element of the new array, taking three arguments

T[]

miniMap.map(user => user.tag);
map<This, T>(fn: (this: This, value: V, key: K, miniMap: this) => T, thisArg: This): T[];

Defined in: src/structures/Utils.ts:482

Maps each item to another value into an array. Identical in behavior to Array.map().

Type Parameter
This
T
ParameterTypeDescription
fn(this: This, value: V, key: K, miniMap: this) => TFunction that produces an element of the new array, taking three arguments
thisArgThisValue to use as this when executing function

T[]

miniMap.map(user => user.tag);

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

Defined in: docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:41

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.

ParameterType
keyK
valueV

this

Map.set

toJSON(): [K, V][];

Defined in: src/structures/Utils.ts:467

[K, V][]


values(): MapIterator<V>;

Defined in: docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:158

Returns an iterable of values in the map

MapIterator<V>

Map.values

static groupBy<K, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Map<K, T[]>;

Defined in: docs/node_modules/typescript/lib/lib.es2024.collection.d.ts:25

Groups members of an iterable according to the return value of the passed callback.

Type Parameter
K
T
ParameterTypeDescription
itemsIterable<T>An iterable.
keySelector(item: T, index: number) => KA callback which will be invoked for each item in items.

Map<K, T[]>