(environment: string, userId: string)
| 18 | } |
| 19 | |
| 20 | async function getMothershipUrl(environment: string, userId: string): Promise<string | null> { |
| 21 | const parsedEnvironment = mothershipEnvironmentSchema.safeParse(environment) |
| 22 | if (!parsedEnvironment.success) return ENV_URLS[environment] ?? null |
| 23 | |
| 24 | return getMothershipBaseURL({ |
| 25 | userId, |
| 26 | environment: parsedEnvironment.data, |
| 27 | fallbackUrl: ENV_URLS[environment], |
| 28 | }) |
| 29 | } |
| 30 | |
| 31 | const ENDPOINT_PATTERN = /^[a-zA-Z0-9_-]+(?:\/[a-zA-Z0-9_-]+)*$/ |
| 32 |
no test coverage detected