Replace a key deeply in an object
@param obj
@param keyMap
@returns {Object}
771504
function replaceKeyDeep(obj, keyMap) {
  return Object.keys(obj).reduce((memo, key)=> {

    // determine which key we are going to use
    let targetKey = keyMap[key] ? keyMap[key] : key;

    if (Array.isArray(obj[key])) {
      // recurse if an array
      memo[targetKey] = obj[key].map((val) => {
        if (Object.prototype.toString.call(val) === '[object Object]') {
          return replaceKeyDeep(val, keyMap);
        }
        return val;
      });
    } else if (Object.prototype.toString.call(obj[key]) === '[object Object]') {
      // recurse if Object
      memo[targetKey] = replaceKeyDeep(obj[key], keyMap);
    } else {
      // assign the new value
      memo[targetKey] = obj[key];
    }

    // return the modified object
    return memo;
  }, {});
}
1091209
function transform( obj ) {
	var keys;
	var out;
	var i;
	if ( !isObject( obj ) ) {
		throw new TypeError( 'invalid input argument. Must provide an object. Value: `' + obj + '`.' );
	}
	keys = getKeys( obj );
	out = new Array( keys.length );
	for ( i = 0; i < keys.length; i++ ) {
		out[ i ] = obj[ keys[i] ];
	}
	return out;
}
1312562
function mapObject(o, fn, ctxt) {
  var result = {};
  for (var key in o) {
    if (o.hasOwnProperty(key)) {
      result[key] = fn.call(ctxt, o[key], key, o);
    }
  }
  return result;
}
720634
function internal(obj) {
  if (!privateMap.has(obj)) {
    privateMap.set(obj, {});
  }

  return privateMap.get(obj);
}
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;
}
854376
function(obj, keys) {
    var newObj = {};
    for (var prop in obj) {
      if (keys.indexOf(prop) === -1) {
        newObj[prop] = obj[prop];
      }
    }
    return newObj;
  }
652606
function toDryObject(value, replacer) {
	var root = {'': value};
	return createDryReplacer(root, replacer)(root, '', value);
}
1247459
private void onKeyUpdated(final int index, final Map.Entry<String, String> object, final String value) {
        final HashMap<String, String> _m = new LinkedHashMap<String, String>(getValue());
        final String lastKeyValue = object.getKey();
        String mapValue = "";
        if (lastKeyValue != null) {
            mapValue = _m.remove(lastKeyValue);
        }
        _m.put(value, mapValue);
        setValue(_m, true);
    }
170937
function deepAssign(object, source) {
    for (var key in source) {
        if (source.hasOwnProperty(key)) {
            if (typeof object[key] === "object" && typeof source[key] === "object") {
                deepAssign(object[key], source[key]);
            } else {
                object[key] = source[key];
            }
        }
    }

    return object;
}
18141
function reviveObject (object, reviver) {
  let revived = {};

  for (let key in object) {
    if (object.hasOwnProperty(key)) {
      revived[key] = reviveValue(object, key, object[key], reviver);
    }
  }

  return revived;
}
1007875
public boolean replace(K key, V oldValue, V newValue) {
        if (oldValue == null || newValue == null) {
            throw new NullPointerException();
        }
        int hash = this.hashOf(key);
        return this.segmentFor(hash).replace(key, hash, oldValue, newValue);
    }
1206261
function getObjectWithKeyAsMjs(key, object) {
	const mjsContents = Object.keys(object).reduce((mjsLines, name) => {
		mjsLines.push(`\t'${escapeForJS(name)}': '${escapeForJS(object[name])}'`);

		return mjsLines;
	}, []).join(',\n');
	const mjs = `export const ${key} = {\n${mjsContents}\n};\n`;

	return mjs;
}
436088
function mapObjectInPlace(o, fn, ctxt) {
  for (let key in o) {
    if (o.hasOwnProperty(key)) {
      o[key] = fn.call(ctxt, o[key], key, o);
    }
  }
  return o;
}
515610
function transformKeysToCamelCase (obj) {
  var camelKey;
  var key;
  for (key in obj) {
    camelKey = toCamelCase(key);
    if (key === camelKey) { continue; }
    obj[camelKey] = obj[key];
    delete obj[key];
  }
  return obj;
}
1042987
function(obj, keys) {
    return keys.reduce(function(memo, key) {
      if (obj[key] !== undefined) {
        memo[key] = obj[key];
      }

      return memo;
    }, {});
  }
1111626
function (key, obj) {
        'use strict';
        var keysArr = key.split('.'),
            lastKeyPart = keysArr.pop(),
            len = keysArr.length,
            i, k, objNext;
        for (i = 0; i < len; i += 1) {
            k = keysArr[i];
            objNext = obj[k];
            if (!isObj(objNext)) {
                objNext = obj[k] = {};
            }
            obj = objNext;
        }
        return {
            node: obj,
            key: lastKeyPart
        };
    }
761385
function(obj, stringKey) {
            var parts           = stringKey.split('.'),
                returnCurrent   = null,
                current         = '',
                i               = 0;

            if (!stringKey) {
                return obj;
            }

            returnCurrent = function(obj) {
                if (!obj) {
                    return null;
                } else {
                    return obj[current];
                }
            };

            while (i < parts.length) {
                current = parts[i];

                obj = returnCurrent(obj);

                i++;
            }

            if (typeof obj !== 'undefined') {
                return obj;
            } else {
                return null;
            }
        }