UNPKG

@jsopen/objects

Version:

Helper utilities for working with JavaScript objects and arrays

11 lines (10 loc) 266 B
import { merge } from './merge.js'; export function clone(obj, options) { return merge({}, obj, { ...options, deep: options?.deep ?? true, }); } export function deepClone(obj, options) { return clone(obj, { ...options, deep: 'full' }); }