Skip to content

ObjectMerge

Namespace: Vercel.AI.Util

public static class ObjectMerge

Deep-merges JSON objects. Arrays, dates, and regular expressions are replaced.

Inheritance: object

View source

MergeObjects(IDictionary<string, object>?, IDictionary<string, object>?)

Section titled “MergeObjects(IDictionary<string, object>?, IDictionary<string, object>?)”
public static IDictionary<string, object>? MergeObjects(IDictionary<string, object>? baseObject, IDictionary<string, object>? overrides)

Merges <code class=“paramref”>overrides</code> onto a copy of <code class=“paramref”>baseObject</code>. Undefined override values are skipped. __proto__, constructor, and prototype are ignored. Returns null when both inputs are null.

Parameters

Name Type Description
baseObject IDictionary<string, object>
overrides IDictionary<string, object>

Returns: IDictionary<string, object>

View source

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