Effect CommunityEC
Effect Community17mo ago
5 replies
spaethnl

Creating Encoded Structs from Schemas in TypeScript

Is there anything like encodedStruct/typeStruct that corresponds to encodedSchema/typeSchema? typeSchema and encodedSchema return a Schema that loses the fact that it is a Struct.
I'm thinking something like:
export const encodedStruct = <Fields extends S.Struct.Fields>(schema: S.Struct<Fields>): S.Struct<S.Struct.Encoded<Fields>> => S.make(AST.encodedAST(schema.ast))
Was this page helpful?