lib/util/common.js
function sortObject(obj) {
  assert.ok(_.isObject(obj), 'Parameter should be an object! - ' + util.inspect(obj));
  assert.ok(!_.isArray(obj), 'Parameter should be an object, got array: ' + util.inspect(obj));

  var sortedKeys = _.keys(obj).sort();
  var sortedObjs = [];

  _.each(sortedKeys, function(key) {
    var val = {};
    val[key] = obj[key];
    sortedObjs.push(val);
  });

  return sortedObjs;
}
function sortObject(obj) {
  assert.ok(_.isObject(obj), 'Parameter should be an object! - ' + util.inspect(obj));
  assert.ok(!_.isArray(obj), 'Parameter should be an object, got array: ' + util.inspect(obj));

  var sortedKeys = _.keys(obj).sort();
  var sortedObjs = [];

  _.each(sortedKeys, function(key) {
    var val = {};
    val[key] = obj[key];
    sortedObjs.push(val);
  });

  return sortedObjs;
}
function sortObject ( obj ) { assert . ok ( _ . isObject ( obj ) , 'Parameter should be an object! - ' + util . inspect ( obj ) ) ; assert . ok ( ! _ . isArray ( obj ) , 'Parameter should be an object, got array: ' + util . inspect ( obj ) ) ; var sortedKeys = _ . keys ( obj ) . sort ( ) ; var sortedObjs = [ ] ; _ . each ( sortedKeys , function ( key ) { var val = { } ; val [ key ] = obj [ key ] ; sortedObjs . push ( val ) ; } ) ; return sortedObjs ; }
converts an object with arbitrary keys into an array sorted by keys
converts an object with arbitrary keys into an array sorted by keys