Skip to content

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

View source

public IReadOnlyList<string> Keys { get; }

Own keys in insertion order.

Value: IReadOnlyList<string>

View source

public object? Prototype { get; }

No prototype object is consulted. Always null.

Value: object

View source

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

View source

public bool Has(string? key)

Returns whether <code class=“paramref”>key</code> is an own key.

Parameters

Name Type Description
key string

Returns: bool

View source

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

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product