Omit key recursively?

I have a type that references itself.
type TParseObject<T>={
[key in keyof T]?: string | TParseObject<T>
};
type TParseObject<T>={
[key in keyof T]?: string | TParseObject<T>
};
So for example
type Foo = ['a', 'b', 'c']
const Bar: TParseObject<Foo> = {
a: {
b: 'ok',
c:{
b: 'not ok'
}
}
}
type Foo = ['a', 'b', 'c']
const Bar: TParseObject<Foo> = {
a: {
b: 'ok',
c:{
b: 'not ok'
}
}
}
How can I recursively omit keys such that nested objects can only contain unused ones?
1 Reply
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server