-
Notifications
You must be signed in to change notification settings - Fork 911
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
refactor(experimental): add ClusterUrl
types
#2084
refactor(experimental): add ClusterUrl
types
#2084
Conversation
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
0dc7a6d
to
f883a80
Compare
f883a80
to
c9bb45e
Compare
Merge activity
|
export type TestnetUrl = string & { '~cluster': 'testnet' }; | ||
export type ClusterUrl = string | MainnetUrl | DevnetUrl | TestnetUrl; | ||
|
||
export function mainnet(putativeString: string): MainnetUrl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit regarding my favorite word to use in code. This is usually the word I use for assertion functions (ie. ones whose return type is foo is Bar
). Putative means ‘supposed’ or ‘assumed to exist.’
This puppy doesn't make any assertions; it's just a typecast utility. mainnet(url: string): MainnetUrl
would do fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is your favorite word in code? What about foo
? Personally, mine is console.log("FLARE")
, but that never gets committed :).
🎉 This PR is included in version 1.90.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |
As per @lorisleiva's suggestion, here's some types for cluster URLs!
Straight from this comment