-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Branded types support #1066
Comments
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. |
Close by same reason with samchon/typia#933. I am not affordable to develop the feature, so give up this spec or do contribute please. |
If you stumbled across this issue, I have patched typia to support brands. See samchon/typia#911 (comment) |
This problem must be solved by defining priority relationship when insensible intersection type case. |
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: