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
I believe this is due to legacy reasons as in the past TokenTypes could be classes with static properties. The fact this structure only has a single mandatory property (name) means that any API that accepts TokenType (e.g CONSUME) could also accept (by mistake) other similar structures. For example a JS Function has name property and is therefore acceptable anywhere a TokenType is accepted.
I believe the TokenType structure should more closely match what is returned by "createToken"
which means a-lot less if any optional properties.
Also getting rid of the upper case property names would also be advisable.
The text was updated successfully, but these errors were encountered:
By definition this is a breaking change, however if the creation of TokenTypes is always done by
calling createToken, does it matter if the API gets broken? does it really mandate an new major version?
The TokenType structure has many optional properties.
I believe this is due to legacy reasons as in the past TokenTypes could be classes with static properties. The fact this structure only has a single mandatory property (name) means that any API that accepts TokenType (e.g CONSUME) could also accept (by mistake) other similar structures. For example a JS Function has name property and is therefore acceptable anywhere a TokenType is accepted.
I believe the TokenType structure should more closely match what is returned by "createToken"
which means a-lot less if any optional properties.
Also getting rid of the upper case property names would also be advisable.
The text was updated successfully, but these errors were encountered: