Effect CommunityEC
Effect Community2y ago
22 replies
jessekelly

`Schema.omit()` Overlooks `Schema.fromKey` Properties: Intentional Behavior?

Schema.omit() seems to ignore props that come from Schema.fromKey. Is this intentional? It's quite problematic. Ideally, I would like fns like omit etc to be more transparent and work the same regardless of how the props w/in the schema are actually defined.

import { Schema } from "@effect/schema";

const s = Schema.Struct({
  c: Schema.Number.pipe(Schema.propertySignature, Schema.fromKey("b"))
})

s.pipe(Schema.omit("c")) // type error :( no key "c"


https://effect.website/play#84e0c1c24508
Was this page helpful?