chore: format whole repository with new configs

This commit is contained in:
Krzysztof Durek
2024-07-15 01:08:18 +02:00
parent 7a5c71cda3
commit 906e8de13b
349 changed files with 3565 additions and 3549 deletions

View File

@@ -1,8 +1,8 @@
import type * as schema from "@/server/db/schema";
import {
type BuildQueryResult,
type DBQueryConfig,
type ExtractTablesWithRelations,
import type {
BuildQueryResult,
DBQueryConfig,
ExtractTablesWithRelations,
} from "drizzle-orm";
import { z } from "zod";
/*
@@ -14,27 +14,27 @@ type Schema = typeof schema;
type TSchema = ExtractTablesWithRelations<Schema>;
export type IncludeRelation<TableName extends keyof TSchema> = DBQueryConfig<
"one" | "many",
boolean,
TSchema,
TSchema[TableName]
"one" | "many",
boolean,
TSchema,
TSchema[TableName]
>["with"];
export type InferResultType<
TableName extends keyof TSchema,
With extends IncludeRelation<TableName> | undefined = undefined,
TableName extends keyof TSchema,
With extends IncludeRelation<TableName> | undefined = undefined,
> = BuildQueryResult<
TSchema,
TSchema[TableName],
{
with: With;
}
TSchema,
TSchema[TableName],
{
with: With;
}
>;
type AnyObj = Record<PropertyKey, unknown>;
type ZodObj<T extends AnyObj> = {
[key in keyof T]: z.ZodType<T[key]>;
[key in keyof T]: z.ZodType<T[key]>;
};
const zObject = <T extends AnyObj>(arg: ZodObj<T>) => z.object(arg);