Effect CommunityEC
Effect Community2y ago
21 replies
RJ

TypeScript Function for Schema.Struct Without Context

I'd like to write a function which accepts a Schema.Struct, but with no context, but I'm not sure how. Basically, fill in the ???:

const structsWithNoContextOnly = <S extends ???>(s: S) => {
  s.fields // where this works without type errors
  Schema.decodeUnknownSync(s)(null) // and this too
}


What's the best way to do this?
Was this page helpful?