• Deep clones an object

    Parameters

    • obj: any

      The object to clone

    • Optionalpredicate: deepClonePredicate

      A function that can be used to skip certain properties from being cloned

    Returns any

    The cloned object

    const clone = deepClone(obj, (owner, propertyName, current) => {
    if (propertyName === "dontCloneMe") return false;
    return true;
    });