Sanctuary `Maybe` refers to a value, but being used as type here

204 views Asked by At

I have a function like this

export const createMemberId: (x: any) => Maybe<MemberId> = (x: any) => {
    try {
        return Just({
            memberId: mongoose.Types.ObjectId(x),
        });
    } catch (e) {
        return Nothing;
    }
};

It gets any and return Maybe<MemberId>

But typescript show me this error

`Maybe` refers to a value, but being used as type here

What should I do?

0

There are 0 answers