IdMap<T>
Namespace: Vercel.AI.Util
public sealed class IdMap<T>String-keyed map with no inherited members. Missing keys, including __proto__, return the default value.
Type parameters
| Name | Description |
|---|---|
T |
Inheritance: object
Properties
Section titled “Properties”public IReadOnlyList<string> Keys { get; }Own keys in insertion order.
Value: IReadOnlyList<string>
Prototype
Section titled “Prototype”public object? Prototype { get; }No prototype object is consulted. Always null.
Value: object
Methods
Section titled “Methods”Get(string?)
Section titled “Get(string?)”public T? Get(string? key)Returns the own value, or default when <code class=“paramref”>key</code> is absent.
Parameters
| Name | Type | Description |
|---|---|---|
key |
string |
Returns: T
Has(string?)
Section titled “Has(string?)”public bool Has(string? key)Returns whether <code class=“paramref”>key</code> is an own key.
Parameters
| Name | Type | Description |
|---|---|---|
key |
string |
Returns: bool
Set(string, T)
Section titled “Set(string, T)”public void Set(string key, T value)Stores <code class=“paramref”>value</code> under <code class=“paramref”>key</code> as an own entry.
Parameters
| Name | Type | Description |
|---|---|---|
key |
string | |
value |
T |
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product