Skip to content

Commit

Permalink
Handle null check
Browse files Browse the repository at this point in the history
  • Loading branch information
bloodyowl committed Oct 22, 2024
1 parent f0df88a commit c79d04b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AsyncData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class __AsyncData<A> {
*/
static Done = <A = never>(value: A): AsyncData<A> => {
const existing = AsyncDataStore.get(value);
if (existing === undefined) {
if (existing == undefined) {
const asyncData = Object.create(ASYNC_DATA_PROTO) as Done<A>;
// @ts-expect-error
asyncData.tag = "Done";
Expand Down
6 changes: 3 additions & 3 deletions src/OptionResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class __Option<A> {

static Some = <A = never>(value: A): Option<A> => {
const existing = SomeStore.get(value);
if (existing === undefined) {
if (existing == undefined) {
const option = Object.create(OPTION_PROTO) as Some<A>;
// @ts-expect-error
option.tag = "Some";
Expand Down Expand Up @@ -329,7 +329,7 @@ class __Result<A, E> {

static Ok = <A = never, E = never>(value: A): Result<A, E> => {
const existing = OkStore.get(value);
if (existing === undefined) {
if (existing == undefined) {
const result = Object.create(RESULT_PROTO) as Ok<A, E>;
// @ts-expect-error
result.tag = "Ok";
Expand All @@ -345,7 +345,7 @@ class __Result<A, E> {

static Error = <A = never, E = never>(error: E): Result<A, E> => {
const existing = ErrorStore.get(error);
if (existing === undefined) {
if (existing == undefined) {
const result = Object.create(RESULT_PROTO) as Error<A, E>;
// @ts-expect-error
result.tag = "Error";
Expand Down

0 comments on commit c79d04b

Please sign in to comment.