github Effect-TS/effect @effect/schema@0.63.1

latest releases: @effect/sql-sqlite-bun@0.12.7, @effect/typeclass@0.27.3, @effect/sql-sqlite-react-native@0.14.6...
6 months ago

Patch Changes

  • #2209 5d30853 Thanks @steffanek! - Add pickLiteral to Schema so that we can pick values from a Schema literal as follows:

    import * as S from "@effect/schema/Schema";
    
    const schema = S.literal("a", "b", "c").pipe(S.pickLiteral("a", "b")); // same as S.literal("a", "b")
    
    S.decodeUnknownSync(schema)("a"); // ok
    S.decodeUnknownSync(schema)("b"); // ok
    S.decodeUnknownSync(schema)("c");
    /*
    Error: "a" | "b"
    ├─ Union member
    │  └─ Expected "a", actual "c"
    └─ Union member
       └─ Expected "b", actual "c"
    */
  • #2217 6e350ed Thanks @gcanti! - JSONSchema: prune UndefinedKeyword if the property signature is marked as optional and contains a union that includes UndefinedKeyword, closes #2068

Don't miss a new effect release

NewReleases is sending notifications on new releases.