|
|
@ -56,6 +56,7 @@ import type { DeepLinkError } from "../interfaces/deepLinks"; |
|
|
|
|
|
|
|
// Helper function to extract the first key from a Zod object schema
|
|
|
|
function getFirstKeyFromZodObject( |
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
|
schema: z.ZodObject<any>, |
|
|
|
): string | undefined { |
|
|
|
const shape = schema.shape; |
|
|
@ -74,6 +75,7 @@ function getFirstKeyFromZodObject( |
|
|
|
export const ROUTE_MAP: Record<string, { name: string; paramKey?: string }> = |
|
|
|
Object.entries(deepLinkSchemas).reduce( |
|
|
|
(acc, [routeName, schema]) => { |
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
|
const paramKey = getFirstKeyFromZodObject(schema as z.ZodObject<any>); |
|
|
|
acc[routeName] = { |
|
|
|
name: routeName, |
|
|
|