Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arjunlalb
Copy link
Contributor

Description

Adding a new generic type.

@arjunlalb arjunlalb requested a review from a team as a code owner November 29, 2023 08:55
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5386d3b) 82.99% compared to head (0796f01) 82.20%.
Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link

Test Results

       4 files  ±0     316 suites  ±0   31m 57s ⏱️ +14s
1 135 tests ±0  1 135 ✔️ ±0  0 💤 ±0  0 ±0 
1 145 runs  ±0  1 145 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 0796f01. ± Comparison against base commit d3ddf2a.

@@ -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;
Copy link
Contributor

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?

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants