© 2026 Hedgehog Software, LLC
extend(pick(...), omit(...))
Pick<...> & Omit<...>
import { Schema as S } from "@effect/schema"; type Model = {id: string} & Record<string, unknown> const makePatchSchema = <T extends Model>(schema: S.Schema<T>) => { type Patch = Pick<T, "id"> & Partial<Omit<T, "id">>; const patch: S.Schema<Patch> = schema.pipe( S.pick("id"), S.extend(schema.pipe(S.omit("id"), S.partial())), ); return patch; };
const patch
Type 'extend<SchemaClass<{ id: T["id"]; }, { id: T["id"]; }, never>, SchemaClass<{ [K in keyof Simplify<Omit<T, "id">>]?: Simplify<Omit<T, "id">>[K] | undefined; }, { [K in keyof Simplify<...>]?: Simplify<...>[K] | undefined; }, never>>' is not assignable to type 'Schema<Patch, Patch, never>'.