set
ts
function Object.set<T extends object, K extends keyof T>(
target: T,
key: K,
value: T[K],
): TCreates a new object with the key property set to value.
Example
ts
import { Object } from "@monstermann/object";
Object.set({ a: 1, b: 2 }, "a", 3); // { a: 3, b: 2 }ts
import { Object } from "@monstermann/object";
pipe({ a: 1, b: 2 }, Object.set("a", 3)); // { a: 3, b: 2 }