function convertSort (sort) {
  if (typeof sort !== 'object' || Array.isArray(sort)) {
    return sort;
  }

  return Object.keys(sort).reduce((result, key) => {
    result[key] = typeof sort[key] === 'object'
      ? sort[key] : parseInt(sort[key], 10);

    return result;
  }, {});
}
// Makes sure that $sort order is always converted to an actual number
Makes sure that $sort order is always converted to an actual number
Makes sure that $sort order is always converted to an actual number
function convertSort (sort) {
  if (typeof sort !== 'object' || Array.isArray(sort)) {
    return sort;
  }
  return Object.keys(sort).reduce((result, key) => {
    result[key] = typeof sort[key] === 'object'
      ? sort[key] : parseInt(sort[key], 10);
    return result;
  }, {});
}
function convertSort ( sort ) { if ( typeof sort !== 'object' || Array . isArray ( sort ) ) { return sort ; } return Object . keys ( sort ) . reduce ( ( result , key ) => { result [ key ] = typeof sort [ key ] === 'object' ? sort [ key ] : parseInt ( sort [ key ] , 10 ) ; return result ; } , { } ) ; }
Makes sure that $sort order is always converted to an actual number
Makes sure that $sort order is always converted to an actual number