lib/obs.js
function sortObjectSchema(object, options) {
  var sort = {asc: sortAsc, desc: sortDesc},
      keys = Object.keys(object),
      outputObject = {};

  if (options.sort) {
    keys.sort(sort[options.sort]);
  }

  keys.forEach(function(key, index) {
    if (isObjectObject(object[key])) {
      object[key] = sortObjectSchema(object[key], options);
    }
    outputObject[keys[index]] = object[keys[index]];
  });

  return outputObject;
}
function sortObjectSchema(object, options) {
  var sort = {asc: sortAsc, desc: sortDesc},
      keys = Object.keys(object),
      outputObject = {};

  if (options.sort) {
    keys.sort(sort[options.sort]);
  }

  keys.forEach(function(key, index) {
    if (isObjectObject(object[key])) {
      object[key] = sortObjectSchema(object[key], options);
    }
    outputObject[keys[index]] = object[keys[index]];
  });

  return outputObject;
}
function sortObjectSchema ( object , options ) { var sort = { asc : sortAsc , desc : sortDesc } , keys = Object . keys ( object ) , outputObject = { } ; if ( options . sort ) { keys . sort ( sort [ options . sort ] ) ; } keys . forEach ( function ( key , index ) { if ( isObjectObject ( object [ key ] ) ) { object [ key ] = sortObjectSchema ( object [ key ] , options ) ; } outputObject [ keys [ index ] ] = object [ keys [ index ] ] ; } ) ; return outputObject ; }
Sort object schema.

@param {object} object
@param {object} options
@returns {object} Sorted object schema.
Sort object schema .