Would be good to cover if we can create Predicate type which will infer type based on some value in it:
typeA={a:1}|{a:2;b:2}|{a:3;b:3;c:3}// expect { one: { a: 1 }; two: { a: 2; b: 2 }; three: { a: 3; b: 3; c: 3 } };typeB={[KinA['a']]:// implementation// infer { a: 1 } if K equals 1// infer { a: 2; b: 2 } if K equals 2// infer { a: 3; b: 3; c: 3 } if K equals 3// But with using only A, not repeating the part of it}
Maybe sounds like another article
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Would be good to cover if we can create
Predicate
type which will infer type based on some value in it:Maybe sounds like another article