Effect CommunityEC
Effect Community16mo ago
4 replies
kondaurovdev

Converting `MySchema` to `DesiredSchema` in TypeScript

Hi,

is it possible to create a schema that can be converted to DesiredSchema ?

import { Schema as S } from "@effect/schema"

type MySchema = typeof MySchema.Type
const MySchema = 
  S.Struct({
    prop1: S.optional(S.Number)
  })

type DesiredSchema = {
  prop1?: number
}

function convert(input: MySchema): DesiredSchema {
  return input;
}
Was this page helpful?