type-fest icon indicating copy to clipboard operation
type-fest copied to clipboard

Proposal: `SetRequired`, `SetNonNullable`, `Schema` based on nested key path

Open bvandercar-vt opened this issue 9 months ago • 0 comments

Example:

type O = {
  record: {
    nestedrecord: {
      nestedProp?: string
    }
  }
}

SetRequired<O, 'record.nestedrecord.nestedProp'> would have type

 {
  record: {
    nestedrecord: {
      nestedProp: string
    }
  }
}

And a similar implementation for SetNonNullable

Schema would allow changing the type of a specfic deeply-nested property, for example Schema<O, 'record.nestedrecord.nestedProp', number> would have type

{
  record: {
    nestedrecord: {
      nestedProp: number
    }
  }
}

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • The funding will be given to active contributors.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

bvandercar-vt avatar Sep 19 '23 20:09 bvandercar-vt