github arktypeio/arktype arktype@2.0.0-dev.28

latest releases: @arktype/util@0.49.0, @ark/util@0.49.0, @ark/type@2.1.22...
pre-release14 months ago

Fix inference for constrained or morphed optional keys (#1040)

const repro = type({
	normal: "string>0",
	"optional?": "string>0"
})

type Expected = { normal: string; optional?: string }

// these are both now identical to Expected
// (previously, optional was inferred as string.moreThanLength<0>)
type Actual = typeof repro.infer
type ActualIn = typeof repro.infer

Don't miss a new arktype release

NewReleases is sending notifications on new releases.