A local version of Object.assign() for old node versions.

@param {Array} [...=[{}]]     Objects to assign (in order).
@returns {Object}
428433
function assign() {
    arguments[0] = arguments[0] || {};

    for (var n=1; n<arguments.length; n++) {
      for (var key in arguments[n]) {
        if (arguments[n].hasOwnProperty(key)) arguments[0][key] = arguments[n][key];
      }
    }
    return arguments[0];
  }
174758
private void assign(final Object val,
                      final Collection<Object> col,
                      final Object o,
                      final Method meth) throws Throwable {
    if (col != null) {
      col.add(val);
    } else {
      Object[] pars = new Object[]{val};

      meth.invoke(o, pars);
    }
  }
1182170
function clone(obj) {
    if (typeof obj !== 'object') {
        return obj;
    }
    var ret;
    if (util.isArray(obj)) {
        ret = [];
        obj.forEach(function (val) {
            ret.push(clone(val));
        });
        return ret;
    }
    ret = {};
    Object.keys(obj).forEach(function (key) {
        ret[key] = clone(obj[key]);
    });
    return ret;
}
163437
function objectFromPairs(pairs) {
  var result = {};

  for (let i = 0, len = pairs.length; i < len; i++) {
    let pair = pairs[i];
    result[pair[0]] = pair[1];
  }

  return result;
}
140674
function convertToObject(args) {
	let result = {};

	args.forEach((arg, i) => {
		if (Array.isArray(arg)) {
			result[arg[0]] = arg[1];
		} else {
			if (i % 2 === 0) {
				result[arg] = undefined;
			} else {
				result[args[i - 1]] = arg;
			}
		}
	});

	return result;
}
715414
function (opts) {
        var objectName = opts.name
        var object = null

        this.objects.forEach(function (item) {
            if (item.name == objectName) {
                object = item
            }
        })
        if (object !== null) {
            return object
        }
    }
1332690
function object(pairs) {
  let obj = {};
  for (let i = 0;i<pairs.length;++i) {
    obj[pairs[i][0]] = pairs[i][1];
  }
  return obj;
}
189135
function copy(obj) {
  if (obj == null) {
    return obj;
  }

  if (array(obj)) {
    return obj.slice();
  } else if (plainObject(obj)) {
    return clone(obj);
  } else {
    return obj;
  }
}
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;
}
154623
function(obj) {
            var rest = slice.call(arguments, 1);

            for (var i = 0; i < rest.length; i++) {
                var source = rest[i];

                if (source) {
                    for (var prop in source) {
                        obj[prop] = source[prop];
                    }
                }
            }

            return obj;
        }
104951
function AssignmentExpression(node) {
    var state = crawl(node.right);
    if (state.hasCall && state.hasHelper || state.hasFunction) {
      return {
        before: state.hasFunction,
        after: true
      };
    }
  }
1281680
function _cloneObject(object) {
    if (object == null || typeof object != 'object' || typeof object.nodeType != 'undefined') {
        return object;
    }
    var temp = {};
    for (var key in object) {
        if (typeof jQuery != 'undefined' && object[key] instanceof jQuery) {
            temp[key] = object[key];
        } else {
            temp[key] = _cloneObject(object[key]);
        }
    }
    return temp;
}
571311
function mergeObject (oldObject, newObject) {
  let oldCopy = Object.assign({}, oldObject)

  function _merge (oo, no) {
    for (let key in no) {
      if (key in oo) {
        // Follow structure of oo
        if (oo[key] === Object(oo[key])) {
          _merge(oo[key], no[key])
        } else if (no[key] !== Object(no[key])) {
          oo[key] = no[key]
        }
      } else {
        // Plain assign
        oo[key] = no[key]
      }
    }
    return oo
  }

  return _merge(oldCopy, newObject)
}
160641
function(obj) {
			var result = {};
			var keys = this.toArray(arguments, 1);
			Object.keys(obj).forEach(function(key) {
				if (~keys.indexOf(key)) {
					result[key] = obj[key];
				}
			});
			return result;
		}
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;
    }
  }
1261587
function set (target, key, value) {
  const obj = {}
  obj[key] = value
  return Object.assign({}, target, obj)
}
1177890
function regenerateObject(root, holder, current, seen, retrieve, undry_paths, old, current_path) {

	var path,
	    temp,
	    key;

	for (key in current) {
		if (current.hasOwnProperty(key)) {
			// Only regenerate if it's not already seen
			if (!seen.get(current[key])) {
				path = current_path.slice(0);
				path.push(key);

				temp = regenerate(root, current, current[key], seen, retrieve, undry_paths, old, path);

				// @TODO: Values returned by `unDry` methods also get regenerated,
				// even though these could contain properties coming from somewhere else,
				// like live HTMLCollections. Assigning anything to that will throw an error.
				// This is a workaround to that proble: if the value is exactly the same,
				// it's not needed to assign it again, so it won't throw an error,
				// but it's not an ideal solution.
				if (temp !== current[key]) {
					current[key] = temp;
				}
			}
		}
	}

	return current;
}