-
Notifications
You must be signed in to change notification settings - Fork 0
@ralphschuler.better map.BetterMap
@ralphschuler/better-map.BetterMap
A better Map class that has some more useful methods.
| Name | Description |
|---|---|
k |
The type of the keys. |
v |
The type of the values. |
-
Map<k,v>↳
BetterMap
• new BetterMap<k, v>(entries?): BetterMap<k, v>
| Name |
|---|
k |
v |
| Name | Type |
|---|---|
entries? |
null | readonly readonly [k, v][] |
BetterMap<k, v>
Map<k, v>.constructor
node_modules/typescript/lib/lib.es2015.collection.d.ts:50
• new BetterMap<k, v>(iterable?): BetterMap<k, v>
| Name |
|---|
k |
v |
| Name | Type |
|---|---|
iterable? |
null | Iterable<readonly [k, v]> |
BetterMap<k, v>
Map<k, v>.constructor
node_modules/typescript/lib/lib.es2015.iterable.d.ts:159
• Readonly [toStringTag]: string
Map.[toStringTag]
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137
• Readonly size: number
Map.size
node_modules/typescript/lib/lib.es2015.collection.d.ts:45
▪ Static Readonly [species]: MapConstructor
Map.[species]
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319
▸ [iterator](): IterableIterator<[k, v]>
Returns an iterable of entries in the map.
IterableIterator<[k, v]>
Map.[iterator]
node_modules/typescript/lib/lib.es2015.iterable.d.ts:119
▸ clear(): void
void
Map.clear
node_modules/typescript/lib/lib.es2015.collection.d.ts:20
▸ delete(key): boolean
| Name | Type |
|---|---|
key |
k |
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Map.delete
node_modules/typescript/lib/lib.es2015.collection.d.ts:24
▸ entries(): IterableIterator<[k, v]>
Returns an iterable of key, value pairs for every entry in the map.
IterableIterator<[k, v]>
Map.entries
node_modules/typescript/lib/lib.es2015.iterable.d.ts:124
▸ filter(predicate): BetterMap<k, v>
Filters the map by a predicate.
| Name | Type | Description |
|---|---|---|
predicate |
(v: v, k: k) => boolean
|
The predicate to filter by. |
BetterMap<k, v>
A new map with the filtered values.
packages/better-map/src/index.ts:26
▸ forEach(callbackfn, thisArg?): void
Executes a provided function once per each key/value pair in the Map, in insertion order.
| Name | Type |
|---|---|
callbackfn |
(value: v, key: k, map: Map<k, v>) => void
|
thisArg? |
any |
void
Map.forEach
node_modules/typescript/lib/lib.es2015.collection.d.ts:28
▸ get(key): undefined | v
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.
| Name | Type |
|---|---|
key |
k |
undefined | v
Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
Map.get
node_modules/typescript/lib/lib.es2015.collection.d.ts:33
▸ has(key): boolean
| Name | Type |
|---|---|
key |
k |
boolean
boolean indicating whether an element with the specified key exists or not.
Map.has
node_modules/typescript/lib/lib.es2015.collection.d.ts:37
▸ keys(): IterableIterator<k>
Returns an iterable of keys in the map
Map.keys
node_modules/typescript/lib/lib.es2015.iterable.d.ts:129
▸ merge(map, resolve?): void
Maps the map by a predicate.
| Name | Type |
|---|---|
map |
Map<k, v> |
resolve |
(k: k, a: v, b: v) => v
|
void
A new map with the mapped values.
packages/better-map/src/index.ts:40
▸ set(key, value): BetterMap<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.
| Name | Type |
|---|---|
key |
k |
value |
v |
BetterMap<k, v>
Map.set
node_modules/typescript/lib/lib.es2015.collection.d.ts:41
▸ update(key, updater, notset?): void
Updates a value in the map if it exists, otherwise sets it to the default value.
| Name | Type | Description |
|---|---|---|
key |
k |
The key of the value to update. |
updater |
(v: v, k: k) => v
|
The function to update the value with. |
notset? |
v |
The default value to set if the key does not exist. |
void
packages/better-map/src/index.ts:16
▸ values(): IterableIterator<v>
Returns an iterable of values in the map
Map.values
node_modules/typescript/lib/lib.es2015.iterable.d.ts:134
- @ralphschuler/ai-function-caller
- index
- types/AIFunction
- types/Message
- @ralphschuler/assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- assert
- error
- index
- util
- @ralphschuler/better-map
- @ralphschuler/better-set
- @ralphschuler/binary-serializer
- @ralphschuler/bit-mask
- @ralphschuler/complex-compare
- @ralphschuler/i811n
- @ralphschuler/logger
- Color
- ColorMap
- Logger
- animations/BallonAnimation
- animations/BaseAnimation
- animations/BombAnimation
- animations/BouncingBallAnimation
- animations/ClockAnimation
- animations/DotsAnimation
- animations/HorizontalBarAnimation
- animations/PongAnimation
- animations/ProgressAnimation
- animations/ProgressBarAnimation
- animations/SpinnerAnimation
- animations/VerticalBarAnimation
- enums/LogLevel
- index
- interfaces/IColor
- interfaces/IMessage
- types/ColorName
- types/Colors
- @ralphschuler/lsystem
- @ralphschuler/mixin-class-factory
- @ralphschuler/neuronal-network
- @ralphschuler/parser-combinator
- index
- inputTypes
- parser
- unicode
- @ralphschuler/prom-metrics-decorator
- @ralphschuler/prom-metrics-parser
- @ralphschuler/random
- PseudoRandomItemSelector
- PseudoRandomNumberGenerator
- Seed
- index
- strategies
- strategy
- strategy
- strategy
- strategy
- strategy
- strategy
- types
- type
- type
- type
- @ralphschuler/safe-array
- @ralphschuler/slot-mashine
- @ralphschuler/state-store
- StateStore
- index
- type
- type
- type
- type
- type
- type
- type
- type
- util
- @ralphschuler/stats-tracker
- @ralphschuler/ts-error
- error
- index
- type
- util
- util
- util
- util
- @ralphschuler/webgl-sand-engine
- index
- pixel-renderer
- @ralphschuler/webgl-shader-factory
- "node:stream/consumers"
- "node:stream/promises"
- ChatCompletionSnapshot
- Choice
- Message
- ToolCall
- EventEmitter
- FormData
- OpenAI
- OpenAI
- Audio
- Speech
- Transcriptions
- Translations
- Beta
- Assistants
- Assistant
- AssistantCreateParams
- AssistantUpdateParams
- Files
- Chat
- Threads
- Messages
- Files
- MessageContentImageFile
- MessageContentText
- Text
- FileCitation
- FilePath
- Runs
- RequiredActionFunctionToolCall
- Run
- RequiredAction
- RunCreateParams
- RunSubmitToolOutputsParams
- Steps
- CodeToolCall
- CodeInterpreter
- Image
- FunctionToolCall
- MessageCreationStepDetails
- RunStep
- ThreadCreateAndRunParams
- Thread
- ThreadCreateParams
- Chat
- Completions
- ChatCompletion
- ChatCompletionAssistantMessageParam
- ChatCompletionChunk
- Choice
- Delta
- ToolCall
- ChatCompletionContentPartImage
- ChatCompletionCreateParams
- ChatCompletionMessage
- ChatCompletionMessageToolCall
- ChatCompletionNamedToolChoice
- Completions
- CompletionChoice
- CompletionCreateParams
- Edits
- Edit
- Embeddings
- CreateEmbeddingResponse
- Files
- FineTunes
- FineTune
- FineTuneCreateParams
- FineTuneListEventsParams
- FineTuning
- Jobs
- FineTuningJob
- JobCreateParams
- Images
- Models
- Moderations
- Moderation
- internal
- finished
- pipeline
- "node:stream/consumers"
- "node:stream/promises"
- EventEmitter
- internal
- finished
- pipeline
- Counter
- Gauge
- Histogram
- Summary