You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #106 introduces a helper type that makes TS not forget the branding when defining a new record type. This is currently only applied to the value type of the record, as applying it to the key type breaks .literal() on records with branded keys:
typeBrandedString=The<typeofBrandedString>;constBrandedString=string.withBrand('BrandedString');typeBrandedKVRecord=The<typeofBrandedKVRecord>;// Assuming this record remembers the branding on the keytype.constBrandedKVRecord=record(BrandedString,BrandedString);expectTypeOf(BrandedKVRecord.literal({a: 'b',// TS error: argument of type { a: string } not assignable to [...]})).toEqual<Record<BrandedString,BrandedString>>();
This seems to be a problem stemming from DeepUnbranded<T> not properly dealing with the branded key type.
The text was updated successfully, but these errors were encountered:
PR #106 introduces a helper type that makes TS not forget the branding when defining a new record type. This is currently only applied to the value type of the record, as applying it to the key type breaks
.literal()
on records with branded keys:This seems to be a problem stemming from
DeepUnbranded<T>
not properly dealing with the branded key type.The text was updated successfully, but these errors were encountered: