@kaspernj/api-maker 1.0.437 → 1.0.438

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaspernj/api-maker",
3
- "version": "1.0.437",
3
+ "version": "1.0.438",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -15,7 +15,12 @@ const useSorting = ({defaultParams, query}) => {
15
15
  const queryParams = useQueryParams()
16
16
  const searchKey = query.queryArgs.searchKey || "q"
17
17
  const qParams = calculateQParams(defaultParams, queryParams, searchKey)
18
- const matchSortParam = qParams.s?.match(/^(.+?)( asc| desc|)$/)
18
+ let matchSortParam
19
+
20
+ if (typeof qParams.s == "string") {
21
+ matchSortParam = qParams.s?.match(/^(.+?)( asc| desc|)$/)
22
+ }
23
+
19
24
  const sortAttribute = matchSortParam ? camelize(matchSortParam[1], true) : null
20
25
  const sortMode = matchSortParam ? matchSortParam[2].trim() : null
21
26