import { patch } from "https://deno.land/x/ayonli_jsext@v0.9.72/object/index.ts";
Copies the key-value pairs that are presented in the source objects but are missing in the target object into the target, later pairs are skipped if the same key already exists.
This function mutates the target object and returns it.
Examples
Example 1
Example 1
import { patch } from "@ayonli/jsext/object";
const obj1 = { foo: "Hello" };
const obj2 = { foo: "Hi", bar: "World" };
console.log(patch(obj1, obj2)); // { foo: "Hello", bar: "World" }