code: function flatten(object, delimiter) {
      var flattened = {};
  
      forEach(getLeaves(object, delimiter), function (leaf) {
        flattened[leaf.key] = leaf.value;
      });
  
      return flattened;
    }
docs: /* Public: Flattens an object into a single level. All previously nested
  objects now have keypaths for keys. The delimiter can also be
  specified as a second parameter.
  
  object    - A deeply nested Object to flatten.
  delimiter - A delimiter to use in the keypaths (default: ".").
  
  Examples
  
  var obj = {a: {b: 'leaf 1', c: 'leaf 2'}};
  flatten(obj);
  // => {'a.b': 'leaf 1', 'ac': 'leaf 2'}
  
  Returns flattened Object.