makeSchemableClass work
This commit is contained in:
@@ -32,7 +32,7 @@ export function makeSchemableClass<
|
|||||||
schemaWithDefaultValues,
|
schemaWithDefaultValues,
|
||||||
} as const satisfies SchemableConfig
|
} as const satisfies SchemableConfig
|
||||||
|
|
||||||
return class {
|
return class SchemableObject {
|
||||||
static readonly $schemableConfig = $schemableConfig
|
static readonly $schemableConfig = $schemableConfig
|
||||||
static readonly schema = schema
|
static readonly schema = schema
|
||||||
static readonly schemaWithDefaultValues = schemaWithDefaultValues
|
static readonly schemaWithDefaultValues = schemaWithDefaultValues
|
||||||
|
|||||||
@@ -13,4 +13,7 @@ const UserSchemaObject = makeSchemableClass({ schema: UserSchema })
|
|||||||
class User extends UserSchemaObject {}
|
class User extends UserSchemaObject {}
|
||||||
|
|
||||||
const user1 = new User({ id: 1n })
|
const user1 = new User({ id: 1n })
|
||||||
const user2 = newSchemable(User)
|
const user2 = newSchemable(User, { id: 2n })
|
||||||
|
|
||||||
|
console.log(user1)
|
||||||
|
console.log(user2)
|
||||||
|
|||||||
Reference in New Issue
Block a user