Add OptionalPaths type#1443
Conversation
70c4d39 to
a488dbb
Compare
a488dbb to
ef1fa9e
Compare
ef1fa9e to
a8711d4
Compare
a8711d4 to
d72f38e
Compare
|
the new type says it can be used with type Tuple = [string, number?];
type Result = OmitDeep<Tuple, OptionalPaths<Tuple>>;
There is also a generic version of the same problem, which is close to the original use case from the issue: type MinimalObject<T extends object> = OmitDeep<T, OptionalPaths<T>>;That currently fails the path constraint. and I would add tests for: type RequiredUserFields = OmitDeep<UserFields, OptionalPaths<UserFields>>;
type OptionalUserFields = PickDeep<UserFields, OptionalPaths<UserFields>>;
type MinimalObject<T extends object> = OmitDeep<T, OptionalPaths<T>>;And if array support stays in scope, also add a tuple composition test. Right now the standalone |
Closes #1426