MiniMap
Extends
Map
<K
,V
>
Type Parameters
Type Parameter |
---|
K |
V |
Constructors
new MiniMap()
Parameters
Parameter | Type | Default value |
---|---|---|
data | [K , V ][] | [] |
Returns
MiniMap
<K
, V
>
Inherited from
Map<K, V>.constructor
Defined in
Properties
Property | Modifier | Type | Description | Inherited from | Defined in |
---|---|---|---|---|---|
[toStringTag] | readonly | string | - | Map.[toStringTag] | docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137 |
constructor | public | MiniMapConstructor | The initial value of Object.prototype.constructor is the standard built-in Object constructor. | - | src/structures/Utils.ts:404 |
size | readonly | number | Map.size | docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:45 | |
[species] | readonly | MapConstructor | - | - | docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319 |
Methods
[iterator]()
Returns an iterable of entries in the map.
Returns
MapIterator
<[K
, V
]>
Inherited from
Map.[iterator]
Defined in
docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:143
clear()
Returns
void
Inherited from
Map.clear
Defined in
docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:20
delete()
Parameters
Parameter | Type |
---|---|
key | K |
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Inherited from
Map.delete
Defined in
docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:24
entries()
Returns an iterable of key, value pairs for every entry in the map.
Returns
MapIterator
<[K
, V
]>
Inherited from
Map.entries
Defined in
docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:148
filter()
filter(fn)
Identical to Array.filter(), but returns a MiniMap instead of an Array.
Type Parameters
Type Parameter |
---|
K2 |
Parameters
Parameter | Type | Description |
---|---|---|
fn | (value : V , key : K , miniMap : this ) => key is K2 | The function to test with (should return boolean) |
Returns
MiniMap
<K2
, V
>
Example
Defined in
filter(fn)
Type Parameters
Type Parameter |
---|
V2 |
Parameters
Parameter | Type |
---|---|
fn | (value : V , key : K , miniMap : this ) => value is V2 |
Returns
MiniMap
<K
, V2
>
Defined in
filter(fn)
Parameters
Parameter | Type |
---|---|
fn | (value : V , key : K , miniMap : this ) => boolean |
Returns
MiniMap
<K
, V
>
Defined in
filter(fn, thisArg)
Type Parameters
Type Parameter |
---|
This |
K2 |
Parameters
Parameter | Type |
---|---|
fn | (this : This , value : V , key : K , miniMap : this ) => key is K2 |
thisArg | This |
Returns
MiniMap
<K2
, V
>
Defined in
filter(fn, thisArg)
Type Parameters
Type Parameter |
---|
This |
V2 |
Parameters
Parameter | Type |
---|---|
fn | (this : This , value : V , key : K , miniMap : this ) => value is V2 |
thisArg | This |
Returns
MiniMap
<K
, V2
>
Defined in
filter(fn, thisArg)
Type Parameters
Type Parameter |
---|
This |
Parameters
Parameter | Type |
---|---|
fn | (this : This , value : V , key : K , miniMap : this ) => boolean |
thisArg | This |
Returns
MiniMap
<K
, V
>
Defined in
forEach()
Executes a provided function once per each key/value pair in the Map, in insertion order.
Parameters
Parameter | Type |
---|---|
callbackfn | (value : V , key : K , map : Map <K , V >) => void |
thisArg ? | any |
Returns
void
Inherited from
Map.forEach
Defined in
docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:28
get()
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.
Parameters
Parameter | Type |
---|---|
key | K |
Returns
V
Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
Inherited from
Map.get
Defined in
docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:33
has()
Parameters
Parameter | Type |
---|---|
key | K |
Returns
boolean
boolean indicating whether an element with the specified key exists or not.
Inherited from
Map.has
Defined in
docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:37
keys()
Returns an iterable of keys in the map
Returns
MapIterator
<K
>
Inherited from
Map.keys
Defined in
docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:153
map()
map(fn)
Maps each item to another value into an array. Identical in behavior to Array.map().
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
fn | (value : V , key : K , miniMap : this ) => T | Function that produces an element of the new array, taking three arguments |
Returns
T
[]
Example
Defined in
map(fn, thisArg)
Type Parameters
Type Parameter |
---|
This |
T |
Parameters
Parameter | Type |
---|---|
fn | (this : This , value : V , key : K , miniMap : this ) => T |
thisArg | This |
Returns
T
[]
Defined in
set()
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.
Parameters
Parameter | Type |
---|---|
key | K |
value | V |
Returns
this
Inherited from
Map.set
Defined in
docs/node_modules/typescript/lib/lib.es2015.collection.d.ts:41
toJSON()
Returns
[K
, V
][]
Defined in
values()
Returns an iterable of values in the map
Returns
MapIterator
<V
>
Inherited from
Map.values
Defined in
docs/node_modules/typescript/lib/lib.es2015.iterable.d.ts:158
groupBy()
Groups members of an iterable according to the return value of the passed callback.
Type Parameters
Type Parameter |
---|
K |
T |
Parameters
Parameter | Type | Description |
---|---|---|
items | Iterable <T , any , any > | An iterable. |
keySelector | (item : T , index : number ) => K | A callback which will be invoked for each item in items. |
Returns
Map
<K
, T
[]>
Defined in
docs/node_modules/typescript/lib/lib.esnext.collection.d.ts:25