The brand whose keys to preserve
The new underlying value type
type UserId = Brand<string, 'UserId' | 'validated'>;
type NumericUserId = ChangeBaseBrand<UserId, number>;
// NumericUserId is Brand<number, 'UserId' | 'validated'>
// Useful for type conversions
type SerializedData = Brand<string, 'json' | 'validated'>;
type ParsedData = ChangeBaseBrand<SerializedData, object>;
Changes the underlying value type of a brand while preserving all brand keys.