InMemoryStore
Defined in: src/backends/memory.ts:12
A simple in-memory store
Extends
Section titled “Extends”Map<number,Uint8Array>
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryStore(
maxSize?,label?):InMemoryStore
Defined in: src/backends/memory.ts:17
Parameters
Section titled “Parameters”maxSize?
Section titled “maxSize?”number = size_max
label?
Section titled “label?”string
Returns
Section titled “Returns”InMemoryStore
Overrides
Section titled “Overrides”Map<number, Uint8Array>.constructor
Properties
Section titled “Properties”[toStringTag]
Section titled “[toStringTag]”
readonly[toStringTag]:string
Defined in: ../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:135
Inherited from
Section titled “Inherited from”Map.[toStringTag]
readonlyflags: readonly []
Defined in: src/backends/memory.ts:13
Use for optimizations
Implementation of
Section titled “Implementation of”label?
Section titled “label?”
readonlyoptionallabel?:string
Defined in: src/backends/memory.ts:19
A name for this instance of the store. For example, you might use a share name for a network-based store
Implementation of
Section titled “Implementation of”maxSize
Section titled “maxSize”
readonlymaxSize:number=size_max
Defined in: src/backends/memory.ts:18
readonlyname:string='tmpfs'
Defined in: src/backends/memory.ts:15
What the file system using this store should be called. For example, tmpfs for an in memory store
Implementation of
Section titled “Implementation of”
readonlysize:number
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:46
Returns
Section titled “Returns”the number of elements in the Map.
Inherited from
Section titled “Inherited from”Map.size
[species]
Section titled “[species]”
readonlystatic[species]:MapConstructor
Defined in: ../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:317
Inherited from
Section titled “Inherited from”Map.[species]
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get bytes():
number
Defined in: src/backends/memory.ts:30
Returns
Section titled “Returns”number
Methods
Section titled “Methods”[iterator]()
Section titled “[iterator]()”[iterator]():
MapIterator<[number,Uint8Array<ArrayBufferLike>]>
Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:141
Returns an iterable of entries in the map.
Returns
Section titled “Returns”MapIterator<[number, Uint8Array<ArrayBufferLike>]>
Inherited from
Section titled “Inherited from”Map.[iterator]
clear()
Section titled “clear()”clear():
void
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:21
Removes all elements from the Map.
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Map.clear
delete()
Section titled “delete()”delete(
key):boolean
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:25
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Map.delete
entries()
Section titled “entries()”entries():
MapIterator<[number,Uint8Array<ArrayBufferLike>]>
Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:146
Returns an iterable of key, value pairs for every entry in the map.
Returns
Section titled “Returns”MapIterator<[number, Uint8Array<ArrayBufferLike>]>
Inherited from
Section titled “Inherited from”Map.entries
forEach()
Section titled “forEach()”forEach(
callbackfn,thisArg?):void
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:29
Executes a provided function once per each key/value pair in the Map, in insertion order.
Parameters
Section titled “Parameters”callbackfn
Section titled “callbackfn”(value, key, map) => void
thisArg?
Section titled “thisArg?”any
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Map.forEach
get(
key):Uint8Array<ArrayBufferLike> |undefined
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:34
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
Section titled “Parameters”number
Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | undefined
Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Map.get
getOrInsert()
Section titled “getOrInsert()”getOrInsert(
key,defaultValue):Uint8Array
Defined in: ../../node_modules/typescript/lib/lib.esnext.collection.d.ts:25
Returns a specified element from the Map object.
If no element is associated with the specified key, a new element with the value defaultValue will be inserted into the Map and returned.
Parameters
Section titled “Parameters”number
defaultValue
Section titled “defaultValue”Uint8Array
Returns
Section titled “Returns”Uint8Array
The element associated with the specified key, which will be defaultValue if no element previously existed.
Inherited from
Section titled “Inherited from”Map.getOrInsert
getOrInsertComputed()
Section titled “getOrInsertComputed()”getOrInsertComputed(
key,callback):Uint8Array
Defined in: ../../node_modules/typescript/lib/lib.esnext.collection.d.ts:31
Returns a specified element from the Map object.
If no element is associated with the specified key, the result of passing the specified key to the callback function will be inserted into the Map and returned.
Parameters
Section titled “Parameters”number
callback
Section titled “callback”(key) => Uint8Array
Returns
Section titled “Returns”Uint8Array
The element associated with the specific key, which will be the newly computed value if no element previously existed.
Inherited from
Section titled “Inherited from”Map.getOrInsertComputed
has(
key):boolean
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:38
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”boolean
boolean indicating whether an element with the specified key exists or not.
Inherited from
Section titled “Inherited from”Map.has
keys()
Section titled “keys()”keys():
MapIterator<number>
Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:151
Returns an iterable of keys in the map
Returns
Section titled “Returns”MapIterator<number>
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Map.keys
set(
key,value):this
Defined in: ../../node_modules/typescript/lib/lib.es2015.collection.d.ts:42
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
Section titled “Parameters”number
Uint8Array
Returns
Section titled “Returns”this
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”Map.set
sync()
Section titled “sync()”sync():
Promise<void>
Defined in: src/backends/memory.ts:24
Syncs the store
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”transaction()
Section titled “transaction()”transaction():
SyncMapTransaction
Defined in: src/backends/memory.ts:26
Begins a new transaction.
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”usage()
Section titled “usage()”usage():
UsageInfo
Defined in: src/backends/memory.ts:36
Usage information for the store
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”values()
Section titled “values()”values():
MapIterator<Uint8Array<ArrayBufferLike>>
Defined in: ../../node_modules/typescript/lib/lib.es2015.iterable.d.ts:156
Returns an iterable of values in the map
Returns
Section titled “Returns”MapIterator<Uint8Array<ArrayBufferLike>>
Inherited from
Section titled “Inherited from”Map.values
groupBy()
Section titled “groupBy()”
staticgroupBy<K,T>(items,keySelector):Map<K,T[]>
Defined in: ../../node_modules/typescript/lib/lib.es2024.collection.d.ts:23
Groups members of an iterable according to the return value of the passed callback.
Type Parameters
Section titled “Type Parameters”K
T
Parameters
Section titled “Parameters”Iterable<T>
An iterable.
keySelector
Section titled “keySelector”(item, index) => K
A callback which will be invoked for each item in items.
Returns
Section titled “Returns”Map<K, T[]>
Inherited from
Section titled “Inherited from”Map.groupBy