prisma-generator-express 1.36.0 → 1.37.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "prisma-generator-express",
3
3
  "description": "Prisma generator for Hono CRUD API with OpenAPI documentation",
4
- "version": "1.36.0",
4
+ "version": "1.37.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "MIT",
@@ -15,7 +15,7 @@ const parseQueryValue = (value: string, key?: string): unknown => {
15
15
  if (value.startsWith('{') || value.startsWith('[') || value.startsWith('"')) {
16
16
  try {
17
17
  const parsed = JSON.parse(value)
18
- return sanitizeKeys(parsed)
18
+ return parseQueryParams(sanitizeKeys(parsed) as QueryParams)
19
19
  } catch {
20
20
  // fall through
21
21
  }
@@ -34,7 +34,11 @@ export const parseQueryParams = (params: QueryParams): unknown => {
34
34
  return parseQueryValue(params)
35
35
  }
36
36
  if (Array.isArray(params)) {
37
- return params.map(parseQueryParams)
37
+ return params.map((item) =>
38
+ typeof item === 'string'
39
+ ? parseQueryValue(item)
40
+ : parseQueryParams(item as QueryParams),
41
+ )
38
42
  }
39
43
  if (isObject(params)) {
40
44
  const parsedParams: Record<string, unknown> = {}
@@ -44,7 +48,7 @@ export const parseQueryParams = (params: QueryParams): unknown => {
44
48
  if (typeof raw === 'string') {
45
49
  parsedParams[key] = parseQueryValue(raw, key)
46
50
  } else {
47
- parsedParams[key] = sanitizeKeys(raw)
51
+ parsedParams[key] = parseQueryParams(raw as QueryParams)
48
52
  }
49
53
  }
50
54
  return parsedParams