Repository navigation
Alternate link to Cloud Console #10283
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
Changes from all commits
2041562
2bd47aa
5195354
e3bae08
346a261
49b7653
0eb7e80
502ccce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,14 +11,9 @@ export function isRuntime(maybe: string): maybe is Runtime { | |
|
|
||
| /** Type deduction helper to narrow a runtime to a language. */ | ||
| export function runtimeIsLanguage<L extends Language>( | ||
| runtime: Runtime, | ||
| runtime: Runtime | undefined, | ||
| language: L, | ||
| ): runtime is Runtime & RuntimeOf<L> { | ||
| return runtime.startsWith(language); | ||
| } | ||
|
|
||
| /** Check if an optional runtime string belongs to a given language. */ | ||
| export function isLanguageRuntime(runtime: string | undefined, language: Language): boolean { | ||
| return !!runtime && runtime.startsWith(language); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In TypeScript I know we can do thing like
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love null coalescing, but functions that return type information rather than booleans are weeeeeird. E.g. you have to say |
||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.