HEX
Server: Apache
System: Linux insrv.serversdaddy.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
User: jsaha (1066)
PHP: 8.3.6
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/alt-nodejs6/root/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
}