I use nominal types to help differentiate between regular strings and strings that come from a serialized object. For example, this is what I use to create nominal types:
This type guard will always fail due to requiring an intersection between a primitive and a table. Therefore, I cannot usefully guard against any nominal types.
I use nominal types to help differentiate between regular strings and strings that come from a serialized object. For example, this is what I use to create nominal types:
The issue with this is that the guard builds to be:
This type guard will always fail due to requiring an intersection between a primitive and a table. Therefore, I cannot usefully guard against any nominal types.