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;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from './Entity';
|
||||
export * from './ValueObject';
|
||||
export * from './Service';
|
||||
export * from './Service';
|
||||
export * from './Option';
|
||||
Reference in New Issue
Block a user