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

DelimiterCasedPropertiesDeep with Opaque yields wrong type

Open valkum opened this issue 2 years ago • 1 comments

When using DelimiterCasedPropertiesDeep with a type containing a Opaque field, the result seems wrong.

type O = Opaque<string, "O">
type D = DelimiterCasedPropertiesDeep<{partnerId: O}, '_'>

// Expected
// D: {partner_id: O}

// Actual
// D: {partner_id: {char_at, .....}}

It seems all functions for strings are also cased and then added.

valkum avatar Feb 18 '22 16:02 valkum

@valkum This is the expected behaviour, you have to use UnwrapOpaque to get the base type before passing it to another type.

skarab42 avatar Aug 31 '22 14:08 skarab42

Closing for now, comment if you believe this to still be an issue

voxpelli avatar Oct 13 '22 13:10 voxpelli