Skip to content

PickDeep strips null #880

Open
Open
@relsunkaev

Description

@relsunkaev

If you have following types

type Owner = {
  name: string;
  age: number;
};
type Pet = {
  name: string;
  age: number;
  owner: Owner | null;
};

the resulting type of PickDeep<Pet, "name" | "owner.name"> is

type Result = {
    name: string;
    // `owner` is no longer nullable
    owner: {
        name: string;
    };
}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions