**_shallowCopyKeys()**

Will make a shallow copy of `ob` containing `keysToCopy`. If `copyNullEtc`
is true it will not copy `null` or `undefined` values.

* **@param {Object} `ob`**
* **@param {Array} `keysToCopy`**
* **@param {Boolean} `copyNullEtc`**
176187
function(ob,keysToCopy,copyNullEtc) {
	var k = '',
		r = {};
	for (k in ob) {
		if (
			ob.hasOwnProperty(k) &&
			(
				(keysToCopy === undefined) ||
				(keysToCopy.indexOf(k) > -1)
			)
		) {
			if (copyNullEtc || ((ob[k] !== null) && (ob[k] !== undefined))) {
				r[k] = ob[k];
			}
		}
	}
	return r;
}
176621
function shallowEqual(objA, objB) {
  if (isSameRef(objA, objB)) {
    return true
  }

  if (
    typeof objA !== 'object' ||
    objA === null ||
    typeof objB !== 'object' ||
    objB === null
  ) {
    return false
  }

  const keysA = Object.keys(objA)
  const keysB = Object.keys(objB)

  if (keysA.length !== keysB.length) {
    return false
  }

  for (let k of keysA) {
    if (!objB.hasOwnProperty(k)) {
      return false
    } else if (!isSameRef(objA[k], objB[k])) {
      return false
    }
  }

  return true
}
998293
function deepFreeze(obj) {
    // if it's already frozen, don't bother going deep into it...
    if (obj === null || typeof obj === 'undefined' || typeof obj.toJS === 'function' || typeof obj !== 'object') {
        return obj;
    }

    // Retrieve the property names defined on obj
    let propNames = Object.getOwnPropertyNames(obj);
    let properties = {toJS: {value: mirror.bind(obj)}};

    if (Array.isArray(obj)) {
        // create a copy and deep freeze all entries
        obj = obj.slice(0).map(deepFreeze);
        // re-attach some important methods
        ['map', 'forEach', 'find', 'indexOf', 'filter', 'some', 'every', 'lastIndexOf', 'slice'].forEach(fn => {
            properties[fn] = {value: function () { return deepFreeze(Array.prototype[fn].apply(obj, arguments));}};
        });
    }

    // Freeze properties before freezing self
    for (let index = 0, prop; prop = obj[propNames[index]], index < propNames.length; index += 1) {
        // Freeze prop if it is an object
        properties[propNames[index]] = {
            enumerable: true,
            get () {
                return deepFreeze(prop);
            },
            set (newValue) {
                throw new Error('Cannot change property "' + propNames[index] + '" to "' + newValue + '" of an immutable object');
            }
        }
    }

    // Freeze self (no-op if already frozen)
    return Object.freeze(Object.create(Object.getPrototypeOf(obj), properties));
}
562966
function shallowClone(obj) {
    let result = {};
    for (let p in obj) {
        if (obj.hasOwnProperty(p)) {
            result[p] = obj[p];
        }
    }
    return result;
}
1204303
function shallowCopy(t) {
  if (Array.isArray(t)) {
    return [].concat(_toConsumableArray(t));
  } else if (t && (typeof t === 'undefined' ? 'undefined' : _typeof(t)) === 'object') {
    return Object.assign(new t.constructor(), t);
  }
  return t;
}
325358
function updateKeys(obj, _) {
    var newObj = null;
    if (_.isArray(obj)) {
        newObj = [];
    } else if (_.isObject(obj)) {
        newObj = {};
    } else {
        return obj;
    }
    _.forEach(obj, function(value, key) {
        if (key.replace) {
            var newKey = key.replace(/\$|\./g, '_');
            newObj[newKey] = updateKeys(value, _);
        } else {
            newObj[key] = updateKeys(value, _);
        }
    });
    return newObj;
}
1205369
function compactObject(object) {
	var keys = Object.keys(object);
	var copy = {};
        
        var key, datum;
        for (var i = 0, l = keys.length; i < l; i++) {
            key = keys[i];
            datum = object[key];
            if (datum) {
            	copy[key] = datum;
            }
        }

        return copy;
}
1098128
function deepCopy(obj)
{
	var ret, key;
	var marker = '__deepCopy';

	if (obj && obj[marker])
		throw (new Error('attempted deep copy of cyclic object'));

	if (obj && obj.constructor == Object) {
		ret = {};
		obj[marker] = true;

		for (key in obj) {
			if (key == marker)
				continue;

			ret[key] = deepCopy(obj[key]);
		}

		delete (obj[marker]);
		return (ret);
	}

	if (obj && obj.constructor == Array) {
		ret = [];
		obj[marker] = true;

		for (key = 0; key < obj.length; key++)
			ret.push(deepCopy(obj[key]));

		delete (obj[marker]);
		return (ret);
	}

	/*
	 * It must be a primitive type -- just return it.
	 */
	return (obj);
}
434176
function deepCopy(obj) {
	var res;
	var i;
	var key;
	if (isTerminal(obj)) {
		res = obj;
	} else if (Array.isArray(obj)) {
		res = Array(obj.length);
		for (i = 0; i < obj.length; i++) {
			res[i] = deepCopy(obj[i]);
		}
	} else {
		res = {};
		for (key in obj) {
			res[key] = deepCopy(obj[key]);
		}
	}
	return res;
}
854376
function(obj, keys) {
    var newObj = {};
    for (var prop in obj) {
      if (keys.indexOf(prop) === -1) {
        newObj[prop] = obj[prop];
      }
    }
    return newObj;
  }
1249987
function _deepKeys(obj, prefix = null) {
  return Object.keys(obj).reduce(function(acc, key){
    var value = obj[key];

    if (_isObject(value)) {
      acc.push.apply(acc, _deepKeys(value, prefix ? prefix + '.' + key : key));
    } else {
      acc.push(prefix ? prefix + '.' + key : key);
    }

    return acc;
  }, []);
}
1287853
function deepCopy(source) {
	let result;
	let type = typeof source;
	if (type !== 'object' || source === null) {
		result = source;
	} else if (source instanceof Array) {
		result = [];
		for (let i = 0, l = source.length; i < l; i++) {
			result[i] = typeof source[i] === 'object' ? deepCopy(source[i]) : source[i];
		}
	} else {
		result = {};
		for (let k in source) {
			result[k] = typeof source[k] === 'object' ? deepCopy(source[k]) : source[k];
		}
	}
	return result;
}
1223372
function (obj, key) {
        'use strict';
        var fn = getFnCache[key];
        if (!fn) {
            fn = getFnNestedValue(key);
            getFnCache[key] = fn;
        }
        return fn(obj);
    }
266764
function clone(obj) {
    var copy;
    if (obj === null || typeof obj !== 'object') {
      return obj;
    }
    if (obj instanceof Array) {
      copy = [];
      for (var i = obj.length - 1; i >= 0; i--) {
        copy[i] = clone(obj[i]);
      }
      return copy;
    }
    /* istanbul ignore else */
    if (obj instanceof Object) {
      copy = {};
      for (var key in obj) {
        copy[key] = clone(obj[key]);
      }
      return copy;
    }
  }
1062732
function _copy_property(opts, key, a, b) {
	debug.assert(opts).is('object');
	debug.assert(key).is('string');
	debug.assert(a).is('object');
	debug.assert(b).is('object');

	a[key] = b[key];

	if(opts.cache && opts.cache._has_cursors && is.obj(b[key]) && b[key].hasOwnProperty('$id')) {
		var f = opts.cache.findCursor(b, key);
		if(f) {
			//debug.log('Expanding cursor...');
			opts.cache.addToCursor(f, a, key);
		}

	}
}
919781
function deepFreeze(obj) {
  Object.freeze(obj);
  forEachKeyValue(obj, (name, prop) => {
    const type = typeof obj;
    if (
      prop !== null &&
      (type === 'object' || type === 'function') &&
      !Object.isFrozen(prop)
    ) {
      deepFreeze(prop);
    }
  });
  return obj;
}
1152479
function keys(obj) {
    var keyArray = [];
    var key;

    for (key in obj) {
        if (obj.hasOwnProperty(key)) {
            keyArray.push(key);
        }
    }

    return keyArray;
}