Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/froebel/clone.ts>default

A strictly typed utility library.
Latest
variable default
import { default } from "https://deno.land/x/froebel@v0.23.2/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