Your IP : 18.118.1.100


Current Path : /opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils/
Upload File :
Current File : //opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/lib/utils/deep-sort-object.js

'use strict'
var sortedObject = require('sorted-object')

module.exports = function deepSortObject (obj, sortBy) {
  if (obj == null || typeof obj !== 'object') return obj
  if (obj instanceof Array) {
    return obj.map(function (x) {
      return deepSortObject(x, sortBy)
    })
  }
  obj = sortedObject(obj)
  Object.keys(obj).forEach(function (key) {
    obj[key] = deepSortObject(obj[key], sortBy)
  })
  return obj
}

?>