mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-01 22:01:49 +01:00
Add schema utils
This commit is contained in:
@@ -11,6 +11,7 @@ import { getUserAgent } from '../util/getUserAgent';
|
||||
import { maybeParseUrl } from '../util/url';
|
||||
import * as durations from '../util/durations';
|
||||
import type { LoggerType } from '../types/Logging';
|
||||
import { parseUnknown } from '../util/schemas';
|
||||
|
||||
const BASE_URL = 'https://debuglogs.org';
|
||||
|
||||
@@ -26,7 +27,7 @@ const tokenBodySchema = z
|
||||
const parseTokenBody = (
|
||||
rawBody: unknown
|
||||
): { fields: Record<string, unknown>; url: string } => {
|
||||
const body = tokenBodySchema.parse(rawBody);
|
||||
const body = parseUnknown(tokenBodySchema, rawBody);
|
||||
|
||||
const parsedUrl = maybeParseUrl(body.url);
|
||||
if (!parsedUrl) {
|
||||
|
||||
Reference in New Issue
Block a user