wip
This commit is contained in:
7
packages/shared/domain/Option.ts
Normal file
7
packages/shared/domain/Option.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function coalesce<T>(value: T | undefined | null, fallback: T): T {
|
||||
return value ?? fallback;
|
||||
}
|
||||
|
||||
export function present<T>(value: T | undefined | null): T | undefined {
|
||||
return value === undefined || value === null ? undefined : value;
|
||||
}
|
||||
Reference in New Issue
Block a user