Skip to main content
Module

x/froebel/clone.ts>default

A strictly typed utility library.
Go to Latest
variable default
import { default } from "https://deno.land/x/froebel@v0.19.0/clone.ts";

Returns a copied version of value.

If value is primitive, returns value. Otherwise, properties of value are copied recursively. Only value's own enumerable properties are cloned. Arrays are cloned by mapping over their elements.

If a path in value references itself or a parent path, then in the resulting object that path will also reference the path it referenced in the original object (but now in the resuling object instead of the original).

type

<T>(value: T) => T