Skip to main content

clone

Clones an object.

Signature

clone<T>(object:T): T

Parameters

NameTypeOptionalDescription
objectTNoSpecifies the object to clone.

Return value

Returns a clone of the object which is no reference to the original object.

Example

import { clone } from "@tripetto/runner";

clone({ a: 1, b: 2 }); // Returns `{ a: 1, b: 2 }`