Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const sortDeep = (object) => {
if (!Array.isArray(object)) {
if (!(typeof object === 'object') || object === null) {
return object;
}
return _.mapValues(object, sortDeep);
}
return sortAny(object.map(sortDeep));
};