Take a flattened object and return a nested object
@param {Object} obj The flattened object
@return {Object} The unflattened object
168781
function unflatten(obj) {
	var out = {};
	_.forEach(obj, function(v, k) {
		_.set(out, k, v);
	});
	return out;
}
1351821
function flatten(source) {
  var output = {};

  function step(object, prev) {
    for (var key in object) {
      if (has.call(object, key)) {
        var value = object[key];
        var newKey = prev ? prev + ' ' + key : key;

        if (!is.array(value) && is.object(value)) {
          return step(value, newKey);
        }

        output[newKey] = value;
      }
    }
  }

  step(source);

  return output;
}
1191290
function (obj) {
        this.obj = obj;
        /**
             * Check if the wrapped object is defined
             * @returns true if the wrapped object is defined, false otherwise
             */
        this.isPresent = function () {
          return angular.isDefined(this.obj) && this.obj !== null;
        };
        /**
             * Return the wrapped object or an empty object
             * @returns the wrapped objector an empty object
             */
        this.orEmptyObj = function () {
          if (this.isPresent()) {
            return this.obj;
          }
          return {};
        };
        /**
             * Return the wrapped object or the given second choice
             * @returns the wrapped object or the given second choice
             */
        this.or = function (secondChoice) {
          if (this.isPresent()) {
            return this.obj;
          }
          return secondChoice;
        };
      }
495823
@SuppressWarnings("unchecked")
    public Object transform(final Object obj) {
        if (obj != null && !(obj instanceof BeanMap)) {
            Class clazz = obj.getClass();
            if (clazz.isArray()) {
                return _transform((Object[]) obj);
            } else if (obj instanceof Map) {
                return _transform((Map) obj);
            } else if (obj instanceof List) {
                return _transform((List) obj);
            } else if (obj instanceof Set) {
                return _transform((Set) obj);
            } else if (obj instanceof Collection) {
                return _transform((Collection) obj);
            } else if (obj instanceof Iterable) {
                return _transform((Iterable) obj);
            } else if (obj instanceof Iterator) {
                return _transform((Iterator) obj);
            } else if (needTransform(obj)) {
                return onTransform(obj);
            }
        }
        return obj;
    }
630265
function(obj, fn) {
      var _keys, filtered;
      filtered = objelity.filterObject(obj, fn);
      _keys = objelity.deepKeys(filtered);
      if (_keys.length <= 0) {
        return {};
      } else {
        return _.get(filtered, _keys[0]);
      }
    }
248653
function flattenKeys(obj, /*optional args: */acc, prefix, prev_method) {
    acc = acc || [];
    prefix = prefix || '';
    Object.keys(obj).forEach(function (k) {
        var split = splitURL(k);
        if (typeof obj[k] == 'function') {
            acc.push([prefix + split.url, split.method || prev_method, obj[k]])
        }
        else {
            flattenKeys(obj[k], acc, prefix + split.url, split.method);
        }
    });
    return acc;
}
1108659
function(obj) {
       var args = Array.prototype.slice.call(arguments, 1);
       for (var i = 0; i < args.length; i++) {
         var source = args[i];
         if (source) {
           for (var prop in source) {
             obj[prop] = source[prop];
           }
         }
       }
       return obj;
    }
969188
function( obj ){
      if( obj == null ){
        return obj;
      } if( $$.is.array(obj) ){
        return obj.slice();
      } else if( $$.is.plainObject(obj) ){
        return $$.util.clone( obj );
      } else {
        return obj;
      }
    }
838099
function ( obj ) {
		var result = 0;

		if ( obj.length > 0 ) {
			result = obj.reduce( function ( prev, cur ) {
				return prev + cur;
			});
		}

		return result;
	}
522519
function serializeObject(obj) {
  var seen = [];

  return JSON.stringify(obj, function(key, val) {
    val = toJsonReplacer(key, val);
    if (isObject(val)) {

      if (seen.indexOf(val) >= 0) return '...';

      seen.push(val);
    }
    return val;
  });
}
1172940
function defaultify (obj) {
    return Object.keys(self.defaults).reduce(function (acc, key) {
      if (!acc[key]) { acc[key] = self.defaults[key] }
      return acc;
    }, obj);
  }
1304680
function fromObject (obj) {
  let polygons = obj.polygons.map(polygonLike => poly3.fromObject(polygonLike))
  let shape3 = fromPolygons(polygons)
  shape3.isCanonicalized = obj.isCanonicalized
  shape3.isRetesselated = obj.isRetesselated
  return shape3
}
303127
function(obj) {
		if (arguments.length < 2) throw new Error('cannot call _.get() without specifying at least one key');

		for (var i = 1; i < arguments.length; i++) {
			if (obj === undefined || obj === null) return;

			obj = obj[arguments[i]];
		}

		return obj;
	}
838987
function jPretty(obj) {
  // make sure data is a json obj
  if(typeof obj === "string") {
    obj = obj.replace(/\s/g,"");
    obj = obj.replace(/'/g,'"');
  }
  let gl;
  try {
    
    const p = JSON.parse(obj); 
    gl = obj; // already stringified
  } catch (e) { // not stringified
      if(typeof obj === "string") {
        obj = obj.replace(/([,|{|\s|])([a-zA-Z0-9]*?)([\s|]*\:)/g,'$1"$2"$3');
      }

      const s = JSON.stringify(obj);
      const k = JSON.parse(JSON.stringify(obj));
       if (k && typeof k === 'object') {
        gl = s;
      } else {
        if(typeof obj === "string") {
        //console.log("ERROR: " + );
        obj = obj.replace(/"/g,"'");
        obj = obj.replace(/'/g,'"');
        
        gl = ((obj));
        } else {
          return new Error(`jpretty: input is not recognised json: ${typeof obj}- ${JSON.stringify(obj)}`);
        }
      }
  }

  return (() => {
    let jp = prettyJson(gl); 
    if(typeof window !== 'undefined') {
      console.log("jPretty loaded in browser");
        jp = jp.replace(/\{\}/g,"<br/>{}");
    }
    return jp;
  })()
}
685531
function invert(obj) {
    let result = {};
    let keys = Object.keys(obj);
    for (let i = 0, length = keys.length; i < length; i++) {
      result[obj[keys[i]]] = keys[i];
    }
    return result;
  }
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;
        }
627754
function objMerge(a, b) {
	var obj = {};

	Object.keys(a).forEach(function (key) {
		obj[key] = a[key];
	});

	Object.keys(b).forEach(function (key) {
		obj[key] = b[key];
	});

	return obj;
}