Skip to content

Commit c06fad0

Browse files
committed
optional yay input
1 parent 79fec82 commit c06fad0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shared/core/Result.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ export class Oops<L, A> {
131131
export class Yay<L, A> {
132132
readonly value: A;
133133

134-
constructor(value: A) {
135-
this.value = value;
134+
constructor(value?: A) {
135+
this.value = value || (undefined as unknown as A);
136136
}
137137

138138
isOops(): this is Oops<L, A> {
@@ -148,6 +148,6 @@ export const oops = <A, L>(l: L): XOR<A, L> => {
148148
return new Oops(l);
149149
};
150150

151-
export const yay = <A, L>(a: A): XOR<A, L> => {
151+
export const yay = <A, L>(a?: A): XOR<A, L> => {
152152
return new Yay<L, A>(a);
153153
};

0 commit comments

Comments
 (0)