Add schema utils
This commit is contained in:
parent
c8a729f8be
commit
b26466e59d
45 changed files with 674 additions and 151 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue