analytics.js
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;
}
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;
}
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 ; }
Flatten a nested object into a single level space-delimited
hierarchy.

Based on https://github.com/hughsk/flat

@api private
@param {Object} source
@return {Object}
Flatten a nested object into a single level space - delimited hierarchy .