0.1.1 #2

Merged
Thilawyn merged 47 commits from next into master 2024-01-17 20:47:13 +01:00
2 changed files with 0 additions and 53 deletions
Showing only changes of commit b848e43974 - Show all commits

View File

@@ -1,52 +0,0 @@
import { trait } from "@thilawyn/thilatrait"
import { JsonifiableObject } from "type-fest/source/jsonifiable"
import { z } from "zod"
export const JsonifiableSchemable = <
JsonifySchemaT extends z.ZodRawShape,
JsonifySchemaUnknownKeys extends z.UnknownKeysParam,
JsonifySchemaCatchall extends z.ZodTypeAny,
DejsonifySchemaT extends z.ZodRawShape,
DejsonifySchemaUnknownKeys extends z.UnknownKeysParam,
DejsonifySchemaCatchall extends z.ZodTypeAny,
Values extends {},
JsonifiedValues extends JsonifiableObject,
>(
jsonifySchema: z.ZodObject<
JsonifySchemaT,
JsonifySchemaUnknownKeys,
JsonifySchemaCatchall,
JsonifiedValues,
Values
>,
dejsonifySchema: z.ZodObject<
DejsonifySchemaT,
DejsonifySchemaUnknownKeys,
DejsonifySchemaCatchall,
Values,
JsonifiedValues
>,
) =>
trait(Parent => {
abstract class JsonifiableSchemable extends Parent {
abstract readonly schema: z.ZodObject<
z.ZodRawShape,
z.UnknownKeysParam,
z.ZodTypeAny,
Values,
Values
>
static readonly jsonifySchema = jsonifySchema
readonly jsonifySchema = jsonifySchema
static readonly dejsonifySchema = dejsonifySchema
readonly dejsonifySchema = dejsonifySchema
}
return JsonifiableSchemable
})

View File

@@ -1,3 +1,2 @@
export * from "./JsonifiableSchemable"
export * from "./JsonifiableSchemableClass"
export * from "./makeJsonifiableSchemableClass"