function cloneItree(itree, excludeKeys) {
    var clone = {};
    excludeKeys = castArray(excludeKeys);
    excludeKeys.push('ref');
    each(itree, function (v, k) {
      if (!includes(excludeKeys, k)) {
        clone[k] = cloneDeep(v);
      }
    });
    if (!excludeKeys.includes('parent')) {
      Object.defineProperty(clone, 'parent', {
        value: itree.parent,
        writable: true
      });
    }
    return clone;
  }
Helper method to clone an ITree config object.

Rejects non-clonable properties like ref.

@private
@param {object} itree ITree configuration object
@param {array} excludeKeys Keys to exclude, if any
@return {object} Cloned ITree.