Skip to main content
Module

x/domain_functions/src/index.ts>mergeObjects

Decouple your business logic from your framework. With first-class type inference from end to end.
Go to Latest
function mergeObjects
import { mergeObjects } from "https://deno.land/x/domain_functions@v2.6.0/src/index.ts";

Merges a list of objects into a single object. It is a type-safe version of Object.assign.

Examples

const obj1 = { a: 1, b: 2 } const obj2 = { c: 3 } const obj3 = { d: 4 } const merged = mergeObjects([obj1, obj2, obj3]) // ^? { a: number, b: number, c: number, d: number }

Type Parameters

optional
T extends unknown[] = unknown[]

Parameters

objs: T

the list of objects to merge