interface Foo {
bar?: {
baz?: string;
}
}
declare let foo: Foo | undefined;
[|foo && foo.bar && foo.bar.baz|]
It should be possible to convert that chain into the following:
interface Foo {
bar?: {
baz?: string;
}
}
declare let foo: Foo | undefined;
foo?.bar?.baz;
It should be possible to convert that chain into the following: