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
There has been interest from a couple parties recently to convert this project to TypeScript or at the very least provide type definitions to the library.
There are three things I would like to bring up and discuss.
None of these are planned for the initial PR when converting to TypeScript.
Just things that would like to figure out and work on afterwards.
null vs undefined
I saw some usage of null in the code.
I understand that it is probably from the fact the JSON uses null.
On the other hand the typical recommendation for bottom value is undefined.
Some of the code needs to handle both.
Should it be consolidated? Will there be any impact?
I don't see any downside to this but would like to get some feedback on this.
Macaroon class vs closure
newMacaroon() returns a new instance of Macaroon.
This pose a problem as all properties are accessible to the user in JavaScript.
An alternative approach is to use closure to keep private values really private.
Private property #prop is coming to class in new ECMAScript and is available to TypeScript,
but personally I don't see the need to as closure will work just fine and the especially Macaroon class should be considered final, not extensible to the user.
V1 vs V2
There are some slight design issue that V1 code and V2 code are mixed together.
Not too big a deal but would love to refactor that in the future.
There has been interest from a couple parties recently to convert this project to TypeScript or at the very least provide type definitions to the library.
A PR has been created to add the later #50
This issue is to track a discussion around the advantages, disadvantages, and necessary tasks to complete the conversion.
The text was updated successfully, but these errors were encountered: