Replies: 1 comment 3 replies
-
declare const d: unique symbol
interface Context {
str: string;
num: number;
nested: {
value: number;
nested2: {
value2: string;
};
};
}
type Keys<A> = S.Join<L.Required<O.Paths<A>>, '.'>
type Regev<A> = {
[K in Keys<A>]: {
propertyPath: K
type: O.Path<A, S.Split<K, '.'>>
}
}
type t = Regev<Context> |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
millsp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So basically what I want to achieve is the following:
Given an example interface
I want to be able to produce the following type:
Currently what I can get working is as follow:
Which produces:
In my tries to achieve my goal I came up with:
Which produces
TS2589: Type instantiation is excessively deep and possibly infinite.
I then tried:
Which produces
TS2321: Excessive stack depth comparing types 'Join { [K in keyof Paths ]-?: Paths [K]; }, List >, ".">' and 'string | number | symbol'.
@millsp any thoughts on this matter will be much appreciated :-)
Beta Was this translation helpful? Give feedback.
All reactions