function parseSortOrder(params = {}) {
  let value = params.sortOrder || params.order
  // If value is one of the supported keywords, convert to a number
  if (/^asc(ending)?$|^desc(ending)?$/.test(String(value))) {
    value = /^asc/.test(value) ? 1 : -1
  }
  return Math.abs(value) === 1 ? Number(value) : null
}
Parses the `sortOrder` param.

Takes the query params object from the API request, looks for an `order` or
`sortOrder` param (both are supported). If a valid order param was provided
it converts the value to a number (1 for ascending, -1 for descending).
Otherwise, it will return null.

Supported values:
- "ascending" == "asc" == 1
- "descending" == "desc" == -1

@param {Object} params The query params from the API request
@return {number | null} `1` for ascending or `-1` for descending