code: function cloneObj(obj, exclude) {
    var type = _typeof(obj);
  
    switch (type) {
      case 'undefined':
      case 'boolean':
      case 'nuber':
      case 'string':
      case 'function':
        return obj;
        break;
  
      case 'object':
        if (obj === null) {
          // null is object
          return obj;
        }
  
        var r;
  
        if (isArray(obj)) {
          r = [];
          var _iteratorNormalCompletion3 = true;
          var _didIteratorError3 = false;
          var _iteratorError3 = undefined;
  
          try {
            for (var _iterator3 = obj[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
              var item = _step3.value;
              r.push(cloneObj(item, exclude));
            }
          } catch (err) {
            _didIteratorError3 = true;
            _iteratorError3 = err;
          } finally {
            try {
              if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
                _iterator3.return();
              }
            } finally {
              if (_didIteratorError3) {
                throw _iteratorError3;
              }
            }
          }
        } else {
          r = {};
  
          for (var _i7 = 0, _Object$keys2 = Object.keys(obj); _i7 < _Object$keys2.length; _i7++) {
            var key = _Object$keys2[_i7];
  
            if (!exclude || isArray(exclude) && !exclude.includes(key) || !exclude(key, obj[key], obj)) {
              r[key] = cloneObj(obj[key], exclude);
            }
          }
        }
  
        return r;
        break;
  
      default:
        return obj;
        break;
    }
  }
docs: exclude: array or function