import { Schema as S } from "@effect/schema";
import { Effect } from "effect";
const TestType = S.Struct({
aaa: S.String,
bbb: S.propertySignature(S.String).pipe(S.fromKey("ZZZ")),
});
const PartialTestType = S.partial(TestType);
test("partial decoding", () => {
const input = { aaa: "aaaval", ZZZ: "zzzval" };
const expected = { aaa: "aaaval", bbb: "zzzval" };
const actual = Effect.runSync(S.decode(TestType)(input));
expect(actual).toStrictEqual(expected);
});
import { Schema as S } from "@effect/schema";
import { Effect } from "effect";
const TestType = S.Struct({
aaa: S.String,
bbb: S.propertySignature(S.String).pipe(S.fromKey("ZZZ")),
});
const PartialTestType = S.partial(TestType);
test("partial decoding", () => {
const input = { aaa: "aaaval", ZZZ: "zzzval" };
const expected = { aaa: "aaaval", bbb: "zzzval" };
const actual = Effect.runSync(S.decode(TestType)(input));
expect(actual).toStrictEqual(expected);
});