-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: add a new ValueOrUndefined common type #2551
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2551 +/- ##
==========================================
- Coverage 82.99% 82.20% -0.79%
==========================================
Files 925 927 +2
Lines 20628 20860 +232
Branches 3253 3310 +57
==========================================
+ Hits 17120 17149 +29
- Misses 3388 3574 +186
- Partials 120 137 +17 ☔ View full report in Codecov by Sentry. |
@@ -35,3 +35,4 @@ export interface Json { | |||
export type JsonValue = Json | Json[] | string | number | boolean | null; | |||
export type PrimitiveValue = string | number | boolean; | |||
export type ValueOrNull<T> = T | null; | |||
export type ValueOrUndefined<T> = T | undefined; |
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.
How's this differ from ?: T
?
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.
its the same. I feel this is just a bit more cleaner when we have to return something from a function or use this as a type instead of doing | undefined
Description
Adding a new generic type.