effect
effect copied to clipboard
Get combinator to access (nested) properties of a struct
What is the problem this feature would solve?
const A = S.struct({
b: S.string,
c: S.struct({ d: S.boolean })
});
const B = A.pipe(S.get("b")); // S.Schema<string, string>
const D = A.pipe(S.get("c.d")); // S.Schema<boolean, boolean>
What is the feature you are proposing to solve the problem?
A new combinator that allows to get parts of a schema.
What alternatives have you considered?
Declaring parts of my schema that I want to reuse explicitly. But often this only adds syntactic noise.