Skip to content

clone

clone(target)

Creates a shallow copy of an object, unless marked as mutable with markAsMutable inside a mutation context (see @monstermann/remmi).

ts
const original = { a: 1, b: 2 };
const copy = clone(original); // { a: 1, b: 2 }
ts
const original = { a: 1, b: 2 };
const copy = pipe(original, clone()); // { a: 1, b: 2 }