Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Traversing Nullable Types #37

Open
beeequeue opened this issue May 10, 2019 · 0 comments
Open

Traversing Nullable Types #37

beeequeue opened this issue May 10, 2019 · 0 comments

Comments

@beeequeue
Copy link

This package is very useful when it comes to traversing optional chains, and therefore seems to have a good structure set up for the types.
Would it be possible to add some kind of OC type that allows for nullable type traversal?

e.g.

interface Foo {
  bar?: {
    biz?: {
      baz?: string
    }
  }
}

type Baz = Foo["bar"]["biz"]["baz"]
                      ^ "biz" does not exist on type "{ biz?: ... } | undefined"

type GoodBaz = OC<Foo, "bar", "biz", "baz"> // string | undefined
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant