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
Nestia throws the following error on branded properties:
- number & Brand<"ProductPrice">:
- nonsensible intersection
With the ProductPrice being of the following type (with a standard Branded implementation):
typeProductPrice=Branded<number,'ProductPrice'>;
I wonder if there is a way for Nestia to reduce the above type to just number?
Maybe we could somehow define the Brand wrapper to make Nestia ignore intersections with that type? Or to define the internal brand property key (in my case __brand) to ignore?
The text was updated successfully, but these errors were encountered:
Branded type is not supported, because it needs re-interpret type casting, the type unsafe strategy.
I'm aware it requires type casting. Hence it shouldn't be enabled by default.
But branded types are widely used. So an escape hatch is useful because they're gonna be used anyway. And having a built in way to do that increases Nestia's appeal.
I dont see what would be the harm in defining an object key in the config, which if an object has, and the object is a part of an intersection, makes the object get discarded from the intersection by Nestia.
It's a completely opt in behavior and the user can be made aware of the risks if the key is mistyped or not unique.
Feature Request
Nestia throws the following error on branded properties:
With the
ProductPrice
being of the following type (with a standardBranded
implementation):I wonder if there is a way for Nestia to reduce the above type to just number?
Maybe we could somehow define the
Brand
wrapper to make Nestia ignore intersections with that type? Or to define the internal brand property key (in my case__brand
) to ignore?The text was updated successfully, but these errors were encountered: