lib/utils.js
function (obj) {
  var ret = {};

  if( Object.prototype.toString.call(obj) === '[object Object]' ) {
    for (var key in obj) {
      ret[key] = arrayClean(obj[key]);
    }
  }
  else if( Object.prototype.toString.call(obj) === '[object Array]' ) {
    if (obj.length === 1) {
      ret = arrayClean(obj[0]);
    }
    else {
      ret = new Array;
      for(var i=0;i<obj.length;i++) {
        ret.push(arrayClean(obj[i]));
      }
    }
  }
  else {
    ret = obj;
  }
  return ret;
}
function (obj) {
  var ret = {};

  if( Object.prototype.toString.call(obj) === '[object Object]' ) {
    for (var key in obj) {
      ret[key] = arrayClean(obj[key]);
    }
  }
  else if( Object.prototype.toString.call(obj) === '[object Array]' ) {
    if (obj.length === 1) {
      ret = arrayClean(obj[0]);
    }
    else {
      ret = new Array;
      for(var i=0;i<obj.length;i++) {
        ret.push(arrayClean(obj[i]));
      }
    }
  }
  else {
    ret = obj;
  }
  return ret;
}
function ( obj ) { var ret = { } ; if ( Object . prototype . toString . call ( obj ) === '[object Object]' ) { for ( var key in obj ) { ret [ key ] = arrayClean ( obj [ key ] ) ; } } else if ( Object . prototype . toString . call ( obj ) === '[object Array]' ) { if ( obj . length === 1 ) { ret = arrayClean ( obj [ 0 ] ) ; } else { ret = new Array ; for ( var i = 0 ; i < obj . length ; i ++ ) { ret . push ( arrayClean ( obj [ i ] ) ) ; } } } else { ret = obj ; } return ret ; }
Recursively removes extraneous nested arrays from objects
@param  {Object|Array|String|Integer} obj
@return {Object}
Recursively removes extraneous nested arrays from objects